PPLTool Custom Prompt

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.12.0

Describe the issue:
I’m trying to override the default prompt for the PPLTool. I know I can override it by defining the custom prompt in the tool’s parameters.prompt variable. However, I don’t know how to include the user’s question, which is pass using input.question, to the custom prompt. How do I add the user’s question to the custom prompt? Is it possible to do without having to modify the java code for the PPLTool?

I tried looking for the java code for the PPLTool but I can’t find it. Where is the java source code for the PPLTool located?

Configuration:

Relevant Logs or Screenshots:

@shaun.monera skills/src/main/java/org/opensearch/agent/tools/PPLTool.java at 05def20b8bc7d829daedfffdc2ea4029259d05ad · opensearch-project/skills · GitHub

1 Like

@dhrubo Thank you for the link. That solved my issue

@dhrubo Do you know if it’s possible to override the Agent’s prompt? I looked at the documentation and there doesn’t seem to be a way to override the Agent’s default prompt. I’m running a custom LLM which requires specific prompting tags so I need to modify the root Agent’s prompt to include the prompting tags

You should be able to overwrite the Agent’s prompt in PPLTool. check here

@mingshi Thanks for the reply. I was able to override the prompt for the ppltool. What I need now is to override the prompt for the root conversational agent. Looking at the agent registration api, there isn’t any entries for prompt. I’m trying to override it without having to modify the source code but rather to override it through configuration.

@shaun.monera I think this tutorial can help ml-commons/docs/tutorials/agent_framework/build_your_own_chatbot.md at 2.x · opensearch-project/ml-commons · GitHub