This pull request introduces several improvements and fixes to the LLM and Prospects APIs, as well as database schema updates and code refactoring for clarity and maintainability. #71
Merged
goldlabelapps merged 2 commits intomasterfrom Apr 8, 2026
Conversation
Rename app/api/prospects/flagged.py to app/api/prospects/flag.py and update imports/usages accordingly. Replace flagged_router with flag_router in app/api/prospects/__init__.py and app/api/routes.py, and include the updated router in the main routes. Also add a brief comment and minor formatting changes in the new flag.py.
Add POST /unflag-all endpoint to reset all prospect flags (with a test). Extend /llm to accept prospect_id to return records for a specific prospect (no pagination) while keeping paginated listing. Add SQL migration and runner to add a 'type' TEXT column to the llm table. Bump package version to 2.1.6, increase prospects default page size to 100, and remove the deprecated /prospects/init endpoint.
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
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.
The main changes include adding a new endpoint to unflag all prospects, supporting filtering LLM completions by
prospect_id, adding atypecolumn to thellmtable, and refactoring the flagged prospects routes for consistency.API Enhancements:
/unflag-allto reset allflagfields in theprospectstable tofalse, including error handling and a corresponding test. (app/api/prospects/flag.py,tests/test_routes.py) [1] [2]prospect_id, returning all records for a given prospect without pagination. (app/api/llm/llm.py)Database Schema & Migration:
typecolumn (default'default') to thellmtable if it doesn't exist. (app/api/llm/sql/alter_add_type_column.sql,app/api/llm/sql/run_alter_add_type_column.py) [1] [2]Prospects API Refactoring:
flagged.pytoflag.py, updated imports and router registrations throughout the codebase for consistency. (app/api/prospects/__init__.py,app/api/prospects/flag.py,app/api/routes.py) [1] [2] [3]/prospectsendpoint from 50 to 100 and removed the/prospects/initendpoint. (app/api/prospects/prospects.py) [1] [2]Other:
2.1.6. (app/__init__.py)