RemoteWrapper
@Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface RemoteWrapper
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteWrapper.java:28–47用于标记远程包装器相关元数据的注解。位于 io.agentscope.runtime.sandbox.manager.remote 包。核心成员包括 method、successKey、path。
Annotation to mark methods that can be executed both locally and remotely. When a SandboxService is configured with a remote base URL, methods annotated with @RemoteWrapper will automatically make HTTP requests to the remote server
注解元素摘要Annotation Element Summary
| 元素Element | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
method | RequestMethod | RequestMethod.POST | 用于远程调用的HTTP 方法到使用。 HTTP method to use for the remote call |
successKey | String | "data" | 返回成功键。 Key in the response JSON that contains the actual data
If empty, the whole response will be returned |
path | String | "" | 用于端点的自定义路径。 Custom path for the endpoint. |
注解元素详情Annotation Element Detail
method
public RequestMethod method()
用于远程调用的HTTP 方法到使用。
HTTP method to use for the remote call
RequestMethod返回RequestMethod。Returns request method.
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteWrapper.java:35successKey
public String successKey()
返回成功键。
Key in the response JSON that contains the actual data If empty, the whole response will be returned
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteWrapper.java:41path
public String path()
用于端点的自定义路径。
Custom path for the endpoint.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteWrapper.java:46