PromptProvider
public class PromptProvider
io/agentscope/core/memory/autocontext/PromptProvider.java:24–96提示词提供者,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.memory.autocontext 包。核心成员包括 getPreviousRoundToolCompressPrompt、getPreviousRoundSummaryPrompt、getCurrentRoundLargeMessagePrompt、getCurrentRoundCompressPrompt。
Utility class for providing prompts with fallback to defaults.
This class provides a unified interface for retrieving prompts, with automatic fallback to
default prompts from Prompts when custom prompts are not provided.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static String getPreviousRoundToolCompressPrompt(PromptConfig customPrompt)static | 获取 `getPreviousRoundToolCompressPrompt`。 Strategy 1: Gets the prompt for compressing previous round tool invocations. |
public static String getPreviousRoundSummaryPrompt(PromptConfig customPrompt)static | 获取 `getPreviousRoundSummaryPrompt`。 Strategy 4: Gets the prompt for summarizing previous round conversations. |
public static String getCurrentRoundLargeMessagePrompt(PromptConfig customPrompt)static | 获取 `getCurrentRoundLargeMessagePrompt`。 Strategy 5: Gets the prompt for summarizing current round large messages. |
public static String getCurrentRoundCompressPrompt(PromptConfig customPrompt)static | 获取 `getCurrentRoundCompressPrompt`。 Strategy 6: Gets the prompt for compressing current round messages. |
方法详情Method Detail
getPreviousRoundToolCompressPrompt
public static String getPreviousRoundToolCompressPrompt(PromptConfig customPrompt)
获取 getPreviousRoundToolCompressPrompt。
Strategy 1: Gets the prompt for compressing previous round tool invocations.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customPrompt | PromptConfig | 自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default |
Stringio/agentscope/core/memory/autocontext/PromptProvider.java:33–41getPreviousRoundSummaryPrompt
public static String getPreviousRoundSummaryPrompt(PromptConfig customPrompt)
获取 getPreviousRoundSummaryPrompt。
Strategy 4: Gets the prompt for summarizing previous round conversations.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customPrompt | PromptConfig | 自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default |
Stringio/agentscope/core/memory/autocontext/PromptProvider.java:50–58getCurrentRoundLargeMessagePrompt
public static String getCurrentRoundLargeMessagePrompt(PromptConfig customPrompt)
获取 getCurrentRoundLargeMessagePrompt。
Strategy 5: Gets the prompt for summarizing current round large messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customPrompt | PromptConfig | 自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default |
Stringio/agentscope/core/memory/autocontext/PromptProvider.java:67–75getCurrentRoundCompressPrompt
public static String getCurrentRoundCompressPrompt(PromptConfig customPrompt)
获取 getCurrentRoundCompressPrompt。
Strategy 6: Gets the prompt for compressing current round messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customPrompt | PromptConfig | 自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default |
Stringio/agentscope/core/memory/autocontext/PromptProvider.java:87–95