-
Notifications
You must be signed in to change notification settings - Fork 18
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
[Merged by Bors] - fix: minor prompt optimizations (LLM-001) #516
Conversation
const output = response.output?.trim().toUpperCase(); | ||
|
||
if (output?.includes('UNKNOWN') || output?.startsWith("I'M SORRY,") || output?.includes('AS AN AI')) | ||
return { ...response, output: null }; |
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.
AI restrictions
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.
"unknown" may still be present in a valid response:
Q: Who is D.B. Cooper?
A: D.B. was an unknown man who stole money from a plane.
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.
okay we can swap it back to NOT_FOUND
, the main thing is it that it needs to sound somewhat natural to the model for better results
|
||
const options = { model, system: systemWithTime, temperature, maxTokens }; | ||
|
||
const context = data.chunks.map(({ originalText }) => originalText).join('\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.
monolith-chunking
bors r+ |
Mono-chunking: we now combine all the fetched chunks into one single blob of text. `context: ${chunk1}\n${chunk2}`.... This has the added benefit of: less tokens (just barely) less reference, ("based on document 1, ....", "based on the provided references, ....") Time Stamp injection: https://www.notion.so/voiceflow/v3-KB-Optimization-Prompts-24a947d158fc43af8adeead21a6211c0?pvs=4#ffed22a3847c43b59e9e4f532ea05645 We now provide it with the time AI Restrictions: https://www.notion.so/voiceflow/v3-KB-Optimization-Prompts-24a947d158fc43af8adeead21a6211c0?pvs=4#eb1166b77cab443fb494c49b837598c5 GPT-3 is more liberal and can answer more things. Co-authored-by: Tyler Han <tylerhan97@gmail.com>
Kudos, SonarCloud Quality Gate passed! |
Pull request successfully merged into master. Build succeeded: |
Mono-chunking:
we now combine all the fetched chunks into one single blob of text.
context: ${chunk1}\n${chunk2}
....This has the added benefit of:
less tokens (just barely)
less reference, ("based on document 1, ....", "based on the provided references, ....")
Time Stamp injection:
https://www.notion.so/voiceflow/v3-KB-Optimization-Prompts-24a947d158fc43af8adeead21a6211c0?pvs=4#ffed22a3847c43b59e9e4f532ea05645
We now provide it with the time
AI Restrictions:
https://www.notion.so/voiceflow/v3-KB-Optimization-Prompts-24a947d158fc43af8adeead21a6211c0?pvs=4#eb1166b77cab443fb494c49b837598c5
GPT-3 is more liberal and can answer more things.