-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: work on minimizing grounding prompt #4
Conversation
@W-17432376@ refactored a bit of code into utils worked on reducing grounding prompt size.
Co-authored-by: Daphne Yang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for changing sendApexPromptToLLM.ts to use the cleanupYaml()
helper function.
I realized that the same change can be applied to this file sendRawPromptToLLM.ts. Lines 96-107 can be replaced with a call to cleanupYaml()
. 🙂
@@ -110,25 +110,13 @@ const buildPromptAndCallLLM = async (systemPrompt: string, userPrompt: string, c | |||
} | |||
|
|||
input += | |||
`\n\`\`\`\n${endOfPromptTag}\n${assistantTag}`; | |||
`\n\`\`\`\n${endOfPromptTag}\n${assistantTag}\n`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, a newline makes a big difference here at the end of the prompt! Now that the newline is added, I am able to generate OpenAPI v3 specifications from Apex classes without getting any errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this great system prompt consolidation and code refactoring @peternhale! Now we have gotten back some additional tokens for the context. 🙂
@W-17432376@
refactored a bit of code into utils
worked on reducing grounding prompt size.