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(qa construct): add optional long context window approach #176

Merged
merged 8 commits into from
Jan 16, 2024

Conversation

MichaelWalker-git
Copy link
Contributor

@MichaelWalker-git MichaelWalker-git commented Jan 5, 2024

Problem

Our construct currently defaults to a long context window approach for processing documents when a filename is specified. This method leverages an extensive portion of the document's content as the context for generating AI responses. While effective for comprehensive context provision, it may not always be the most efficient or relevant approach for all use cases.

Proposed Solution

To provide users with greater flexibility and control over the response generation process, we propose introducing a new parameter within our GraphQL schema: responseGenerationMethod. This parameter will allow users to explicitly select their preferred method of context application—either the existing long context window (longContext) or the Retrieval-Augmented Generation (RAG) method.

(QA construct): Update Q/A logic #137

#137

Screenshots:

Screenshot 2024-01-15 at 9 22 58 PM
Screenshot 2024-01-15 at 9 17 53 PM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

@MichaelWalker-git MichaelWalker-git requested a review from a team as a code owner January 5, 2024 05:42
@MichaelWalker-git MichaelWalker-git marked this pull request as draft January 5, 2024 05:47
@MichaelWalker-git MichaelWalker-git marked this pull request as ready for review January 5, 2024 18:46
@MichaelWalker-git MichaelWalker-git changed the title DRAFT: feat: add optional long context window approach feat(qa construct): add optional long context window approach Jan 5, 2024
@krokoko
Copy link
Collaborator

krokoko commented Jan 6, 2024

Test cases discussed:

  • ResponseGenerationMethod set to RAG should run the RAG approach (regardless of a filename specified)
  • ResponseGenerationMethod set to Long context and no filename specified should send back an error message
  • ResponseGenerationMethod set to Long context window and a filename specified should check how many tokens are in the specified document, if that amount is smaller that the max number of tokens supported by the model used, run Long Context window, otherwise run RAG approach

To know which approach was used, this information will be logged by the Lambda function

@MichaelWalker-git MichaelWalker-git marked this pull request as draft January 8, 2024 16:55
auto-merge was automatically disabled January 8, 2024 16:55

Pull request was converted to draft

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (94dd364) 93.61% compared to head (3a9597e) 93.61%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #176   +/-   ##
=======================================
  Coverage   93.61%   93.61%           
=======================================
  Files          18       18           
  Lines        5624     5624           
  Branches      125      125           
=======================================
  Hits         5265     5265           
  Misses        359      359           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichaelWalker-git MichaelWalker-git merged commit 2e499df into main Jan 16, 2024
15 of 16 checks passed
@MichaelWalker-git MichaelWalker-git deleted the feat/issue_137 branch January 16, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants