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

URLSource

class URLSource(BaseModel)
源码Source agentscope/message/_block.py:67–80

URL 来源。位于 agentscope.message 包。核心成员包括 serialize_url。

The URL source. Declared in agentscope.message.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
typeLiteral['url']
类型字段。
'url'
urlAnyUrl
URL字段。
—
media_typestr
`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:70

url

AnyUrl

URL字段。声明为 AnyUrl。

The url field.

源码Source agentscope/message/_block.py:72

media_type

str

media_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
urlAnyUrl服务地址(类型 `AnyUrl`)。The url.
返回Returns str
返回字符串结果。Returns a string.
源码Source agentscope/message/_block.py:78–80
基于官方固定版本源码静态生成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.