langchain4j icon indicating copy to clipboard operation
langchain4j copied to clipboard

Whether dynamic modification of system prompt can be supported?

Open 7010G opened this issue 11 months ago • 3 comments

Because some model tools have poor invocation ability, we are trying to solve this problem through prompt word engineering. We plan to do semantic matching through the vector library to select tools, and put the tool list returned by the vector library into the system content. In this way, the effect is good when selecting multiple tools, and the tool expansion is also relatively convenient. For example: first step: "messages": [ { "role": "system", "content": "Follow the user\u0027s instructions carefully. Respond using markdown." }, { "role": "user", "content": "Testing the dialog" }, { "role": "assistant", "content": "\n I\u0027m sorry, I\u0027m not sure what you mean by "testing the dialog". Can you please provide more information or clarify your question?" }, { "role": "user", "content": "what can you do" } ] User questions change system content after vector matching. "messages": [ { "role": "system", "content": "You are an intelligent assistant to help users book flights, check the weather, arrange travel and more" }, { "role": "user", "content": "Testing the dialog" }, { "role": "assistant", "content": "\n I\u0027m sorry, I\u0027m not sure what you mean by "testing the dialog". Can you please provide more information or clarify your question?" }, { "role": "user", "content": "what can you do" },{ "role": "assistant", "content": "I can help you book flights, check the weather, make travel arrangements and so on." } ]

7010G avatar Mar 21 '24 03:03 7010G