mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 08:46:48 +02:00
update openai_api.py
This commit is contained in:
parent
32d416bac9
commit
e094e2a615
1 changed files with 1 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ class OpenAILLM(BaseLLM):
|
|||
if has_finished:
|
||||
# for oneapi, there has a usage chunk after finish_reason not none chunk
|
||||
if chunk_has_usage:
|
||||
usage = CompletionUsage(**chunk.usage)
|
||||
usage = CompletionUsage(**chunk.usage) if isinstance(chunk.usage, dict) else chunk.usage
|
||||
if finish_reason:
|
||||
if chunk_has_usage:
|
||||
# Some services have usage as an attribute of the chunk, such as Fireworks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue