Merge branch 'geekan:main' into patch-3

This commit is contained in:
zhaoweiguo 2024-11-01 10:44:52 +08:00 committed by GitHub
commit 0e37450042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,9 +114,6 @@ class OpenAILLM(BaseLLM):
elif hasattr(chunk.choices[0], "usage"):
# The usage of some services is an attribute of chunk.choices[0], such as Moonshot
usage = CompletionUsage(**chunk.choices[0].usage)
elif "openrouter.ai" in self.config.base_url and chunk_has_usage:
# due to it get token cost from api
usage = chunk.usage
has_finished = True
log_llm_stream("\n")