Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Motivation and Context

Adds a Getting Started sample demonstrating multi-turn conversation state management with OpenAI agents using the new Conversation API. Addresses the need for documentation on how to maintain conversation context across agent invocations with server-side storage.

Description

New sample Agent_OpenAI_Step05_Conversation showing:

  • ConversationClient integration - Using OpenAI's Conversation API for server-side conversation storage
  • OpenAIResponseClientAgent pattern - Using the Responses API with conversation state
  • AgentThread usage - Creating and reusing threads to maintain conversation history
  • ChatClientAgentRunOptions - Linking agent calls to server-side conversations via ConversationId
  • Multi-turn context - Follow-up questions that rely on previous conversation context
  • Conversation lifecycle - Creating, retrieving history, and deleting conversations

Copilot AI changed the title [WIP] Add conversation state sample for agent types .Net: Add Conversation State Sample (Step05) Dec 8, 2025
Copilot AI requested a review from rogerbarreto December 8, 2025 13:12
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation .NET labels Dec 8, 2025
@github-actions github-actions bot changed the title .Net: Add Conversation State Sample (Step05) .NET: Add Conversation State Sample (Step05) Dec 8, 2025
@rogerbarreto rogerbarreto marked this pull request as ready for review December 8, 2025 13:52
Copilot AI review requested due to automatic review settings December 8, 2025 13:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Getting Started sample (Step05) demonstrating conversation state management with OpenAI agents. The sample shows how to use the Agent Framework with OpenAI's Conversation API to maintain context across multiple agent invocations using server-side conversation storage.

Key changes:

  • New sample demonstrating ConversationClient integration with OpenAIResponseClientAgent
  • Shows multi-turn conversations using AgentThread to maintain conversation history
  • Demonstrates conversation lifecycle including creation, retrieval, and deletion

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dotnet/samples/GettingStarted/AgentWithOpenAI/README.md Adds reference to the new Step05 sample in the parent README
dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/README.md Provides comprehensive documentation for the conversation state management sample
dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Program.cs Implements the sample code demonstrating server-side conversation management
dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Agent_OpenAI_Step05_Conversation.csproj Project configuration file matching other samples in the directory
dotnet/agent-framework-dotnet.slnx Adds the new sample project to the solution file

@markwallace-microsoft markwallace-microsoft added the v1.0 Features being tracked for the version 1.0 GA label Dec 9, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Dec 10, 2025
@rogerbarreto rogerbarreto removed this pull request from the merge queue due to a manual request Dec 10, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Dec 10, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2025
* Initial plan

* Add Agent_OpenAI_Step05_Conversation sample for conversation state management

Co-authored-by: rogerbarreto <[email protected]>

* Update Program.cs comment to accurately describe the sample

Co-authored-by: rogerbarreto <[email protected]>

* Update the code to use the ConversationClient more in line with the samples in OpenAI

* Apply suggestions from code review

Co-authored-by: Copilot <[email protected]>

* Changing sample to use ChatClientAgent and conversationId in GetNewThread

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: rogerbarreto <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit 67e8304 Dec 11, 2025
15 checks passed
@crickman crickman deleted the copilot/add-conversation-state-sample branch December 11, 2025 16:31
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 v1.0 Features being tracked for the version 1.0 GA

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.Net: Add Conversation State Sample

4 participants