Builder
public static class Builder
io/agentscope/core/memory/autocontext/PromptConfig.java:128–199构建器,用于构建并配置目标实例。位于 io.agentscope.core.memory.autocontext 包。核心成员包括 previousRoundToolCompressPrompt、previousRoundSummaryPrompt、currentRoundLargeMessagePrompt、currentRoundCompressPrompt、build。
Builder class for constructing PromptConfig instances.
This builder follows the standard Builder pattern and supports method chaining.
Each call to #build() creates a new independent instance, allowing the same
builder to be reused multiple times safely.
Example:
`PromptConfig config = PromptConfig.builder()
.previousRoundToolCompressPrompt("Custom prompt 1")
.previousRoundSummaryPrompt("Custom prompt 4")
.build();
`
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder previousRoundToolCompressPrompt(String prompt) | 设置该配置项。 Sets the prompt for Strategy 1: compressing previous round tool invocations. |
public Builder previousRoundSummaryPrompt(String prompt) | 设置该配置项。 Sets the prompt for Strategy 4: summarizing previous round conversations. |
public Builder currentRoundLargeMessagePrompt(String prompt) | 设置该配置项。 Sets the prompt for Strategy 5: summarizing current round large messages. |
public Builder currentRoundCompressPrompt(String prompt) | 设置该配置项。 Sets the prompt for Strategy 6: compressing current round messages. |
public PromptConfig build() | 构建并返回最终实例。 Builds a new PromptConfig instance with the configured values. |
方法详情Method Detail
previousRoundToolCompressPrompt
public Builder previousRoundToolCompressPrompt(String prompt)
设置该配置项。
Sets the prompt for Strategy 1: compressing previous round tool invocations.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prompt | String | 提示词(类型 `String`)。the custom prompt text, or null/empty to use default |
Builderio/agentscope/core/memory/autocontext/PromptConfig.java:138–141previousRoundSummaryPrompt
public Builder previousRoundSummaryPrompt(String prompt)
设置该配置项。
Sets the prompt for Strategy 4: summarizing previous round conversations.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prompt | String | 提示词(类型 `String`)。the custom prompt text, or null/empty to use default |
Builderio/agentscope/core/memory/autocontext/PromptConfig.java:150–153currentRoundLargeMessagePrompt
public Builder currentRoundLargeMessagePrompt(String prompt)
设置该配置项。
Sets the prompt for Strategy 5: summarizing current round large messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prompt | String | 提示词(类型 `String`)。the custom prompt text, or null/empty to use default |
Builderio/agentscope/core/memory/autocontext/PromptConfig.java:162–165currentRoundCompressPrompt
public Builder currentRoundCompressPrompt(String prompt)
设置该配置项。
Sets the prompt for Strategy 6: compressing current round messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prompt | String | 提示词(类型 `String`)。the custom prompt text, or null/empty to use default |
Builderio/agentscope/core/memory/autocontext/PromptConfig.java:177–180build
public PromptConfig build()
构建并返回最终实例。
Builds a new PromptConfig instance with the configured values.
PromptConfigio/agentscope/core/memory/autocontext/PromptConfig.java:190–198