Assistants API file_search error when adjusting temperature

Hi, I’m working on Assistants API for constructing RAG system.

Since my system should be deterministic due to its purpose, I adjusted the temperature of assistant with file_search tool, like

from openai import OpenAI

assistant = OpenAI.beta.assistants.create(
    model="gpt-4o-mini",
    temperature=0.2,
    tools=[{"type": "file_search"}],
    tool_resources={"file_search": {"vector_store_ids": [vector_store_id]}}
)

After creating a thread and run, it raises two different errors alternatively:

  1. messages from OpenAI.beta.threads.messages.list(thread_id, run_id) is an empty list.
  2. tool_call_details.file_search.results from run_step.step_details.tool_calls` is an empty list.

Making my assistant deterministic might cause these errors since without any changes it works fine.

Is there anyone who faced the same issue? Or is there any better way to use file_search for designing RAG system?

Thanks in advance.

P.S. 1. I guess top_p also interfere the file_search, but not that extreme as temperature.
P.S. 2. I found that adjusting temperature might affect the number of chunks to be retrieved.

1 Like