Replies: 3 comments
-
|
@westey-m any thoughts here? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Asdprom, The stack you are showing is missing the part where it chooses the OpenAI protocol. But since you are mentioning reasoning I assume you are using responses? Please let me know if this is not correct. Reponses has two modes, service managed chat history, and client managed chat history. Again, I'm assuming you are using client side managed chat history, since service side should already have the required reasoning content available. For client side managed chat history, you have to opt in to having encrypted reasoning content included on subsequent requests, which can be done via a setting on the OpenAI client, and in agent framework via ChatOptions.RawRepresentationFactory. To make this easy for users, we have a helper that both enables client side chat history storage and automatically includes encrypted reasoning content: AsIChatClientWithStoredOutputDisabled You can use it like this: AIAgent agentStoreFalse = new OpenAIClient(apiKey)
.GetResponsesClient()
.AsIChatClientWithStoredOutputDisabled(model: model)
.AsAIAgent(instructions: "You are good at telling jokes.", name: "Joker"); |
Beta Was this translation helpful? Give feedback.
-
|
@westey-m It turns out I was using the older I initially couldn't switch to As a temporary workaround, I patched the JSON returned by LiteLLM on the fly and removed the problematic fields. After doing that, everything seems to work correctly - the requests now include the reasoning from previous steps, and reasoning is continuous across requests. That workaround feels pretty ugly, though, and I'd prefer not to rely on it. I also understand this is really a LiteLLM/OpenAI client compatibility issue rather than something related to MAF. Out of curiosity, is there any similar mechanism available when using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I am using the OpenAiClient.AsIChatClient().AsAIAgent().RunAsync() pipeline.
I may be missing a configuration option, but while inspecting the requests sent to the LLM, I noticed that previous reasoning content is not included in subsequent requests.
As a result, after each tool call the agent appears to restart its reasoning process from scratch instead of continuing from the previous reasoning context. This breaks agent loops that rely on maintaining a continuous thought process across tool calls.
Is there currently an option to preserve and forward reasoning content automatically through the agent pipeline?
If not, could this be supported by default? Ideally, the framework should handle TextReasoningContent correctly when constructing the next model request, rather than requiring users to manually convert reasoning content into generic TextContent and inject it back into history.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions