Using IChatClient with stateless openai responses api #7256
-
|
Hi! I am trying to get a stateless openai client up and running using Microsoft.Extensions.AI. So I am looking for examples of a multi-turn conversation where the returned encrypted reasoning tokens are resent to openai to continue an ongoing conversation. I am interested in both non-streaming and streaming use cases. Non-streaming Streaming Any information about how to do this or even if its possible using Microsoft.Extensions.AI would be appreciated! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For non-streaming, you should be able to do: chatHistory.AddMessages(response);or: chatHistory.AddRange(response.Messages);Does that not work? I expect it would.
For streaming, it looks like we currently have a bug in how ReasoningResponseItems are handled. I'll put up a PR to fix it. |
Beta Was this translation helpful? Give feedback.
For non-streaming, you should be able to do:
or:
Does that not work? I expect it would.
For streaming, it looks like we currently have a bug in how ReasoningResponseItems are handled. I'll put up a PR to fix it.