类 OpenAIResponseParser
java.lang.Object
io.agentscope.core.formatter.openai.OpenAIResponseParser
Parses OpenAI HTTP API responses to AgentScope ChatResponse.
Handles both non-streaming and streaming (chunk) responses using DTO classes.
-
字段概要
字段修饰符和类型字段说明protected static final StringPlaceholder name for tool call argument fragments in streaming responses. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected ChatResponseparseChunkResponse(OpenAIResponse response, Instant startTime) Parse OpenAI streaming response chunk.protected ChatResponseparseCompletionResponse(OpenAIResponse response, Instant startTime) Parse OpenAI non-streaming response.parseResponse(OpenAIResponse response, Instant startTime) Parse OpenAI response DTO to AgentScope ChatResponse.
-
字段详细资料
-
FRAGMENT_PLACEHOLDER
Placeholder name for tool call argument fragments in streaming responses.- 另请参阅:
-
-
构造器详细资料
-
OpenAIResponseParser
public OpenAIResponseParser()
-
-
方法详细资料
-
parseResponse
Parse OpenAI response DTO to AgentScope ChatResponse.- 参数:
response- OpenAI response DTOstartTime- Request start time for calculating duration- 返回:
- AgentScope ChatResponse
-
parseCompletionResponse
Parse OpenAI non-streaming response.- 参数:
response- OpenAI response DTOstartTime- Request start time- 返回:
- AgentScope ChatResponse
-
parseChunkResponse
Parse OpenAI streaming response chunk.- 参数:
response- OpenAI chunk response DTOstartTime- Request start time- 返回:
- AgentScope ChatResponse (or null for malformed chunks)
-