Skip to content

Commit

Permalink
Chainlit#1178 Fix AttributeError: 'ChatCompletionChunk' object has no…
Browse files Browse the repository at this point in the history
… attribute 'get' (Chainlit#1229)
  • Loading branch information
dvquy13 authored Aug 20, 2024
1 parent ea4c91e commit df334f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/chainlit/llama_index/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def on_event_end(

token_count = self.total_llm_token_count or None
raw_response = response.raw if response else None
model = raw_response.get("model", None) if raw_response else None
model = getattr(raw_response, "model", None)

if messages and isinstance(response, ChatResponse):
msg: ChatMessage = response.message
Expand Down

0 comments on commit df334f2

Please sign in to comment.