Skip to content
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

Update websearch prompting & summary prompting #503

Merged
merged 17 commits into from Oct 12, 2023

Conversation

nsarrazin
Copy link
Collaborator

@nsarrazin nsarrazin commented Oct 11, 2023

Closes #504

@gary149 gary149 self-requested a review October 11, 2023 09:44
@nsarrazin
Copy link
Collaborator Author

We should address #504 before merging this as tokens are not specified for mistral (our current task model) so things might break

- Removed web search template
- Added examples in `generateQuery`
- Passed previous questions when generating the web search query
- Added previous questions to the bottom of the context window in `buildPrompt` when using websearch
@nsarrazin nsarrazin changed the title Use the task model for websearch query generation Update websearch prompting & summary prompting Oct 11, 2023
@nsarrazin nsarrazin added back This issue is related to the Svelte backend or the DB tools labels Oct 11, 2023
@nsarrazin
Copy link
Collaborator Author

@mishig25 might be worth for you to have a look as I tweaked some things in the websearch. It now does better for follow up questions like

  • What is the president of France?
  • What about Mexico?

Still not 100% happy but I think it's already better than the current version.

I also changed all the prompt building for summarization and web search query generation to use proper few shot examples.

@nsarrazin
Copy link
Collaborator Author

I think I'm done for now on the prompting! @mishig25 @gary149 let me know if anything else is blocking this 😄

Copy link
Collaborator

@mishig25 mishig25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@mishig25
Copy link
Collaborator

mishig25 commented Oct 12, 2023

Is this issue being addressed somewhere?

as tokens are not specified for mistral (our current task model) so things might break

@nsarrazin
Copy link
Collaborator Author

Is this issue being addressed somewhere?

Yes by deprecating the default webSearchQueryPromptTemplate we get rid of the last references to specific tokens.

Now we use only the chatPromptTemplate for formatting chats, which will work for our mistral config. (where we don't specify tokens, just the template)

src/lib/server/summarize.ts Outdated Show resolved Hide resolved
src/lib/server/summarize.ts Outdated Show resolved Hide resolved
nsarrazin and others added 3 commits October 12, 2023 21:35
Co-authored-by: Victor Muštar <victor.mustar@gmail.com>
Co-authored-by: Victor Muštar <victor.mustar@gmail.com>
@nsarrazin
Copy link
Collaborator Author

New prompts look good! I added a check to add an emoji if there's none at the beginning of the string. Merging this now!

@nsarrazin nsarrazin merged commit 1e5090f into main Oct 12, 2023
2 checks passed
@nsarrazin nsarrazin deleted the fix/generate_websearch_prompt_using_correct_model branch October 12, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back This issue is related to the Svelte backend or the DB tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

webSearchQueryPromptTemplate default requires legacy tokens
3 participants