Open
Conversation
…Functions (.NET) Demonstrates the entity-based agent loop pattern using durable entities with Redis pub/sub for real-time streaming. Both samples include: - ChatAgentEntity: durable entity holding conversation history - Agent loop with tool calling (get_weather) - SSE streaming and non-streaming (?stream=false) modes - Conversation history and reset endpoints - Echo fallback client when Azure OpenAI is not configured Durable Task SDK version: ASP.NET minimal API with direct DTS connection Durable Functions version: Azure Functions isolated worker with DTS backend Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ctions - Durable Task SDK sample: FastAPI app with durable entity-based chat agent, SSE streaming via Redis pub/sub, echo fallback when no Azure OpenAI configured - Durable Functions sample: Azure Functions v2 (Python) with DFApp, entity-based chat agent, async Redis pub/sub collection via asyncio.to_thread() - Both samples tested end-to-end with DTS emulator and Redis Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new sample for an agent-powered chat workflow using Durable Entities and Redis streaming in .NET. It sets up a durable, stateful chat agent that interacts with users via HTTP endpoints, leverages Azure OpenAI (or a mock echo client), and streams responses in real-time to clients using Redis pub/sub and Server-Sent Events (SSE). The main changes are the addition of the core agent entity, HTTP endpoints, supporting models, dependency injection setup, and project configuration.
Agent and HTTP Endpoint Implementation:
ChatAgentEntity, a durable entity that manages a chat session, interacts with an LLM, executes tool calls, and streams response chunks to Redis. This enables real-time, stateful chat workflows.ChatEndpointsclass with HTTP endpoints for sending messages (with SSE streaming or JSON fallback), retrieving chat history, and resetting sessions.Models and State Management:
ChatMsg,ChatRequest,ChatAgentState, andChatToolto represent messages, requests, agent state, and tools.Dependency Injection and Service Setup:
Program.cs, including Azure OpenAI-backedIChatClient(with fallback to a local echo client) and Redis connection. Provided a simpleEchoChatClientfor local development.Project Configuration:
AgentDirectedWorkflows.csprojtargeting .NET 10, referencing Azure Functions, Durable Task, Redis, Azure OpenAI, and related packages. Included build steps for native assets and configuration for local development.