A programming framework for agentic AI
fix: be compatible with custom model without full response (#222)
James Tsang3eda9ed74d6f
diff --git a/autogen/oai/completion.py b/autogen/oai/completion.pyindex f3ea897de..54739ec5d 100644--- a/autogen/oai/completion.py+++ b/autogen/oai/completion.py@@ -1026,7 +1026,7 @@ class Completion(openai_Completion):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}")