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

Sweep: Add session ID to llm request metadata #39

Closed nsbradford closed 1 year ago

nsbradford commented 1 year ago

Details

Features: 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.

Checklist - [X] ``frontend/src/pages/index.tsx`` ⚠️ No Changes Made - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [X] `frontend/src/pages/index.tsx` ❌ Sandbox failed so I made additional changes - [ ] `frontend/src/api/api.ts` - [ ] `backend/main.py` - [ ] `backend/llm.py` - [ ] `backend/models.py` ![Flowchart](http://24.199.78.105:8082/public/724df7a4c6f404b59e28f5d19449830b9c13f556f745f7681f808f6af1915229_39_flowchart.svg)
sweep-ai[bot] commented 1 year ago
Sweeping

75%
⚡ Sweep Basic Tier: I'm creating this ticket using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. For more GPT-4 tickets, visit our payment portal.

![Docker Version Updated](https://img.shields.io/badge/Docker%20Version%20Updated-1%20hours%20ago-blue)

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

Step 2: ⌨️ Coding


Sandbox logs for 4a014cc
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/Kky5q.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
Run trunk upgrade to upgrade 1 linter
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for 4a014cc
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/omjp8.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for fc37ef7
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/Es6FY.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for fc37ef7
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/SFItH.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for fc37ef7
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/6FONt.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for fc37ef7
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/Nlpdy.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
Run trunk upgrade to upgrade 1 linter
bash: line 1: return: can only `return' from a function or sourced script


Sandbox logs for 02c4cd5
trunk fmt frontend/src/pages/index.tsx || return 0 1/1 ❌ (`2`)
  FAILURES  
 prettier  frontend/src/pages/index.tsx  .trunk/out/gyhko.yaml
  NOTICES  
 A tool failed to run. You can open the details yaml file for more information.
Checked 0 files
✖ No issues, 1 failure
Run trunk upgrade to upgrade 1 linter
bash: line 1: return: can only `return' from a function or sourced script


Step 3: 🔁 Code Review

Here are my self-reviews of my changes at sweep/add-session-id.

Here is the 1st review

The changes made in this pull request are mostly correct and well-implemented. However, there are a couple of areas that need to be addressed: - In `backend/llm.py`, the `handle_request` function has been modified to accept the session ID as an argument, but it's not clear how the session ID is used in the function. Please ensure that the session ID is used appropriately in the function. - The file `backend/models.py` was not included in the pull request. The request metadata model in this file needs to be updated to include the new session ID field. Please make this change and include the updated file in the pull request. Once these changes are made, the pull request should be ready to merge.

I'm currently addressing these suggestions.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord