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 #41

Open
nsbradford opened this issue Oct 26, 2023 · 2 comments
Open

Add session ID to llm request metadata #41

nsbradford opened this issue Oct 26, 2023 · 2 comments

Comments

@nsbradford
Copy link
Owner

Get sessionId from the frontend in index.tsx and pass it through sendLLMRequest in api.ts. Add metadata to llm endpoint in main.py and pass to llm.py - you might have to edit models.py accordingly.

@ellipsis-dev
Copy link

ellipsis-dev bot commented Oct 26, 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 LLMChatCompletionRequest interface
    • In the /ui/shared/api.ts file, add a new field sessionId to the LLMChatCompletionRequest interface. The sessionId should be of type string.
  2. Pass sessionId to sendLLMRequest
    • In the /ui/pages/index.tsx file, modify the sendLLMRequest function call inside the handleNewUserPrompt function to pass the sessionId along with the existing data.
  3. Add sessionId to LLMChatCompletionRequest model
    • In the /backend/models.py file, add a new field sessionId to the LLMChatCompletionRequest class. The sessionId should be of type str.
  4. Modify llm endpoint to accept sessionId
    • In the /backend/main.py file, modify the llm endpoint to accept sessionId as part of the request body. Update the llm_get function call inside the llm endpoint to pass the sessionId along with the existing data.
  5. Modify llm_get function to accept sessionId
    • In the /backend/llm.py file, modify the llm_get function to accept sessionId as an argument. Update the metadata object inside the acompletion function call to include the sessionId.

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

@nsbradford
Copy link
Owner Author

lgtm

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