Package io.agentscope.core.nacos.prompt
Class NacosPromptListener
java.lang.Object
io.agentscope.core.nacos.prompt.NacosPromptListener
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NacosPromptListener
public NacosPromptListener(com.alibaba.nacos.api.ai.AiService aiService)
-
-
Method Details
-
getPrompt
- Throws:
com.alibaba.nacos.api.exception.NacosException
-
getPrompt
public String getPrompt(String promptKey, Map<String, String> args) throws com.alibaba.nacos.api.exception.NacosException- Throws:
com.alibaba.nacos.api.exception.NacosException
-
getPrompt
public String getPrompt(String promptKey, Map<String, String> args, String defaultValue) throws com.alibaba.nacos.api.exception.NacosExceptionGet prompt template with optional default value.- Parameters:
promptKey- the prompt keyargs- the template variables for renderingdefaultValue- the default value to use if prompt not found in Nacos- Returns:
- rendered prompt string or default value
- Throws:
com.alibaba.nacos.api.exception.NacosException- if Nacos service error occurs
-
getPrompt
public String getPrompt(String promptKey, String version, String label, Map<String, String> args, String defaultValue) throws com.alibaba.nacos.api.exception.NacosExceptionGet prompt template with version/label targeting and optional default value.- Parameters:
promptKey- the prompt keyversion- target prompt version (e.g. "1.0.0"), mutually exclusive with labellabel- target prompt label (e.g. "prod"), mutually exclusive with versionargs- the template variables for renderingdefaultValue- the default value to use if prompt not found in Nacos- Returns:
- rendered prompt string or default value
- Throws:
com.alibaba.nacos.api.exception.NacosException- if Nacos service error occurs
-