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
With the constructor of AssistantCreationOptions / FileSearchToolRessources it's not possible to ever set a value for VectorStoreIds.
Since the field is left uninitialized it's not possible to use the Add method and also a new List cannot be assigned since the set-method is declared as internal.
Steps to reproduce
See here:
AssistantCreationOptions options = new AssistantCreationOptions()
{
Name = "Test",
Instructions = "Some instructions...",
Tools = { ToolDefinition.CreateFileSearch(10) }
};
options.ToolResources.FileSearch.VectorStoreIds.Add(myVectorStore.Id);
This compiles but throws an exception because "Add" requires a non-null Object on VectorStoreIds (which is missing in the constructor).
This would also be expected to be possible:
AssistantCreationOptions options = new AssistantCreationOptions()
{
Name = "Test",
Instructions = "Some instructions...",
Tools = { ToolDefinition.CreateFileSearch(10) },
ToolResources = new FileSearchToolResources() {
VectorStoreIds = [myVectorStoreId],
}
};
This example doesn't compile because VectorStoreIds is read only because of being "inline".
Code snippets
No response
OS
Windows 11
.NET version
8.0
Library version
2.1.0
The text was updated successfully, but these errors were encountered:
cpalm1974
changed the title
VectorStoreIds in AssistantCreationOptions cannot be populated
VectorStoreIds in AssistantCreationOptions / FileSearchToolResources cannot be populated
Dec 3, 2024
The first code snippet in your original post fails because options.ToolResources is not initialized. You must first create a new ToolResources object. This new obect has a property called FileSearch, which you must also initialize by creating a new FileSearchToolResources instance.
The second code snippet in the original post does not compile because FileSearchToolResources is not the same type as the ToolResources property. Instead, like @Pigweed mentioned, ToolResources has a FileSearch property of type FileSearchToolResources.
As I'm typing this, I can see that the current naming is confusing. We will take this as feedback and rename these in the future to make the relationship between them clearer. Thank you!
Service
OpenAI
Describe the bug
With the constructor of AssistantCreationOptions / FileSearchToolRessources it's not possible to ever set a value for VectorStoreIds.
Since the field is left uninitialized it's not possible to use the Add method and also a new List cannot be assigned since the set-method is declared as internal.
Steps to reproduce
This compiles but throws an exception because "Add" requires a non-null Object on VectorStoreIds (which is missing in the constructor).
This example doesn't compile because VectorStoreIds is read only because of being "inline".
Code snippets
No response
OS
Windows 11
.NET version
8.0
Library version
2.1.0
The text was updated successfully, but these errors were encountered: