mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-20 23:42:01 +00:00
fix: be compatible with custom model without full response (#222)
Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu>
This commit is contained in:
parent
04319c968a
commit
3eda9ed74d
@ -1026,7 +1026,7 @@ class Completion(openai_Completion):
|
|||||||
Returns:
|
Returns:
|
||||||
The cost in USD. 0 if the model is not supported.
|
The cost in USD. 0 if the model is not supported.
|
||||||
"""
|
"""
|
||||||
model = response["model"]
|
model = response.get("model")
|
||||||
if model not in cls.price1K:
|
if model not in cls.price1K:
|
||||||
return 0
|
return 0
|
||||||
# raise ValueError(f"Unknown model: {model}")
|
# raise ValueError(f"Unknown model: {model}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user