<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dapr AI .NET SDK on Dapr Docs</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/</link><description>Recent content in Dapr AI .NET SDK on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/index.xml" rel="self" type="application/rss+xml"/><item><title>Dapr AI Client</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-conversation-usage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-conversation-usage/</guid><description>&lt;p>The Dapr AI client package allows you to interact with the AI capabilities provided by the Dapr sidecar.&lt;/p>


&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

 The Dapr Conversation building block requires Dapr runtime v1.16.0 or later. Response format, prompt cache retention,
and token usage statistics require Dapr runtime v1.17.0 or later.

&lt;/div>

&lt;h2 id="lifetime-management">Lifetime management&lt;/h2>
&lt;p>A &lt;code>DaprConversationClient&lt;/code> is a version of the Dapr client that is dedicated to interacting with the Dapr Conversation
API. It can be registered alongside a &lt;code>DaprClient&lt;/code> and other Dapr clients without issue.&lt;/p></description></item><item><title>How to: Create and use Dapr AI Conversations in the .NET SDK</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-conversation-howto/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-conversation-howto/</guid><description>&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://dotnet.microsoft.com/download/dotnet/8.0">.NET 8&lt;/a>,
&lt;a href="https://dotnet.microsoft.com/download/dotnet/9.0">.NET 9&lt;/a>, or
&lt;a href="https://dotnet.microsoft.com/download/dotnet/10.0">.NET 10&lt;/a> installed&lt;/li>
&lt;li>&lt;a href="https://docs.dapr.io/getting-started/install-dapr-cli/">Dapr CLI&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.dapr.io/getting-started/install-dapr-selfhost">Initialized Dapr environment&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="installation">Installation&lt;/h2>
&lt;p>To get started with the Dapr AI .NET SDK client, install the &lt;a href="https://www.nuget.org/packages/Dapr.AI">Dapr.AI package&lt;/a> from NuGet:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>dotnet add package Dapr.AI
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>A &lt;code>DaprConversationClient&lt;/code> maintains access to networking resources in the form of TCP sockets used to communicate with the Dapr sidecar.&lt;/p>
&lt;h3 id="dependency-injection">Dependency Injection&lt;/h3>
&lt;p>The &lt;code>AddDaprAiConversation()&lt;/code> method will register the Dapr client ASP.NET Core dependency injection and is the recommended approach
for using this package. This method accepts an optional options delegate for configuring the &lt;code>DaprConversationClient&lt;/code> and a
&lt;code>ServiceLifetime&lt;/code> argument, allowing you to specify a different lifetime for the registered services instead of the default &lt;code>Singleton&lt;/code>
value.&lt;/p></description></item><item><title>How to: Using Microsoft's AI extensions with Dapr's .NET Conversation SDK</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-extensions-howto/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-ai/dotnet-ai-extensions-howto/</guid><description>&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://dotnet.microsoft.com/download/dotnet/8.0">.NET 8&lt;/a>,
&lt;a href="https://dotnet.microsoft.com/download/dotnet/9.0">.NET 9&lt;/a>, or
&lt;a href="https://dotnet.microsoft.com/download/dotnet/10.0">.NET 10&lt;/a> installed&lt;/li>
&lt;li>&lt;a href="https://docs.dapr.io/getting-started/install-dapr-cli/">Dapr CLI&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.dapr.io/getting-started/install-dapr-selfhost">Initialized Dapr environment&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="installation">Installation&lt;/h2>
&lt;p>To get started with this SDK, install both the &lt;a href="https://www.nuget.org/packages/Dapr.AI">Dapr.AI&lt;/a> and
&lt;a href="https://www.nuget.org/packages/Dapr.AI.Microsoft.Extensions">Dapr.AI.Microsoft.Extensions&lt;/a> packages from NuGet:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>dotnet add package Dapr.AI
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>dotnet add package Dapr.AI.Microsoft.Extensions
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>DaprChatClient&lt;/code> is a Dapr-based implementation of the &lt;code>IChatClient&lt;/code> interface provided in the
&lt;code>Microsoft.Extensions.AI.Abstractions&lt;/code> package using Dapr&amp;rsquo;s [conversation building block]({{ ref conversation-overview.md }}). It allows
developers to build against the types provided by Microsoft&amp;rsquo;s abstraction while providing the greatest conformity to the
Dapr conversation building block available. As both approaches adopt OpenAI&amp;rsquo;s API approach, these are expected to increasingly
converge over time.&lt;/p></description></item></channel></rss>