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

feat: send sample documents to the model for better results VSCODE-580 #806

Merged

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented Sep 5, 2024

Description

Provide the passing of sample documents to the AI generations:

  • Only when a setting is enabled, by default this is false.
  • Only 3 sample documents are passed
    • If this passes the maximum context size, then 1 document is passed
  • Only pass 3 items in arrays
  • Only pass the first 20 characters in strings

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@alenakhineika alenakhineika marked this pull request as ready for review September 5, 2024 10:11
@alenakhineika alenakhineika requested a review from Anemy September 5, 2024 10:11
Copy link
Contributor

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. I have a few nitty comments - the only meaningful suggestion is considering returning an array of formatted documents and then appending them one by one to the prompt (checking for exceeding the max prompt length before each append) rather than as a all-or-nothing kind of thing.

src/participant/prompts/query.ts Outdated Show resolved Hide resolved
src/participant/sampleDocuments.ts Outdated Show resolved Hide resolved
src/participant/sampleDocuments.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

Looks good, left a couple comments

src/editors/playgroundController.ts Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/participant/prompts/query.ts Outdated Show resolved Hide resolved
src/participant/prompts/query.ts Outdated Show resolved Hide resolved
…SCODE-580-send-sample-documents

# Conflicts:
#	src/test/ai-accuracy-tests/ai-accuracy-tests.ts
@alenakhineika alenakhineika merged commit b54b22f into VSCODE-528-mongodb-copilot Sep 6, 2024
3 checks passed
@alenakhineika alenakhineika deleted the VSCODE-580-send-sample-documents branch September 6, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants