microsoft / microsoft/agent-framework

Python: Using .Net agent framework client to connect to DevUI Responses REST API (python)

Open
#3,033 0 comments 0 reactions 1 assignee View on GitHub

@victordibia is already working on this.

Since Jan 6, 2026.

.NET devui python
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

We have setup a python DevUI server, and we are trying to connect to the Responses REST API on this server using a .Net client (agent framework).
The problem we noticed is that the python server serializes the "created_at" property as a fractional number in the Json response, and the .Net client gives a FormatException when trying to deserialize that value to a DateTimeOffset property.

We invoke the DevUI python server agent by creating an OpenAIClient object in .Net, then invoking the GetResponsesClient() method and then the CreateAIAgent method.

var client = new OpenAIClient(new ApiKeyCredential("dummy"), , new OpenAIClientOptions() { Endpoint = uri });
var responseClient = client.GetResponsesClient("devui");
var chatOptions = new ChatOptions()
{
  RawRepresentationFactory = _ => new CreateResponseOptions()
  {

    Metadata =
    {
        { "entity_id", name }
    }
  }
};
var agent = responseClient.CreateAIAgent(new ChatClientAgentOptions() { Name = name, ChatOptions = chatOptions }, loggerFactory: sp.GetRequiredService<ILoggerFactory>())

agent.RunAsync(...); // A FormatException is thrown

This is an example of the response produced by the DevUI python server:

{"id":"resp_dad8beaf1b7a","created_at":1766440374.769623,"error":null,"incomplete_details":null,"instructions":null,"metadata":null,"model":"devui","object":"response","output":[{"id":"msg_dcd66945","content":[{"annotations":[],"text":"Here’s what I have ...

We have managed to workaround this issue by creating a DelegatingHandler to inspect the response and convert the fractional number (created_at property) to an integer before the Json response gets deserialized.

Is there a better way to deal with this situation? Is this an issue that needs to be fixed in the code?

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.