AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:324–490

BailianLongTermMemory的构建器。位于 io.agentscope.core.memory.bailian 包。核心成员包括 apiKey、apiBaseUrl、userId、memoryLibraryId、projectId、profileSchema。

Builder for BailianLongTermMemory.

方法摘要Method Summary

方法Method说明Description
public Builder apiKey(String apiKey)
设置API 键。
Sets the Bailian API key.
public Builder apiBaseUrl(String apiBaseUrl)
设置API 基类 URL。
Sets the Bailian API base URL.
public Builder userId(String userId)
设置用户标识。
Sets the user identifier for memory organization.
public Builder memoryLibraryId(String memoryLibraryId)
设置该配置项。
Sets the memory library identifier.
public Builder projectId(String projectId)
设置该配置项。
Sets the project identifier.
public Builder profileSchema(String profileSchema)
设置配置档案模式。
Sets the profile schema identifier.
public Builder topK(Integer topK)
设置该配置项。
Sets the maximum number of search results.
public Builder minScore(Double minScore)
设置最小分数。
Sets the minimum similarity score threshold.
public Builder enableRerank(Boolean enableRerank)
启用重排。
Sets whether to enable reranking.
public Builder enableJudge(Boolean enableJudge)
启用评判器。
Sets whether to enable judge.
public Builder enableRewrite(Boolean enableRewrite)
启用该配置。
Sets whether to enable rewrite.
public Builder metadata(Map<String, Object> metadata)
设置元数据。
Sets custom metadata to be stored with memories.
public Builder httpTransport(HttpTransport httpTransport)
设置HTTP 传输层。
Sets the HTTP transport.
public BailianLongTermMemory build()
构建`BailianLongTermMemory`实例。
Builds the `BailianLongTermMemory` instance.

方法详情Method Detail

apiKey

public Builder apiKey(String apiKey)

设置API 键。

Sets the Bailian API key.

参数Parameters
名称Name类型Type说明Description
apiKeyStringDashScope_API_密钥。the DASHSCOPE_API_KEY
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:345–348

apiBaseUrl

public Builder apiBaseUrl(String apiBaseUrl)

设置API 基类 URL。

Sets the Bailian API base URL.

参数Parameters
名称Name类型Type说明Description
apiBaseUrlString基类 URL。the base URL
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:356–359

userId

public Builder userId(String userId)

设置用户标识。

Sets the user identifier for memory organization.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(必填)。the user ID (required)
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:367–370

memoryLibraryId

public Builder memoryLibraryId(String memoryLibraryId)

设置该配置项。

Sets the memory library identifier.

参数Parameters
名称Name类型Type说明Description
memoryLibraryIdString记忆 Library 标识(类型 `String`)。the memory library ID
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:378–381

projectId

public Builder projectId(String projectId)

设置该配置项。

Sets the project identifier.

参数Parameters
名称Name类型Type说明Description
projectIdStringproject 标识(类型 `String`)。the project ID
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:389–392

profileSchema

public Builder profileSchema(String profileSchema)

设置配置档案模式。

Sets the profile schema identifier.

参数Parameters
名称Name类型Type说明Description
profileSchemaString配置档案模式标识。the profile schema ID
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:400–403

topK

public Builder topK(Integer topK)

设置该配置项。

Sets the maximum number of search results.

参数Parameters
名称Name类型Type说明Description
topKIntegertop K(类型 `Integer`)。the top K value
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:411–414

minScore

public Builder minScore(Double minScore)

设置最小分数。

Sets the minimum similarity score threshold.

参数Parameters
名称Name类型Type说明Description
minScoreDouble最小分数(类型 `Double`)。the minimum score threshold [0,1]
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:422–425

enableRerank

public Builder enableRerank(Boolean enableRerank)

启用重排。

Sets whether to enable reranking.

参数Parameters
名称Name类型Type说明Description
enableRerankBoolean启用重排(类型 `Boolean`)。true to enable reranking, false otherwise
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:433–436

enableJudge

public Builder enableJudge(Boolean enableJudge)

启用评判器。

Sets whether to enable judge.

参数Parameters
名称Name类型Type说明Description
enableJudgeBoolean启用评判器(类型 `Boolean`)。true to enable judge, false otherwise
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:444–447

enableRewrite

public Builder enableRewrite(Boolean enableRewrite)

启用该配置。

Sets whether to enable rewrite.

参数Parameters
名称Name类型Type说明Description
enableRewriteBoolean启用 Rewrite(类型 `Boolean`)。true to enable rewrite, false otherwise
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:455–458

metadata

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

设置元数据。

Sets custom metadata to be stored with memories.

参数Parameters
名称Name类型Type说明Description
metadataMap<String, Object>元数据(类型 `Map`)。custom metadata map
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:466–469

httpTransport

public Builder httpTransport(HttpTransport httpTransport)

设置HTTP 传输层。

Sets the HTTP transport.

参数Parameters
名称Name类型Type说明Description
httpTransportHttpTransportHTTP 传输层。the HTTP transport
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:477–480

build

public BailianLongTermMemory build()

构建BailianLongTermMemory实例。

Builds the BailianLongTermMemory instance.

返回Returns BailianLongTermMemory
一种新的`BailianLongTermMemory`实例。a new `BailianLongTermMemory` instance
源码Source io/agentscope/core/memory/bailian/BailianLongTermMemory.java:487–489
基于官方固定版本源码静态生成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.