julep-ai / julep

A new DSL and server for AI agents and multi-step tasks
https://julep.ai
Apache License 2.0
2.66k stars 911 forks source link

fix: Use search_params.limit value instead of constant #797

Closed whiterabbit1983 closed 3 weeks ago

whiterabbit1983 commented 3 weeks ago

[!IMPORTANT] Replaced constant k with search_params.limit for dynamic document processing in search functions and updated models.

  • Behavior:
    • Replace constant k with search_params.limit in search_user_docs() and search_agent_docs() for maximal_marginal_relevance() call.
    • Allows dynamic control over document processing based on search_params.limit.
  • Functions:
    • Affects search_user_docs() and search_agent_docs() in search_docs.py.
  • Models:
    • Change snippets to snippet in DocReference in Docs.py and models.tsp.
  • Misc:
    • Add RootModel import in Tools.py.

This description was created by Ellipsis for 4c47490d2b380d6d5fa1e01fca65bb6f88f8ae76. It will automatically update as commits are pushed.

sweep-ai[bot] commented 3 weeks ago

Hey @whiterabbit1983, here are examples of how you can ask me to improve this pull request:

@sweep Fix the CI errors.
@sweep Add unit tests for `search_user_docs` and `search_agent_docs` functions that verify the maximal marginal relevance (MMR) functionality works correctly with the new dynamic `search_params.limit` value instead of the hardcoded `k=3`. Tests should cover:
- Different limit values (e.g., 1, 5, 10)
- Cases where MMR is enabled vs disabled via `mmr_strength`
- Verify the returned document count matches the requested limit

:book: For more information on how to use Sweep, please read our documentation.