-
Notifications
You must be signed in to change notification settings - Fork 5
Move response API to Celery-backed job processing #381
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8123e26
fix process_response argument
avirajsingh7 073a61c
Refactor process_response to use get_openai_client for OpenAI API cli…
avirajsingh7 a757f29
Refactor response api:
avirajsingh7 824652e
move response code to service
avirajsingh7 b471c3e
Implement job management and integrate it with response processing
avirajsingh7 580c3f5
pass trace id to job table
avirajsingh7 0de7cd0
pre commit and pass trace id to celery
avirajsingh7 19928ab
add task id to response log
avirajsingh7 b1e8fb4
Refactor response handling: split response logic into separate modules
avirajsingh7 3d9b2fa
Refactor callback handling: move send_callback function to utils and …
avirajsingh7 b962760
Add ResponseJobStatus model and update responses endpoint to return s…
avirajsingh7 7764568
fix init
avirajsingh7 a569485
Add tests for JobCrud and response job handling
avirajsingh7 87ecdb6
update Job model to use string for task_id
avirajsingh7 96160c6
Add tests for response generation and processing, including success a…
avirajsingh7 f150372
pre commit
avirajsingh7 e7fe68d
rename test_jobs
avirajsingh7 bc40a18
Add flower dependency to pyproject.toml and uv.lock
avirajsingh7 f3f1565
Refactor job table migration and enhance error handling in job schedu…
avirajsingh7 7504ef7
Add CALLBACK_TIMEOUT setting and update send_callback to use it
avirajsingh7 1268dfb
Add callback timeout settings and update send_callback function to us…
avirajsingh7 65380f8
Remove unused response_chunks in CallbackResponse and update related …
avirajsingh7 db0c276
Fix update_job test to assert failure status and correct error message
avirajsingh7 6fe72d6
Refactor get_additional_data function to simplify exclusion logic for…
avirajsingh7 eaf8202
Update job_type field description for clarity and consistency
avirajsingh7 fcbd764
Remove unused imports and add conditional previous_response_id in gen…
avirajsingh7 898f034
Merge branch 'main' into feature/response_api_to_celery
avirajsingh7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
44 changes: 44 additions & 0 deletions
44
backend/app/alembic/versions/c6fb6d0b5897_create_job_table.py
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""create job table | ||
|
||
Revision ID: c6fb6d0b5897 | ||
Revises: 6ed6ed401847 | ||
Create Date: 2025-09-22 17:55:57.558157 | ||
|
||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlmodel.sql.sqltypes | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c6fb6d0b5897" | ||
down_revision = "6ed6ed401847" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"job", | ||
sa.Column("id", sa.Uuid(), nullable=False), | ||
sa.Column("task_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True), | ||
sa.Column("trace_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True), | ||
sa.Column("error_message", sqlmodel.sql.sqltypes.AutoString(), nullable=True), | ||
sa.Column( | ||
"status", | ||
sa.Enum("PENDING", "PROCESSING", "SUCCESS", "FAILED", name="jobstatus"), | ||
nullable=False, | ||
), | ||
sa.Column("job_type", sa.Enum("RESPONSE", name="jobtype"), nullable=False), | ||
sa.Column("created_at", sa.DateTime(), nullable=False), | ||
sa.Column("updated_at", sa.DateTime(), nullable=False), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
avirajsingh7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("job") | ||
# ### end Alembic commands ### |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.