Skip to content

Commit

Permalink
fix: be compatible with custom model without full response (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: Qingyun Wu <[email protected]>
  • Loading branch information
jtsang4 and qingyun-wu authored Oct 13, 2023
1 parent 04319c9 commit 3eda9ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/oai/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def cost(cls, response: dict):
Returns:
The cost in USD. 0 if the model is not supported.
"""
model = response["model"]
model = response.get("model")
if model not in cls.price1K:
return 0
# raise ValueError(f"Unknown model: {model}")
Expand Down

0 comments on commit 3eda9ed

Please sign in to comment.