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

Add session ID to llm request metadata #43

Open
nsbradford opened this issue Oct 27, 2023 · 5 comments
Open

Add session ID to llm request metadata #43

nsbradford opened this issue Oct 27, 2023 · 5 comments

Comments

@nsbradford
Copy link
Owner

Get sessionId from the frontend, pass it all the way through existing endpoints to the llm request metadata

@ellipsis-dev
Copy link

ellipsis-dev bot commented Oct 27, 2023

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 sessionId to frontend API calls
    • Modify the postQuery and sendLLMRequest functions in /ui/shared/api.ts to include the sessionId in the request headers. The sessionId can be retrieved using the getSessionId function from /ui/shared/utils.ts.
  2. Update backend to accept sessionId
    • Update the /query and /llm endpoints in /backend/main.py to accept the sessionId from the request headers and pass it to the respective functions execute_query and llm_get.
  3. Add sessionId to llm request metadata
    • Modify the llm_get function in /backend/llm.py to include the sessionId in the metadata of the llm request.

Generated with ❤️ by www.bitbuilder.ai. Questions? Check out our the documentation.

@nsbradford
Copy link
Owner Author

replan - no need to modify the query endpoint

@ellipsis-dev
Copy link

ellipsis-dev bot commented Oct 27, 2023

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 sessionId to frontend API calls
    • Modify the postQuery and sendLLMRequest functions in /ui/shared/api.ts to include the sessionId in the request headers. The sessionId can be retrieved using the getSessionId function from /ui/shared/utils.ts. In the postQuery function, add a headers object to the axios post request with a 'sessionId' property that calls the getSessionId function. Do the same for the sendLLMRequest function.
  2. Update backend to accept sessionId
    • Update the /llm endpoint in /backend/main.py to accept the sessionId from the request headers and pass it to the llm_get function. In the llm function, extract the sessionId from the request headers and pass it as an argument to the llm_get function.
  3. Add sessionId to llm request metadata
    • Modify the llm_get function in /backend/llm.py to include the sessionId in the metadata of the llm request. Add a new key-value pair to the metadata object in the acompletion function call where the key is 'sessionId' and the value is the sessionId passed to the llm_get function.

Generated with ❤️ by www.bitbuilder.ai. Questions? Check out our the documentation.

@nsbradford
Copy link
Owner Author

replan - put metadata as a request param, don't use request headers. and do not modify postQuery, just llm

@ellipsis-dev
Copy link

ellipsis-dev bot commented Oct 27, 2023

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 sessionId to sendLLMRequest function
    • Modify the sendLLMRequest function in /ui/shared/api.ts to include the sessionId in the request data. The sessionId can be retrieved using the getSessionId function from /ui/shared/utils.ts. In the sendLLMRequest function, add a 'sessionId' property to the data object that calls the getSessionId function.
  2. Update llm endpoint to accept sessionId
    • Update the /llm endpoint in /backend/main.py to accept the sessionId from the request data and pass it to the llm_get function. In the llm function, extract the sessionId from the request data and pass it as an argument to the llm_get function.
  3. Add sessionId to llm request metadata
    • Modify the llm_get function in /backend/llm.py to include the sessionId in the metadata of the llm request. Add a new key-value pair to the metadata object in the acompletion function call where the key is 'sessionId' and the value is the sessionId passed to the llm_get function.

Generated with ❤️ by www.bitbuilder.ai. Questions? Check out our the documentation.

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

No branches or pull requests

1 participant