ResponseParser
@FunctionalInterface public interface ResponseParser
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:286–297定义响应解析器契约的接口。位于 io.agentscope.core.rag.reader 包。核心成员包括 parseResponse。
Response parser functional interface. Allows users to customize how to extract markdown from API response.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String parseResponse(Response response, OkHttpClient httpClient) throws Exception | 解析响应。 Parses markdown text from HTTP response. |
方法详情Method Detail
parseResponse
public String parseResponse(Response response, OkHttpClient httpClient) throws Exception
解析响应。
Parses markdown text from HTTP response.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
response | Response | 响应(类型 `Response`)。OkHttp Response object |
httpClient | OkHttpClient | HTTP 客户端(类型 `OkHttpClient`)。OkHttpClient instance (can be used for subsequent requests like polling task status) |
String返回字符串结果。Parsed markdown text
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:296