mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
- Add limit and score_threshold to BaseRagConfig, propagate to clients - Update default search params in RAG storage, knowledge, and memory (limit=5, threshold=0.6) - Fix linting (ruff, mypy, PERF203) and refactor save logic - Update tests for new defaults and ChromaDB behavior
17 lines
538 B
Python
17 lines
538 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class KnowledgeConfig(BaseModel):
|
|
"""Configuration for knowledge retrieval.
|
|
|
|
Args:
|
|
results_limit (int): The number of relevant documents to return.
|
|
score_threshold (float): The minimum score for a document to be considered relevant.
|
|
"""
|
|
|
|
results_limit: int = Field(default=5, description="The number of results to return")
|
|
score_threshold: float = Field(
|
|
default=0.6,
|
|
description="The minimum score for a result to be considered relevant",
|
|
)
|