Skip to content

Commit

Permalink
Update openai_api.py
Browse files Browse the repository at this point in the history
不用对openrouter.ai单独处理
  • Loading branch information
zhaoweiguo authored Oct 31, 2024
1 parent 21d9c5a commit 0c0cfe0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions metagpt/provider/openai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ async def _achat_completion_stream(self, messages: list[dict], timeout=USE_CONFI
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")
Expand Down

0 comments on commit 0c0cfe0

Please sign in to comment.