mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-12 22:12:37 +00:00
refactor: remove inferred_categories from RecallState and update category merging logic
- Removed the inferred_categories field from RecallState to simplify state management. - Updated the _merged_categories method to only merge caller-supplied categories, enhancing clarity in category handling.
This commit is contained in:
@@ -37,7 +37,6 @@ class RecallState(BaseModel):
|
||||
query: str = ""
|
||||
scope: str | None = None
|
||||
categories: list[str] | None = None
|
||||
inferred_categories: list[str] = Field(default_factory=list)
|
||||
time_cutoff: datetime | None = None
|
||||
source: str | None = None
|
||||
include_private: bool = False
|
||||
@@ -84,7 +83,7 @@ class RecallFlow(Flow[RecallState]):
|
||||
def _merged_categories(self) -> list[str] | None:
|
||||
"""Merge caller-supplied and LLM-inferred categories."""
|
||||
merged = list(
|
||||
set((self.state.categories or []) + self.state.inferred_categories)
|
||||
set((self.state.categories or []))
|
||||
)
|
||||
return merged or None
|
||||
|
||||
@@ -212,10 +211,6 @@ class RecallFlow(Flow[RecallState]):
|
||||
)
|
||||
self.state.query_analysis = analysis
|
||||
|
||||
# Wire keywords -> category filter
|
||||
if analysis.keywords:
|
||||
self.state.inferred_categories = analysis.keywords
|
||||
|
||||
# Parse time_filter into a datetime cutoff
|
||||
if analysis.time_filter:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user