Skip to content

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
staging
Apr 8, 2026

Conversation

@goldlabelapps
Copy link
Copy Markdown
Owner

The main changes include adding a new endpoint to unflag all prospects, supporting filtering LLM completions by prospect_id, adding a type column to the llm table, and refactoring the flagged prospects routes for consistency.

API Enhancements:

  • Added a new POST endpoint /unflag-all to reset all flag fields in the prospects table to false, including error handling and a corresponding test. (app/api/prospects/flag.py, tests/test_routes.py) [1] [2]
  • Updated the LLM completions endpoint to support filtering by prospect_id, returning all records for a given prospect without pagination. (app/api/llm/llm.py)

Database Schema & Migration:

  • Added a migration SQL script and helper Python script to add a type column (default 'default') to the llm table 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:

  • Renamed the flagged prospects route module from flagged.py to flag.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]
  • Increased the default page size for the /prospects endpoint from 50 to 100 and removed the /prospects/init endpoint. (app/api/prospects/prospects.py) [1] [2]

Other:

  • Bumped the application version to 2.1.6. (app/__init__.py)

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.
@goldlabelapps goldlabelapps added this to the MVP milestone Apr 8, 2026
@goldlabelapps goldlabelapps self-assigned this Apr 8, 2026
@goldlabelapps goldlabelapps merged commit fdf51c8 into master Apr 8, 2026
1 check passed
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.

1 participant