AS AgentScopeAPI 手册 / API Reference
类class agentscope.model

StructuredResponse

@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
contentdict
内容字段。
—
idstr
标识字段。
field(default_factory=_generate_id)
created_atstr
已创建 at字段。
field(default_factory=_generate_timestamp)
typeLiteral['structured_response']
类型字段。
field(default_factory=lambda: 'structured_response')
usageChatUsage | None
用量字段。
field(default_factory=lambda: None)
metadatadict[str, JSONSerializableObject]
元数据字段。
field(default_factory=lambda: {})
finished_reasonFinishedReason
`finished_reason` 字段。
field(default=FinishedReason.COMPLETED)

属性详情Attribute Detail

content

dict

内容字段。声明为 dict。

The content field.

源码Source agentscope/model/_model_response.py:324

id

str = field(default_factory=_generate_id)

标识字段。声明为 str。

The id field.

源码Source agentscope/model/_model_response.py:327

created_at

str = field(default_factory=_generate_timestamp)

已创建 at字段。声明为 str。

The created at field.

源码Source agentscope/model/_model_response.py:330

type

Literal['structured_response'] = field(default_factory=lambda: 'structured_response')

类型字段。声明为 Literal['structured_response']。

The type field.

源码Source agentscope/model/_model_response.py:333

usage

ChatUsage | None = field(default_factory=lambda: None)

用量字段。声明为 ChatUsage | None。

The usage field.

源码Source agentscope/model/_model_response.py:338

metadata

dict[str, JSONSerializableObject] = field(default_factory=lambda: {})

元数据字段。声明为 dict[str, JSONSerializableObject]。

The metadata field.

源码Source agentscope/model/_model_response.py:341

finished_reason

FinishedReason = field(default=FinishedReason.COMPLETED)

finished_reason 字段。声明为 FinishedReason。

The finished reason field.

源码Source agentscope/model/_model_response.py:346
基于官方固定版本源码静态生成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.