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 |
|---|---|---|
url | String | 服务地址(类型 `String`)。The URL pointing to the media content |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/URLSource.java:121–124mimeType
public Builder mimeType(String mimeType)
设置MIME 类型。
Sets an optional MIME type hint for extension-less URLs.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mimeType | String | MIME 类型(类型 `String`)。The MIME type (e.g. "video/mp4") |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/URLSource.java:132–135build
public URLSource build()
构建并返回最终实例。
Builds a new URLSource with the configured fields.
URLSource一种新的URLSource 实例。A new URLSource instance
NullPointerException可能抛出 `NullPointerException`。if url is null
源码Source
io/agentscope/core/message/URLSource.java:143–145