.Net: OpenAIAssistantAgentThread.GetMessagesAsync not returning any toolcalls #11913
-
I have an OpenAIAssistantAgent and am using the GetMessagesAsync method on my OpenAIAssistantAgentThread to retrieve the thread messages, however, this only appears to return user and assistant messages and does not return any tool calls or tool call results. However, when I swap this to a ChatCompletionAgent and call GetMessagesAsync on my ChatHistoryAgentThread, it returns the tool calls and tool call results. Is this the intended behavior for OpenAIAssistantAgents and if so, is there any way to use an OpenAIAssistantAgent with a thread and store the tool calls? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Answer from SK OH: This example shows using AgentInvokeOptions.OnIntermediateMessage to intercept messages: While the example is streaming, the same approach works for non-streaming. Note, this shows: |
Beta Was this translation helpful? Give feedback.
Answer from SK OH:
This example shows using AgentInvokeOptions.OnIntermediateMessage to intercept messages:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/Agents/OpenAIAssistant_Streaming.cs#L43
While the example is streaming, the same approach works for non-streaming.
Note, this shows:
The immediate agent response
The intercepted messages (via AgentInvokeOptions) - has tool calls
The message retrieved by the thread - no tool calls