类class
agentscope.modelStructuredResponse
@dataclass
class StructuredResponse
源码Source
agentscope/model/_model_response.py:321–349聊天模型的结构化响应。位于 agentscope.model 包。
The structured response of chat models. Declared in agentscope.model.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
content | dict | 内容字段。 | — |
id | str | 标识字段。 | field(default_factory=_generate_id) |
created_at | str | 已创建 at字段。 | field(default_factory=_generate_timestamp) |
type | Literal['structured_response'] | 类型字段。 | field(default_factory=lambda: 'structured_response') |
usage | ChatUsage | None | 用量字段。 | field(default_factory=lambda: None) |
metadata | dict[str, JSONSerializableObject] | 元数据字段。 | field(default_factory=lambda: {}) |
finished_reason | FinishedReason | `finished_reason` 字段。 | field(default=FinishedReason.COMPLETED) |
属性详情Attribute Detail
content
dict内容字段。声明为 dict。
The content field.
源码Source
agentscope/model/_model_response.py:324id
str = field(default_factory=_generate_id)标识字段。声明为 str。
The id field.
源码Source
agentscope/model/_model_response.py:327created_at
str = field(default_factory=_generate_timestamp)已创建 at字段。声明为 str。
The created at field.
源码Source
agentscope/model/_model_response.py:330type
Literal['structured_response'] = field(default_factory=lambda: 'structured_response')类型字段。声明为 Literal['structured_response']。
The type field.
源码Source
agentscope/model/_model_response.py:333usage
ChatUsage | None = field(default_factory=lambda: None)用量字段。声明为 ChatUsage | None。
The usage field.
源码Source
agentscope/model/_model_response.py:338metadata
dict[str, JSONSerializableObject] = field(default_factory=lambda: {})元数据字段。声明为 dict[str, JSONSerializableObject]。
The metadata field.
源码Source
agentscope/model/_model_response.py:341finished_reason
FinishedReason = field(default=FinishedReason.COMPLETED)finished_reason 字段。声明为 FinishedReason。
The finished reason field.
源码Source
agentscope/model/_model_response.py:346