AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:313–467

Mem0AddRequest的构建器。位于 io.agentscope.core.memory.mem0 包。核心成员包括 messages、agentId、userId、appId、runId、metadata。

Builder for Mem0AddRequest.

方法摘要Method Summary

方法Method说明Description
public Builder messages(List<Mem0Message> messages)
设置消息。
Performs the messages operation.
public Builder agentId(String agentId)
设置智能体标识。
Performs the agent id operation.
public Builder userId(String userId)
设置用户标识。
Performs the user id operation.
public Builder appId(String appId)
设置应用标识。
Performs the app id operation.
public Builder runId(String runId)
设置运行标识。
Runs the id.
public Builder metadata(Map<String, Object> metadata)
设置元数据。
Performs the metadata operation.
public Builder includes(String includes)
设置该配置项。
Performs the includes operation.
public Builder excludes(String excludes)
设置该配置项。
Performs the excludes operation.
public Builder infer(Boolean infer)
设置该配置项。
Performs the infer operation.
public Builder outputFormat(String outputFormat)
设置输出格式。
Performs the output format operation.
public Builder customCategories(Map<String, Object> customCategories)
设置自定义类别。
Performs the custom categories operation.
public Builder customInstructions(String customInstructions)
设置自定义指令。
Performs the custom instructions operation.
public Builder immutable(Boolean immutable)
设置不可变。
Performs the immutable operation.
public Builder asyncMode(Boolean asyncMode)
设置异步模式。
Performs the async mode operation.
public Builder timestamp(Long timestamp)
设置时间戳。
Performs the timestamp operation.
public Builder expirationDate(String expirationDate)
设置该配置项。
Performs the expiration date operation.
public Builder orgId(String orgId)
设置该配置项。
Performs the org id operation.
public Builder projectId(String projectId)
设置该配置项。
Performs the project id operation.
public Builder version(String version)
设置版本。
Performs the version operation.
public Builder memoryType(String memoryType)
deprecated
设置记忆类型。
Sets the memory type.
public Mem0AddRequest build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

messages

public Builder messages(List<Mem0Message> messages)

设置消息。

Performs the messages operation.

参数Parameters
名称Name类型Type说明Description
messagesList<Mem0Message>消息列表(类型 `List`)。The messages.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:335–338

agentId

public Builder agentId(String agentId)

设置智能体标识。

Performs the agent id operation.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:340–343

userId

public Builder userId(String userId)

设置用户标识。

Performs the user id operation.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:345–348

appId

public Builder appId(String appId)

设置应用标识。

Performs the app id operation.

参数Parameters
名称Name类型Type说明Description
appIdString应用标识(类型 `String`)。The app id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:350–353

runId

public Builder runId(String runId)

设置运行标识。

Runs the id.

参数Parameters
名称Name类型Type说明Description
runIdString运行标识(类型 `String`)。The run id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:355–358

metadata

public Builder metadata(Map<String, Object> metadata)

设置元数据。

Performs the metadata operation.

参数Parameters
名称Name类型Type说明Description
metadataMap<String, Object>元数据(类型 `Map`)。The metadata.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:360–363

includes

public Builder includes(String includes)

设置该配置项。

Performs the includes operation.

参数Parameters
名称Name类型Type说明Description
includesStringincludes(类型 `String`)。The includes.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:365–368

excludes

public Builder excludes(String excludes)

设置该配置项。

Performs the excludes operation.

参数Parameters
名称Name类型Type说明Description
excludesStringexcludes(类型 `String`)。The excludes.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:370–373

infer

public Builder infer(Boolean infer)

设置该配置项。

Performs the infer operation.

参数Parameters
名称Name类型Type说明Description
inferBooleaninfer(类型 `Boolean`)。The infer.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:375–378

outputFormat

public Builder outputFormat(String outputFormat)

设置输出格式。

Performs the output format operation.

参数Parameters
名称Name类型Type说明Description
outputFormatString输出格式(类型 `String`)。The output format.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:380–383

customCategories

public Builder customCategories(Map<String, Object> customCategories)

设置自定义类别。

Performs the custom categories operation.

参数Parameters
名称Name类型Type说明Description
customCategoriesMap<String, Object>自定义类别(类型 `Map`)。The custom categories.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:385–388

customInstructions

public Builder customInstructions(String customInstructions)

设置自定义指令。

Performs the custom instructions operation.

参数Parameters
名称Name类型Type说明Description
customInstructionsString自定义指令(类型 `String`)。The custom instructions.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:390–393

immutable

public Builder immutable(Boolean immutable)

设置不可变。

Performs the immutable operation.

参数Parameters
名称Name类型Type说明Description
immutableBoolean不可变(类型 `Boolean`)。The immutable.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:395–398

asyncMode

public Builder asyncMode(Boolean asyncMode)

设置异步模式。

Performs the async mode operation.

参数Parameters
名称Name类型Type说明Description
asyncModeBoolean异步模式(类型 `Boolean`)。The async mode.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:400–403

timestamp

public Builder timestamp(Long timestamp)

设置时间戳。

Performs the timestamp operation.

参数Parameters
名称Name类型Type说明Description
timestampLong时间戳(类型 `Long`)。The timestamp.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:405–408

expirationDate

public Builder expirationDate(String expirationDate)

设置该配置项。

Performs the expiration date operation.

参数Parameters
名称Name类型Type说明Description
expirationDateStringexpiration 日期(类型 `String`)。The expiration date.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:410–413

orgId

public Builder orgId(String orgId)

设置该配置项。

Performs the org id operation.

参数Parameters
名称Name类型Type说明Description
orgIdStringorg 标识(类型 `String`)。The org id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:415–418

projectId

public Builder projectId(String projectId)

设置该配置项。

Performs the project id operation.

参数Parameters
名称Name类型Type说明Description
projectIdStringproject 标识(类型 `String`)。The project id.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:420–423

version

public Builder version(String version)

设置版本。

Performs the version operation.

参数Parameters
名称Name类型Type说明Description
versionString版本(类型 `String`)。The version.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:425–428

memoryType

public Builder memoryType(String memoryType)
deprecated

设置记忆类型。

Sets the memory type.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Not in official API spec
参数Parameters
名称Name类型Type说明Description
memoryTypeString记忆类型。The memory type
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:437–441

build

public Mem0AddRequest build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns Mem0AddRequest
返回Mem0AddRequest。Returns mem 0 add request.
源码Source io/agentscope/core/memory/mem0/Mem0AddRequest.java:443–466
基于官方固定版本源码静态生成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.