Commit 63c4c8a4 authored by Your Name's avatar Your Name

Add backward compatibility methods for format_litellm_full and format_litellm_chunk

parent 203f97e0
...@@ -123,3 +123,12 @@ class OpenAIFormatter: ...@@ -123,3 +123,12 @@ class OpenAIFormatter:
def format_final_chunk(self, usage: dict = None) -> dict: def format_final_chunk(self, usage: dict = None) -> dict:
"""Format the final streaming chunk with usage information.""" """Format the final streaming chunk with usage information."""
return self.format_chunk("", is_final=True, usage=usage) return self.format_chunk("", is_final=True, usage=usage)
# Backward compatibility methods
def format_litellm_full(self, text: str, prompt_tokens: int, completion_tokens: int, tool_calls=None) -> dict:
"""Backward compatibility method - calls format_full."""
return self.format_full(text, prompt_tokens, completion_tokens, tool_calls)
def format_litellm_chunk(self, delta_text: str, is_final: bool = False, usage: dict = None) -> dict:
"""Backward compatibility method - calls format_chunk."""
return self.format_chunk(delta_text, is_final, usage)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment