nsbradford / SemanticSearch

Minimal RAG (Retrieval Augmented Generation) website with Pinecone, FastAPI, NextJS, MongoDB
https://semantic-search-six.vercel.app
9 stars 3 forks source link

Add session ID to llm request metadata #16

Closed nsbradford closed 1 year ago

nsbradford commented 1 year ago

Get sessionId from the frontend - see index.tsx. Requires adding metadata to llm endpoint and passing through to llm.py

ellipsis-dev[bot] commented 1 year ago

To have BitBuilder create a Pull Request with the implementation, the user who created the issue (@nsbradford) can comment below with "LGTM". If the plan is inaccurate, edit the issue description and write a comment with "replan".


Implementation Steps

  1. Add session ID to llm request metadata
    • In the llm_get function in llm.py, add a new key-value pair to the metadata dictionary. The key should be session_id and the value should be the session ID passed in from the frontend. This will require modifying the function signature to accept an additional parameter for the session ID.
  2. Modify frontend to pass session ID
    • In the index.tsx file, modify the sendLLMRequest function to include the session ID in the request. You can get the session ID using the getSessionId function. The session ID should be passed as an additional parameter to the sendLLMRequest function.

Generated with :heart: by www.bitbuilder.ai. Questions? Check out our the documentation.

nsbradford commented 1 year ago

LGTM