mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 01:36:29 +02:00
feat: 优化判断逻辑
This commit is contained in:
parent
8695629fce
commit
a473c74c90
1 changed files with 1 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ class OpenAILLM(BaseLLM):
|
|||
log_llm_stream(chunk_message)
|
||||
collected_messages.append(chunk_message)
|
||||
if finish_reason:
|
||||
if hasattr(chunk, "usage") and chunk.usage:
|
||||
if hasattr(chunk, "usage") and chunk.usage is not None:
|
||||
# Some services have usage as an attribute of the chunk, such as Fireworks
|
||||
usage = CompletionUsage(**chunk.usage)
|
||||
elif hasattr(chunk.choices[0], "usage"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue