- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.6k
 
Bruno-agentfx-addPersistingConversationsSample #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bruno-agentfx-addPersistingConversationsSample #460
Conversation
Refactored `StreamConsoleHelper` to improve readability and maintainability, adding a `clearConsole` parameter to `PrintHeader` and a new `PrintAccumulatedLine` helper method. Removed the `AgentFx-BackgroundResponses-04-Persisting` project and replaced it with two new projects: `AgentFx-Persisting-01-Simple` and `AgentFx-Persisting-02-Menu`. `AgentFx-Persisting-01-Simple` demonstrates creating, saving, and reloading agent threads using serialization. `AgentFx-Persisting-02-Menu` introduces a menu-driven interface for interacting with persisted threads, supported by the new `PersistingUI` helper class. Updated the solution structure to include the new projects under `/7 Persisting Conversations/`. General improvements include better code formatting, consolidated logic, and enhanced maintainability.
- Added comments to explain the purpose and functionality of the sample. - Introduced `SavedThreadFilePath` for saving serialized thread state. - Improved step descriptions in `StreamConsoleHelper.PrintHeader`. - Added detailed comments for each step (create, persist, reload threads). - Implemented JSON serialization/deserialization for thread state. - Updated console output to reflect new steps and questions. - Added a "Menu Sample" for interactive thread management. - Referenced Microsoft Learn documentation for further guidance.
- Add new lesson guide: 06-AgentFx/README-PersistingConversations.md (how-to for serializing/deserializing AgentThread) - Update 06-AgentFx/README-BackgroundResponses.md to explain differences between background responses (continuations) and persisted conversations and link to new guide - Register new persisting samples in 06-AgentFx/readme.md (AgentFx-Persisting-01-Simple, AgentFx-Persisting-02-Menu) - Expand central samples/README.md: formatting fixes, add AgentFx sample descriptions and run instructions for background responses and persisting samples - Add per-sample README files for: - samples/AgentFx/AgentFx-BackgroundResponses-01-Simple/README.md - samples/AgentFx/AgentFx-Persisting-01-Simple/README.md - samples/AgentFx/AgentFx-Persisting-02-Menu/README.md Docs only; no code logic changes. MIT license notes preserved.
| 
           👋 Thanks for contributing @elbruno! We will review the pull request and get back to you soon.  | 
    
There was a problem hiding this 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 two new samples demonstrating AgentFx conversation persistence (serialization/deserialization of AgentThread). The changes include new sample projects, updated documentation, and improvements to shared helper classes.
- Adds 
AgentFx-Persisting-01-Simplesample showing basic thread serialization to disk - Adds 
AgentFx-Persisting-02-Menusample with interactive menu for thread management - Updates 
samples/README.mdwith highlighted AgentFx samples section and streamlined run instructions - Adds lesson-level documentation explaining persistence concepts and differences from background responses
 
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description | 
|---|---|
| samples/README.md | Added highlighted AgentFx samples section with run notes; removed duplicate platform-specific command blocks; improved formatting | 
| samples/AgentFx/AgentFx-Persisting-01-Simple/README.md | New documentation for basic persistence sample | 
| samples/AgentFx/AgentFx-Persisting-01-Simple/Program.cs | New sample demonstrating thread serialization and rehydration workflow | 
| samples/AgentFx/AgentFx-Persisting-01-Simple/AgentFx-Persisting-01-Simple.csproj | Project file for simple persistence sample | 
| samples/AgentFx/AgentFx-Persisting-02-Menu/README.md | New documentation for interactive menu persistence sample | 
| samples/AgentFx/AgentFx-Persisting-02-Menu/Program.cs | New interactive menu sample for managing persisted threads | 
| samples/AgentFx/AgentFx-Persisting-02-Menu/PersistingUI.cs | Console UI helper for menu interactions | 
| samples/AgentFx/AgentFx-Persisting-02-Menu/AgentFx-Persisting-02-Menu.csproj | Project file for menu persistence sample with incorrect RootNamespace | 
| samples/AgentFx/AgentFx-Demos.slnx | Added new persistence sample projects to solution | 
| samples/AgentFx/AgentFx-BackgroundResponses-01-Simple/StreamConsoleHelper.cs | Added optional clearConsole parameter and PrintAccumulatedLine method; formatting changes | 
| 06-AgentFx/readme.md | Added persistence sample references to lesson samples table | 
| 06-AgentFx/README-PersistingConversations.md | New lesson guide explaining persistence concepts and usage | 
| 06-AgentFx/README-BackgroundResponses.md | Added section differentiating background responses from persisted conversations | 
        
          
                samples/AgentFx/AgentFx-BackgroundResponses-01-Simple/StreamConsoleHelper.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                samples/AgentFx/AgentFx-BackgroundResponses-01-Simple/StreamConsoleHelper.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                samples/AgentFx/AgentFx-BackgroundResponses-01-Simple/StreamConsoleHelper.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …nsoleHelper.cs Co-authored-by: Copilot <[email protected]>
…nsoleHelper.cs Co-authored-by: Copilot <[email protected]>
…nsoleHelper.cs Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: elbruno <[email protected]>
Use AppDomain.CurrentDomain.BaseDirectory for persisted thread storage
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
          Check Broken URLsWe have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue. Check the file paths and associated broken URLs inside them. 
  | 
    
Docs only; no code logic changes. MIT license notes preserved.