Closed marcusschiesser closed 3 weeks ago
Latest commit: 606fbb42d4de986c032a3d09ef950e9afe08f4ae
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The changes enhance the handling of the TOP_K
environment variable across multiple files, modifying or removing default values to allow for greater flexibility in configuration. Logic adjustments permit the handling of potential None
values for the top_k
variable in various functions, improving the management of similarity searches and query execution within the system.
File Path | Change Summary |
---|---|
.changeset/weak-students-pay.md | Introduced a patch titled "create-llama" for retrieval defaults from LlamaCloud related to student payments. |
helpers/env-variables.ts | Removed default value for TOP_K in getEngineEnvs function, allowing for external configuration. |
templates/components/engines/python/{agent,chat}/engine.py | Modified get_chat_engine to handle TOP_K , converting it to an integer and allowing top_k to be None if 0 . |
templates/types/extractor/fastapi/app/engine/engine.py | Modified get_query_engine to allow similarity_top_k to be None when TOP_K is not defined. |
templates/types/multiagent/fastapi/app/agents/query_engine/agent.py | Updated get_query_engine_tool to flexibly handle similarity_top_k using an intermediate top_k . |
sequenceDiagram
participant User
participant Config
participant QueryEngine
User->>Config: Request TOP_K value
Config-->>User: Return TOP_K (or undefined)
User->>QueryEngine: Call get_query_engine with TOP_K
QueryEngine-->>User: Return results based on top_k (could be None)
🐇 In the fields I hop and play,
WithTOP_K
now at bay,
Flexibility in every line,
No more defaults to confine.
A joyful leap, a code delight,
For better searches, day and night! 🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
TOP_K
parameter across various components, allowing for aNone
value where previously a default integer was enforced.Bug Fixes
TOP_K
environment variable to improve the logic and functionality of query engines.