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

move database to REST API #67

Merged
merged 8 commits into from
Oct 13, 2023
Merged

move database to REST API #67

merged 8 commits into from
Oct 13, 2023

Conversation

pmeier
Copy link
Member

@pmeier pmeier commented Oct 10, 2023

Closes #65. This is a major refactor. Here are the highlights:

  • The Python API no longer depends on the database. This means the modules ragna.core._state and ragna.core._orm were moved (and refactored) into ragna._cli.
  • Due to the point above, I was able to simplify the "helper" objects in the Python API. Most of them no longer carry an ID, since that is no longer necessary there and is now handled by the REST API. The two exceptions are ragna.core.Document and ragna.core.Source. ragna.core.Sources are generated by the selected source storage and thus we cannot make any assumptions on that other them being unique for a given source. Still, we want to link these sources to documents in our database for the REST API.
  • ragna.core.SourceStorage.retrieve now also takes the documents to make it easier to link the ragna.core.Sources to them. Although not relevant right now, this also enables the use case of having a central source storage that doesn't actually stores documents on user request, but only retrieves sources from pre-stored documents.
  • ragna.core.RagnaId was removed in favor of plain uuid.UUID
  • Closes deleting vs. closing chats #62, since it would be too tedious to do the refactor for the /close endpoint when we are going to delete it afterwards anyway. I've renamed the /start endpoint to /prepare. You can now send a DELETE request to /chats/{id} to delete a chat.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@pmeier pmeier changed the title [WIP] move database to REST API move database to REST API Oct 12, 2023
@pmeier
Copy link
Member Author

pmeier commented Oct 13, 2023

Merging this without review since I have another branch in backlog that depends on this one.

@pmeier pmeier merged commit 9a4e374 into main Oct 13, 2023
4 checks passed
@pmeier pmeier deleted the database branch October 13, 2023 09:51
@pmeier pmeier mentioned this pull request Nov 15, 2023
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.

Remove database from Python API? deleting vs. closing chats
1 participant