LiteLLM Minor Fixes & Improvements (01/08/2025) - p2 (#7643)

* fix(streaming_chunk_builder_utils.py): add test for groq tool calling + streaming + combine chunks

Addresses https://github.com/BerriAI/litellm/issues/7621

* fix(streaming_utils.py): fix modelresponseiterator for openai like chunk parser

ensures chunk parser uses the correct tool call id when translating the chunk

 Fixes https://github.com/BerriAI/litellm/issues/7621

* build(model_hub.tsx): display cost pricing on model hub

* build(model_hub.tsx): show cost per token pricing + complete model information

* fix(types/utils.py): fix usage object handling
This commit is contained in:
Krish Dholakia 2025-01-08 19:45:19 -08:00 committed by GitHub
parent 39ee4c6bb4
commit 1e3370f3cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 206 additions and 21 deletions

View file

@ -17,7 +17,7 @@ class ModelResponseIterator:
def chunk_parser(self, chunk: dict) -> GenericStreamingChunk:
try:
processed_chunk = litellm.ModelResponse(**chunk, stream=True) # type: ignore
processed_chunk = litellm.ModelResponseStream(**chunk)
text = ""
tool_use: Optional[ChatCompletionToolCallChunk] = None
@ -46,7 +46,7 @@ class ModelResponseIterator:
.delta.tool_calls[0] # type: ignore
.function.arguments,
),
index=processed_chunk.choices[0].index,
index=processed_chunk.choices[0].delta.tool_calls[0].index,
)
if processed_chunk.choices[0].finish_reason is not None: