Skip to content

Commit

Permalink
Merge branch 'main' into 05hiteshbansal-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyun-wu authored Oct 13, 2023
2 parents dad9bf2 + 3eda9ed commit a3f42fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
# See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
# You can also set config_list directly as a list, for example, config_list = [{'model': 'gpt-4', 'api_key': '<your OpenAI API key here>'},]
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding"})
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
Expand Down
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 a3f42fc

Please sign in to comment.