AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/message/URLSource.java:109–146

构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 url、mimeType、build。

Builder for constructing URLSource instances.

方法摘要Method Summary

方法Method说明Description
public Builder url(String url)
设置URL。
Sets the URL for the media content.
public Builder mimeType(String mimeType)
设置MIME 类型。
Sets an optional MIME type hint for extension-less URLs.
public URLSource build()
构建并返回最终实例。
Builds a new URLSource with the configured fields.

方法详情Method Detail

url

public Builder url(String url)

设置URL。

Sets the URL for the media content.

参数Parameters
名称Name类型Type说明Description
urlString服务地址(类型 `String`)。The URL pointing to the media content
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining
源码Source io/agentscope/core/message/URLSource.java:121–124

mimeType

public Builder mimeType(String mimeType)

设置MIME 类型。

Sets an optional MIME type hint for extension-less URLs.

参数Parameters
名称Name类型Type说明Description
mimeTypeStringMIME 类型(类型 `String`)。The MIME type (e.g. "video/mp4")
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining
源码Source io/agentscope/core/message/URLSource.java:132–135

build

public URLSource build()

构建并返回最终实例。

Builds a new URLSource with the configured fields.

返回Returns URLSource
一种新的URLSource 实例。A new URLSource instance
抛出Throws
  • NullPointerException 可能抛出 `NullPointerException`。if url is null
源码Source io/agentscope/core/message/URLSource.java:143–145
基于官方固定版本源码静态生成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.