AS AgentScopeAPI 手册 / API Reference

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
responseResponse响应(类型 `Response`)。OkHttp Response object
httpClientOkHttpClientHTTP 客户端(类型 `OkHttpClient`)。OkHttpClient instance (can be used for subsequent requests like polling task status)
返回Returns String
返回字符串结果。Parsed markdown text
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:296
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.