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: backend refactor #306

Merged
merged 11 commits into from
Jun 12, 2023
Merged

Feat: backend refactor #306

merged 11 commits into from
Jun 12, 2023

Conversation

mattzcarey
Copy link
Contributor

@mattzcarey mattzcarey commented Jun 12, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Remove a bunch of unused dependencies
Refactors routes to remove common logic
Create a auth helper function to use FastAPI's inbuilt dependency injection.

Checklist before requesting a review

Please delete options that are not relevant.

  • [x ] My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

@vercel
Copy link

vercel bot commented Jun 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2023 4:00pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2023 4:00pm

print("/chat/{chat_id}",chats)
return {"chatId": chat_id, "history": chats[0]['history']}
chats = get_chat_details(commons, chat_id)
if len(chats) > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that you added this check !

@mattzcarey mattzcarey marked this pull request as draft June 12, 2023 12:15
@chat_router.put("/chat/{chat_id}", dependencies=[Depends(JWTBearer())])
async def chat_endpoint(request: Request,commons: CommonsDep, chat_id: UUID, chat_message: ChatMessage, credentials: dict = Depends(JWTBearer())):
# helper method for update and create chat
def chat_handler(request, commons, chat_id, chat_message, credentials, is_new_chat=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool helper function 🔥

@StanGirard StanGirard merged commit ec29f30 into main Jun 12, 2023
1 of 3 checks passed
bO-05 pushed a commit to bO-05/quivr that referenced this pull request Jun 13, 2023
* fix: edge cases on migration scripts

* chore: remove unused deps.

* refactor: user_routes

* refactor: chat_routes

* refactor: upload_routes

* refactor: explore_routes

* refactor: crawl_routes

* chore(refactor): get current user

* refactor: more dead dependencies

* bug: wrap email in credentials dict.

---------

Co-authored-by: Stan Girard <girard.stanislas@gmail.com>
StanGirard added a commit that referenced this pull request Sep 12, 2023
* fix: edge cases on migration scripts

* chore: remove unused deps.

* refactor: user_routes

* refactor: chat_routes

* refactor: upload_routes

* refactor: explore_routes

* refactor: crawl_routes

* chore(refactor): get current user

* refactor: more dead dependencies

* bug: wrap email in credentials dict.

---------

Co-authored-by: Stan Girard <girard.stanislas@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants