You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Define the file search tool
var fileSearchTool = new FileSearchTool();
fileSearchTool.MaxNumberResults = 20;
fileSearchTool.RankingOptions = new RankingOptions();
fileSearchTool.RankingOptions.ScoreThreshold = 1;
var fileSearchToolDefinition = ToolDefinition.DefineFileSearch(fileSearchTool);
// Add the file search tool to your tools definition list
toolsDefinition.Add(fileSearchToolDefinition);
var request = new ChatCompletionCreateRequest
{
Messages = messages,
Model = "gpt-4o",
//Model = "gpt-4.1",
MaxTokens = maxTokens,
Temperature = 0.9f,
ResponseFormat = responseFormat,
Tools = toolsDefinition,
};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I’m running into this exception when trying to add a file search tool to my tool definitions.
Not sure what I’m missing here. Any ideas?
Here’s the code I’m using:
Beta Was this translation helpful? Give feedback.
All reactions