We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys
I'm getting the message bellow if an agent has attached a vectorStore
OpenAIAssistantAgent agent = await OpenAIAssistantAgent.CreateAsync( kernel: new Kernel(), GetClientProvider(), new OpenAIAssistantDefinition(openAiOptions.ChatModelId) { Instructions = instructions, Name = name, EnableFileSearch = !string.IsNullOrEmpty(vectorStoreId), EnableCodeInterpreter = enableCodeInterpreter, VectorStoreId = vectorStoreId });
The error happens when I try to invoke the chat.
System.InvalidOperationException: The requested operation requires an element of type 'String', but the target element has type 'Object'. at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType) at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsFileSearchObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsFileSearchObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetails.DeserializeInternalRunStepDeltaStepDetails(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaObjectDelta.DeserializeInternalRunStepDeltaObjectDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDelta.DeserializeInternalRunStepDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.RunStepDetailsUpdate.DeserializeRunStepDetailsUpdates(JsonElement element, StreamingUpdateReason updateKind, ModelReaderWriterOptions options) at OpenAI.Assistants.StreamingUpdate.FromEvent(SseItem1 sseItem) at OpenAI.Assistants.AsyncStreamingUpdateCollection.AsyncStreamingUpdateEnumerator.System.Collections.Generic.IAsyncEnumerator.MoveNextAsync() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult() at AiEngine.SemanticKernel.SemanticKernelService.GetChatMessageContentStreamingAssistantAsync(RequestModel requestModel, OpenAIAssistantAgent assistant, String threadId) in
System.InvalidOperationException: The requested operation requires an element of type 'String', but the target element has type 'Object'. at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType) at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsFileSearchObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsFileSearchObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetails.DeserializeInternalRunStepDeltaStepDetails(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaObjectDelta.DeserializeInternalRunStepDeltaObjectDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDelta.DeserializeInternalRunStepDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.RunStepDetailsUpdate.DeserializeRunStepDetailsUpdates(JsonElement element, StreamingUpdateReason updateKind, ModelReaderWriterOptions options) at OpenAI.Assistants.StreamingUpdate.FromEvent(SseItem
1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList
1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult() at AiEngine.SemanticKernel.SemanticKernelService.GetChatMessageContentStreamingAssistantAsync(RequestModel requestModel, OpenAIAssistantAgent assistant, String threadId) in
The text was updated successfully, but these errors were encountered:
Even with code modifcation where vectore store is attached to a thread
```
OpenAIAssistantAgent agent = await OpenAIAssistantAgent.CreateAsync( kernel: new Kernel(), GetClientProvider(), new OpenAIAssistantDefinition(openAiOptions.ChatModelId) { Instructions = instructions, Name = name, EnableFileSearch = !string.IsNullOrEmpty(vectorStoreId), EnableCodeInterpreter = enableCodeInterpreter });
return agent;
return await assistant.CreateThreadAsync(new OpenAIThreadCreationOptions() { VectorStoreId = setup.VectorStoreId });
I can see in openAI: ![image](https://github.com/user-attachments/assets/602be13a-3cb9-465d-9c2e-e0da4e5f1c68)
Sorry, something went wrong.
Sorry guys false alarm. Once we upgraded the library to 1.20 it started working.
I'm going to close this issue now
crickman
No branches or pull requests
Hi guys
I'm getting the message bellow if an agent has attached a vectorStore
The error happens when I try to invoke the chat.
System.InvalidOperationException: The requested operation requires an element of type 'String', but the target element has type 'Object'. at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType) at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsFileSearchObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsFileSearchObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObjectToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetailsToolCallsObject.DeserializeInternalRunStepDeltaStepDetailsToolCallsObject(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaStepDetails.DeserializeInternalRunStepDeltaStepDetails(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDeltaObjectDelta.DeserializeInternalRunStepDeltaObjectDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.InternalRunStepDelta.DeserializeInternalRunStepDelta(JsonElement element, ModelReaderWriterOptions options) at OpenAI.Assistants.RunStepDetailsUpdate.DeserializeRunStepDetailsUpdates(JsonElement element, StreamingUpdateReason updateKind, ModelReaderWriterOptions options) at OpenAI.Assistants.StreamingUpdate.FromEvent(SseItem
1 sseItem) at OpenAI.Assistants.AsyncStreamingUpdateCollection.AsyncStreamingUpdateEnumerator.System.Collections.Generic.IAsyncEnumerator.MoveNextAsync() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList
1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult() at AiEngine.SemanticKernel.SemanticKernelService.GetChatMessageContentStreamingAssistantAsync(RequestModel requestModel, OpenAIAssistantAgent assistant, String threadId) in
The text was updated successfully, but these errors were encountered: