类class
agentscope.messageURLSource
class URLSource(BaseModel)
源码Source
agentscope/message/_block.py:67–80URL 来源。位于 agentscope.message 包。核心成员包括 serialize_url。
The URL source. Declared in agentscope.message.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
type | Literal['url'] | 类型字段。 | 'url' |
url | AnyUrl | URL字段。 | — |
media_type | str | `media_type` 字段。 | — |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
def serialize_url(url: AnyUrl) -> strfield_serializer | 执行URL。 Serialize the URL to a string. |
属性详情Attribute Detail
type
Literal['url'] = 'url'类型字段。声明为 Literal['url']。
The type field.
源码Source
agentscope/message/_block.py:70url
AnyUrlURL字段。声明为 AnyUrl。
The url field.
源码Source
agentscope/message/_block.py:72media_type
strmedia_type 字段。声明为 str。
The media type field.
源码Source
agentscope/message/_block.py:74方法详情Method Detail
serialize_url
def serialize_url(url: AnyUrl) -> str
field_serializer
执行URL。
Serialize the URL to a string.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
url | AnyUrl | 服务地址(类型 `AnyUrl`)。The url. |
str
返回字符串结果。Returns a string.
源码Source
agentscope/message/_block.py:78–80