-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix: single entrypoint for backend via dependency injection #1537
Closed
norton120
wants to merge
269
commits into
letta-ai:1.0.0-pre
from
norton120:feature/dependency-inject-db-session
Closed
Fix: single entrypoint for backend via dependency injection #1537
norton120
wants to merge
269
commits into
letta-ai:1.0.0-pre
from
norton120:feature/dependency-inject-db-session
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
norton120
commented
Jul 22, 2024
|
||
# Parse request | ||
# TODO: don't just use JSON in the future | ||
human_name = request.config["human_name"] if "human_name" in request.config else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarahwooders I'm bringing this over but all of this should be part of the schema - I can merge your branch into this one and use AgentCreate
(I think that's what you said it'll be called) instead of this, or we can just reconcile during the merge into v1
…ly fine, fastapi response types need them actually loaded before runtime :(
…no matter at the moment, it works
now on to the fun part, swapping in that scoped server via conftest. This is where all the deep bugs will come out. Here. We. Go. https://c.tenor.com/x-FL-l7ERS4AAAAC/tenor.gif
…ues in the client
Co-authored-by: robingotz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is very hard to test app code without having good hooks for the state (ie database). The goal is to add top-down hooks for the database connection.
Def of Done:
How to test
The test suite should now be able to pass
db_session
and use atomic databases/schemas for every test function!Have you tested this PR?
Part of the V1 will be slowly moving to tests we strongly believe in.
Related issues or PRs
#1533
Is your PR over 500 lines of code?
yep these are big refactors
Additional context
I'll add looms to expand on this pattern as we go.