diff --git a/examples/01_standalone_sdk/58_ask_oracle_tool/main.py b/examples/01_standalone_sdk/58_ask_oracle_tool/main.py index 950a53a0af..55cb3aa5f2 100644 --- a/examples/01_standalone_sdk/58_ask_oracle_tool/main.py +++ b/examples/01_standalone_sdk/58_ask_oracle_tool/main.py @@ -22,7 +22,7 @@ from openhands.sdk import LLM, Agent, LocalConversation, Tool from openhands.sdk.llm.llm_profile_store import LLMProfileStore -from openhands.tools.ask_oracle import ORACLE_PROFILE_NAME +from openhands.tools.ask_oracle import ORACLE_PROFILE_NAME, AskOracleTool DEFAULT_BASE_URL = "https://llm-proxy.app.all-hands.dev" @@ -40,7 +40,6 @@ with tempfile.TemporaryDirectory() as profile_store_dir: store = LLMProfileStore(profile_store_dir) - # The Oracle model is saved under the conventional profile name "oracle". store.save( ORACLE_PROFILE_NAME, LLM( @@ -58,7 +57,7 @@ base_url=base_url, usage_id="primary", ) - agent = Agent(llm=primary_llm, tools=[Tool(name="ask_oracle")]) + agent = Agent(llm=primary_llm, tools=[Tool(name=AskOracleTool.name)]) conversation = LocalConversation( agent=agent, workspace=os.getcwd(), @@ -73,6 +72,6 @@ ) conversation.run() - combined = conversation.state.stats.get_combined_metrics() - print(f"Total cost: ${combined.accumulated_cost:.6f}") - print(f"EXAMPLE_COST: {combined.accumulated_cost}") + cost = conversation.conversation_stats.get_combined_metrics().accumulated_cost + print(f"Total cost: ${cost:.6f}") + print(f"EXAMPLE_COST: {cost}")