Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def get_response_tool_web_search_attributes(tool: "WebSearchTool", index: int) -
if hasattr(tool, "search_context_size"):
parameters["search_context_size"] = tool.search_context_size

if hasattr(tool, "user_location"):
if hasattr(tool, "user_location") and tool.user_location is not None:
parameters["user_location"] = tool.user_location.__dict__

tool_data = tool.__dict__
Expand All @@ -521,13 +521,13 @@ def get_response_tool_file_search_attributes(tool: "FileSearchTool", index: int)
if hasattr(tool, "vector_store_ids"):
parameters["vector_store_ids"] = tool.vector_store_ids

if hasattr(tool, "filters"):
if hasattr(tool, "filters") and tool.filters is not None:
parameters["filters"] = tool.filters.__dict__

if hasattr(tool, "max_num_results"):
parameters["max_num_results"] = tool.max_num_results

if hasattr(tool, "ranking_options"):
if hasattr(tool, "ranking_options") and tool.ranking_options is not None:
parameters["ranking_options"] = tool.ranking_options.__dict__

tool_data = tool.__dict__
Expand Down