Skip to content

Enhance prompt caching and clean up LinkedIn route and documentation#97

Merged
goldlabelapps merged 3 commits intomasterfrom
staging
Apr 23, 2026
Merged

Enhance prompt caching and clean up LinkedIn route and documentation#97
goldlabelapps merged 3 commits intomasterfrom
staging

Conversation

@goldlabelapps
Copy link
Copy Markdown
Owner

This pull request removes the /prompt/linkedin endpoint and its related code, and significantly improves the /prompt endpoint by adding robust database-backed caching for prompt completions. It also updates documentation formatting and makes a versioning change.

API Endpoint Changes:

  • Removed the /prompt/linkedin endpoint and all related code, including the linkedin.py file, its router imports/registrations, and references in the API root listing. [1] [2] [3] [4] [5]

Prompt Endpoint Improvements:

  • Enhanced the /prompt endpoint (prompt.py) to implement database-backed caching using a SHA256 hash of the prompt and, if available, full-text search with ranking. This reduces redundant calls to the LLM and speeds up repeated prompt requests. [1] [2]
  • Added logic to store prompt hash and additional metadata in the database, and improved the response structure to include more details such as cache status, duration, and model used. [1] [2]

Documentation and Versioning:

  • Improved formatting and section hierarchy in README.md for clarity and consistency. [1] [2] [3] [4]
  • Changed the application version in app/__init__.py from 2.2.9 to 1.

Bump version to 2.3.0, remove the LinkedIn-specific prompt endpoint and its router, and update routing/root listings accordingly. Rewrite /prompt handler to add SHA-256 prompt hashing, prefer exact-hash/text cache hits, and fall back to a tsvector rank-based match; store prompt_hash in the record data and populate search_vector on insert when supported. Improve response payloads to include cached/duration/model fields and ensure DB cursors/connections are closed in finally. Add tests for prompt behavior with mocked DB and GenAI client (tests/test_prompt.py) and update queue test expectations to the new filters structure (tests/test_queue.py).
Tidy documentation and repository artifacts: update README image alt text and normalize several section headings to H4 for consistency; remove committed output logs (pytest_output.txt, queue_output.txt) to avoid tracked generated artifacts; relocate/rename the Postman collection into tests (Python° file moved to tests/Python°.json).
@goldlabelapps goldlabelapps self-assigned this Apr 23, 2026
@goldlabelapps goldlabelapps merged commit 7e2a697 into master Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant