diff --git a/examples/agent_tools/README.md b/examples/agent_tools/README.md index 378d886..f22e6da 100644 --- a/examples/agent_tools/README.md +++ b/examples/agent_tools/README.md @@ -92,7 +92,7 @@ def execute_python_tool(code: str, description: str) -> str | None: api_key = os.environ.get( "HUAWEICLOUD_SDK_CODE_INTERPRETER_API_KEY", "" ) # 配置环境变量后,api_key无需在代码中传递亦可正常工作 - with code_session("your_region", "your_code_interpreter_name", api_key) as code_client: + with code_session("your_region", "your_code_interpreter_name", api_key=api_key) as code_client: response = code_client.invoke( operate_type="execute_code", api_key=api_key, diff --git a/examples/agent_tools/integrate_tools.py b/examples/agent_tools/integrate_tools.py index ba2f666..12f82fb 100644 --- a/examples/agent_tools/integrate_tools.py +++ b/examples/agent_tools/integrate_tools.py @@ -59,7 +59,7 @@ def execute_python_tool(code: str, description: str) -> str | None: api_key = os.environ.get( "HUAWEICLOUD_SDK_CODE_INTERPRETER_API_KEY", "" ) # 配置环境变量后,api_key无需在代码中传递亦可正常工作 - with code_session("your_region", "your_code_interpreter_name", api_key) as code_client: + with code_session("your_region", "your_code_interpreter_name", api_key=api_key) as code_client: response = code_client.invoke( operate_type="execute_code", api_key=api_key, @@ -134,7 +134,7 @@ def should_continue(state): @app.entrypoint -def agent_chat(): +def agent_chat(payload: dict): query = "告诉我1到100之间最大的质数" # 运行Agent