Replies: 1 comment
-
|
@godhao123 下次bug可以发issue,Discussions一般用作讨论特性的hhhh,我来看下 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
根据官方文档配置了动态http工具,配置内容如下
json内容
{ "openapi": "3.0.0", "info": { "title": "调度系统心跳检测API", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8090/task/admin" } ], "paths": { "/serverInfo": { "get": { "operationId": "serverInfo", "summary": "调度系统心跳检测接口", "tags": ["binkswine"], "parameters": [{}] } } } }工具创建
HttpDynamicToolFactory factory = HttpDynamicToolFactory.builder() .openApiSpec(OpenApiSpec.builder(openApiContent) .baseUrl("http://localhost:8090/task/admin") // 可选,覆盖文档中的 server .globalHeaders(Map.of( "Authorization", "Bearer " + apiToken )) .build()) // 指定要暴露的 endpoints .addEndpoint(EndpointSpec.get("/serverInfo")) .build();调用后codeact生成python代码内容如下
"Code generated successfully: call_heartbeat_api\n
python\ndef call_heartbeat_api(api_key):\n \"\"\"\n 调用调度系统的心跳检测接口\n \"\"\"\n headers = {\n \"Authorization\": f\"Bearer {api_key}\"\n }\n response = http_binkswine.http__http_binkswine__serverInfo(path={}, headers=headers)\n return response\n"执行报错内容为
AttributeError: 'http_binkswine' object has no attribute 'http__http_binkswine__serverInfo'
请问需要如何配置解决呢
Beta Was this translation helpful? Give feedback.
All reactions