-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: convert Files API to use FastAPI router #4339
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @mfleader! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ llama-stack-client-node studio · code · diff
⚡ llama-stack-client-python studio · conflict
✅ llama-stack-client-go studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
leseb
left a comment
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.
nit
68224d6 to
5d454de
Compare
5d454de to
f705321
Compare
29df0be to
693b600
Compare
daa3380 to
b25f520
Compare
21b4ce0 to
87b4d84
Compare
# What does this PR do? Consolidates provider data context handling into middleware, eliminating duplication between FastAPI router routes and legacy @webmethod routes. Closes #4366 ## Test Plan Added unit test suite `test_test_context_middleware`, specifically `test_middleware_extracts_test_id_from_header` to validate the expected behavior. ``` ❯ ./scripts/unit-tests.sh tests/unit/ ``` Integration of the middleware test context with the `files` FastAPI router migration from [pull/4339](#4339). ``` ❯ git switch migrate-files-api Switched to branch 'migrate-files-api' ❯ git rebase fix-test-ctx-middleware Successfully rebased and updated refs/heads/migrate-files-api. ❯ ./scripts/integration-tests.sh --inference-mode replay --suite base --setup ollama --stack-config server:starter --subdirs files ``` Signed-off-by: Matthew F Leader <mleader@redhat.com>
87b4d84 to
3d93711
Compare
531b723 to
5b3fff0
Compare
5b3fff0 to
2377257
Compare
| Order, | ||
| ResourceNotFoundError, | ||
| ) | ||
| from llama_stack_api.files.models import ( |
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.
| from llama_stack_api.files.models import ( | |
| from llama_stack_api import ( |
| VectorStoreChunkingStrategyStatic, | ||
| VectorStoreChunkingStrategyStaticConfig, | ||
| ) | ||
| from llama_stack_api.files.models import UploadFileRequest |
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.
| from llama_stack_api.files.models import UploadFileRequest | |
| from llama_stack_api import UploadFileRequest |
| Order, | ||
| ResourceNotFoundError, | ||
| ) | ||
| from llama_stack_api.files.models import ( |
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.
| from llama_stack_api.files.models import ( | |
| from llama_stack_api import ( |
2377257 to
dc127a1
Compare
…stack#4367) # What does this PR do? Consolidates provider data context handling into middleware, eliminating duplication between FastAPI router routes and legacy @webmethod routes. Closes llamastack#4366 ## Test Plan Added unit test suite `test_test_context_middleware`, specifically `test_middleware_extracts_test_id_from_header` to validate the expected behavior. ``` ❯ ./scripts/unit-tests.sh tests/unit/ ``` Integration of the middleware test context with the `files` FastAPI router migration from [pull/4339](llamastack#4339). ``` ❯ git switch migrate-files-api Switched to branch 'migrate-files-api' ❯ git rebase fix-test-ctx-middleware Successfully rebased and updated refs/heads/migrate-files-api. ❯ ./scripts/integration-tests.sh --inference-mode replay --suite base --setup ollama --stack-config server:starter --subdirs files ``` Signed-off-by: Matthew F Leader <mleader@redhat.com>
dc127a1 to
6682fa7
Compare
Signed-off-by: Matthew F Leader <mleader@redhat.com>
6682fa7 to
8cc26df
Compare
What does this PR do?
Converts the Files API to use the new FastAPI router pattern, matching the approach used for Batches API.
Test Plan
CI and
curl http://localhost:8321/v1/inspect/routes | jq '.data[] | select(.route | contains("files"))'