openai/openai-agents-python

Add support Query rewriting in the FileSearchTool

Closed this issue · 1 comments

Describe the feature

It will be nice to have Query rewriting feature available when using FileSearchTool:

so it will be configured as part of the tool definition:

        tools=[
            FileSearchTool(
                max_num_results=10,
                vector_store_ids=[VECTOR_STORE_ID],
                include_search_results=False,
                rewrite_query=True,
            )
        ],

https://platform.openai.com/docs/guides/retrieval#query-rewriting

Certain query styles yield better results, so we've provided a setting to automatically rewrite your queries for optimal performance. Enable this feature by setting rewrite_query=true when performing a search

Thanks for sharing this feedback. The rewrite_query option is only available when you directly use the vector stores' search API. The built-in file-search tool does the best internally, so you don't need to pass the option.