Skip to content

Commit

Permalink
Minor prompt engineering, much more helpful final responses now!
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-uiuc committed Jun 21, 2024
1 parent d47c4bf commit ea727e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/api/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ The user message will include excerpts from the high-quality documents, APIs/too
const toolsOutputResults = _buildToolsOutputResults({ conversation }) // todo: check for length problems...

PostPrompt +=
"The user has invoked external tools, and now it's your job to use the tool outputs and any other information to craft a great response. Even if the user asks you to invoke tools, that has already taken place before you saw this message. You should not attempt to invoke tools yourself, just use the results/outputs of the tools. If the tools errored out, tell the user. If the tool outputs are not relevant to their query, tell the user. Use the tool outputs, when relevant, in crafting your response. The user may or may not reference the tool directly, either way provide a helpful response and infer what they want based on the information you have available. Never tell the user \"I will run theses for you\" because they have already run! Always use past tense to refer to the tool outputs. NEVER request access to the tools because you are guarenteed to have access when appropraite; e.g. nevery say \"I would need access to the tool.\" When using tool results in your answer, always tell the user the answer came from a specific tool name and cite it using code notation something like '...as per tool `tool name`...' or 'According to tool `tool name` ...'. Never make up tool results, it's crucial to be honest and transparent. Stick to the facts as presented."
"\n<Tool Instructions>The user query required the invocation of external tools, and now it's your job to use the tool outputs and any other information to craft a great response. All tool invocations have already been completed before you saw this message. You should not attempt to invoke any tools yourself; instead, use the provided results/outputs of the tools. If any tools errored out, inform the user. If the tool outputs are irrelevant to their query, let the user know. Use relevant tool outputs to craft your response. The user may or may not reference the tools directly, but provide a helpful response based on the available information. Never tell the user you will run tools for them, as this has already been done. Always use the past tense to refer to the tool outputs. Never request access to the tools, as you are guaranteed to have access when appropriate; for example, never say 'I would need access to the tool.' When using tool results in your answer, always specify the source, using code notation, such as '...as per tool `tool name`...' or 'According to tool `tool name`...'. Never fabricate tool results; it is crucial to be honest and transparent. Stick to the facts as presented.</Tool Instructions>"
PostPrompt += toolsOutputResults
}
return PostPrompt
Expand Down

0 comments on commit ea727e6

Please sign in to comment.