AS AgentScopeAPI 手册 / API Reference

PromptProvider

public class PromptProvider
源码Source 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)
static

获取 getPreviousRoundToolCompressPrompt。

Strategy 1: Gets the prompt for compressing previous round tool invocations.

参数Parameters
名称Name类型Type说明Description
customPromptPromptConfig自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default
返回Returns String
返回字符串结果。the prompt to use for compressing previous round tool invocations
源码Source io/agentscope/core/memory/autocontext/PromptProvider.java:33–41

getPreviousRoundSummaryPrompt

public static String getPreviousRoundSummaryPrompt(PromptConfig customPrompt)
static

获取 getPreviousRoundSummaryPrompt。

Strategy 4: Gets the prompt for summarizing previous round conversations.

参数Parameters
名称Name类型Type说明Description
customPromptPromptConfig自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default
返回Returns String
返回字符串结果。the prompt to use for summarizing previous round conversations
源码Source io/agentscope/core/memory/autocontext/PromptProvider.java:50–58

getCurrentRoundLargeMessagePrompt

public static String getCurrentRoundLargeMessagePrompt(PromptConfig customPrompt)
static

获取 getCurrentRoundLargeMessagePrompt。

Strategy 5: Gets the prompt for summarizing current round large messages.

参数Parameters
名称Name类型Type说明Description
customPromptPromptConfig自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default
返回Returns String
返回字符串结果。the prompt to use for summarizing current round large messages
源码Source io/agentscope/core/memory/autocontext/PromptProvider.java:67–75

getCurrentRoundCompressPrompt

public static String getCurrentRoundCompressPrompt(PromptConfig customPrompt)
static

获取 getCurrentRoundCompressPrompt。

Strategy 6: Gets the prompt for compressing current round messages.

参数Parameters
名称Name类型Type说明Description
customPromptPromptConfig自定义提示词(类型 `PromptConfig`)。the custom prompt configuration, or null to use default
返回Returns String
返回字符串结果。the prompt to use for compressing current round messages
源码Source io/agentscope/core/memory/autocontext/PromptProvider.java:87–95
基于官方固定版本源码静态生成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.