UniResponse
The UniResponse class provides a unified response format.
Properties
role(Literal["assistant"]): Role, fixed as "assistant"usage(UniResponseUsage | None): Usage information, optionalcontent(T): Response content, T is a generic parametertool_calls(T_TOOL): Tool call results, T_TOOL is a generic parameterreasoning_content(str | None): Reasoning/thinking content from the model, if the model supports it (e.g., o1, Claude with extended thinking)reasoning_signature(str | None): Anthropic thinking signature, required for round-tripping thinking content with Anthropic APImetadata(RequestMetadata): Request metadata containing request ID, model name, stop reason, and original provider request ID
Description
The UniResponse class inherits from BaseModel and implements generics, providing a unified response format. It encapsulates the AI model's response content, usage statistics, and possible tool call results.
UniResponse is a core component of AmritaCore's response processing system, ensuring all responses from the AI model follow the same structure and format, facilitating subsequent processing and parsing.
