Merge pull request #4489 from hhunter-ms/beef-up-conversation

[Conversation] Beef up overview
This commit is contained in:
Hannah Hunter 2025-01-15 10:28:08 -05:00 committed by GitHub
commit d0d425f54f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 7 deletions

View File

@ -10,18 +10,35 @@ description: "Overview of the conversation API building block"
The conversation API is currently in [alpha]({{< ref "certification-lifecycle.md#certification-levels" >}}).
{{% /alert %}}
Using the Dapr conversation API, you can reduce the complexity of interacting with Large Language Models (LLMs) and enable critical performance and security functionality with features like prompt caching and personally identifiable information (PII) data obfuscation.
<img src="/images/conversation-overview.png" width=800 alt="Diagram showing the flow of a user's app communicating with Dapr's LLM components.">
Dapr's conversation API reduces the complexity of securely and reliably interacting with Large Language Models (LLM) at scale. Whether you're a developer who doesn't have the necessary native SDKs or a polyglot shop who just wants to focus on the prompt aspects of LLM interactions, the conversation API provides one consistent API entry point to talk to underlying LLM providers.
In additon to enabling critical performance and security functionality (like [prompt caching]({{< ref "#prompt-caching" >}}) and [PII scrubbing]({{< ref "#personally-identifiable-information-pii-obfuscation" >}})), you can also pair the conversation API with Dapr functionalities, like:
- Resiliency circuit breakers and retries to circumvent limit and token errors, or
- Middleware to authenticate requests coming to and from the LLM
Dapr provides observability by issuing metrics for your LLM interactions.
## Features
The following features are out-of-the-box for [all the supported conversation components]({{< ref supported-conversation >}}).
### Prompt caching
To significantly reduce latency and cost, frequent prompts are stored in a cache to be reused, instead of reprocessing the information for every new request. Prompt caching optimizes performance by storing and reusing prompts that are often repeated across multiple API calls.
Prompt caching optimizes performance by storing and reusing prompts that are often repeated across multiple API calls. To significantly reduce latency and cost, Dapr stores frequent prompts in a local cache to be reused by your cluster, pod, or other, instead of reprocessing the information for every new request.
### Personally identifiable information (PII) obfuscation
The PII obfuscation feature identifies and removes any PII from a conversation response. This feature protects your privacy by eliminating sensitive details like names, addresses, phone numbers, or other details that could be used to identify an individual.
The PII obfuscation feature identifies and removes any form of sensitve user information from a conversation response. Simply enable PII obfuscation on input and output data to protect your privacy and scrub sensitive details that could be used to identify an individual.
## Demo
Watch the demo presented during [Diagrid's Dapr v1.15 celebration](https://www.diagrid.io/videos/dapr-1-15-deep-dive) to see how the conversation API works using the .NET SDK.
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/NTnwoDhHIcQ?si=37SDcOHtEpgCIwkG&amp;start=5444" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
## Try out conversation
@ -31,7 +48,7 @@ Want to put the Dapr conversation API to the test? Walk through the following qu
| Quickstart/tutorial | Description |
| ------------------- | ----------- |
| [Conversation quickstart](todo) | . |
| [Conversation quickstart](todo) | TODO |
### Start using the conversation API directly in your app

View File

@ -92,7 +92,7 @@ func main() {
}
input := dapr.ConversationInput{
Message: "hello world",
Message: "Please write a witty haiku about the Dapr distributed programming framework at dapr.io",
// Role: nil, // Optional
// ScrubPII: nil, // Optional
}
@ -134,7 +134,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = DaprClient::connect(address).await?;
let input = ConversationInputBuilder::new("hello world").build();
let input = ConversationInputBuilder::new("Please write a witty haiku about the Dapr distributed programming framework at dapr.io").build();
let conversation_component = "echo";
@ -179,7 +179,7 @@ dapr run --app-id conversation --dapr-grpc-port 50001 --log-level debug --resour
**Expected output**
```
- '== APP == conversation output: hello world'
- '== APP == conversation output: Please write a witty haiku about the Dapr distributed programming framework at dapr.io'
```
{{% /codetab %}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB