Skip to content

Commit

Permalink
Added ranking options to file search
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Sep 21, 2024
1 parent 1fe1185 commit 5c23a06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agency_swarm/tools/oai/FileSearch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from typing import Optional
from pydantic import BaseModel, field_validator, Field
from typing import Dict, Union, Optional

class FileSearchConfig(BaseModel):
max_num_results: int = Field(50, description="Optional override for the maximum number of results")
ranking_options: Optional[Dict[str, Union[str, float]]] = Field(
{'ranker': 'default_2024_08_21', 'score_threshold': 0.0},
description="The ranking options for the file search. If not specified, the file search tool will use the auto ranker and a score_threshold of 0."
)

@field_validator('max_num_results')
def check_max_num_results(cls, v):
Expand Down

0 comments on commit 5c23a06

Please sign in to comment.