Skip to content

.NET: Add Invocations protocol samples (hosted echo agent + client)#5278

Merged
rogerbarreto merged 1 commit intomicrosoft:feature/responses-hostingfrom
rogerbarreto:feature/responses-hosting-samples-invoke
Apr 16, 2026
Merged

.NET: Add Invocations protocol samples (hosted echo agent + client)#5278
rogerbarreto merged 1 commit intomicrosoft:feature/responses-hostingfrom
rogerbarreto:feature/responses-hosting-samples-invoke

Conversation

@rogerbarreto
Copy link
Copy Markdown
Member

Summary

Adds two new samples demonstrating the Invocations protocol for hosted agents:

Hosted-Invocations-EchoAgent (server)

A minimal echo agent hosted via the Invocations protocol (\POST /invocations) using \AddInvocationsServer()\ / \MapInvocationsServer(), bridged to an Agent Framework \AIAgent\ through a custom \InvocationHandler.

SimpleInvocationsAgent (client)

A console REPL client that wraps \HttpClient\ calls to the /invocations\ endpoint in a custom \InvocationsAIAgent, demonstrating programmatic consumption of the Invocations protocol.

Key design choices

  • Both samples default to port 8088 for consistency with other hosted agent samples
  • The \InvocationsAIAgent\ takes a base endpoint URI and appends /invocations\ automatically
  • No Azure SDK or LLM dependencies needed for the echo sample
  • Follows the same REPL UX pattern as the existing \SimpleAgent\ sample

Testing

  • All 9 HostedV2 projects build successfully (0 warnings, 0 errors)
  • Tested end to end: EchoAgent server on 8088 + SimpleInvocationsAgent client exchanging messages

Add Hosted-Invocations-EchoAgent: a minimal echo agent hosted via the
Invocations protocol (POST /invocations) using AddInvocationsServer and
MapInvocationsServer, bridged to an Agent Framework AIAgent through a
custom InvocationHandler.

Add SimpleInvocationsAgent: a console REPL client that wraps HttpClient
calls to the /invocations endpoint in a custom InvocationsAIAgent,
demonstrating programmatic consumption of the Invocations protocol.

Both samples default to port 8088 for consistency with other hosted
agent samples.
@rogerbarreto rogerbarreto changed the title Add Invocations protocol samples (hosted echo agent + client) .Net: Add Invocations protocol samples (hosted echo agent + client) Apr 15, 2026
@rogerbarreto rogerbarreto self-assigned this Apr 15, 2026
@moonbox3 moonbox3 added documentation Improvements or additions to documentation .NET labels Apr 15, 2026
@github-actions github-actions bot changed the title .Net: Add Invocations protocol samples (hosted echo agent + client) .NET: Add Invocations protocol samples (hosted echo agent + client) Apr 15, 2026
@rogerbarreto rogerbarreto merged commit 53fec2a into microsoft:feature/responses-hosting Apr 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants