Skip to content

Commit c443e9b

Browse files
authored
Merge branch 'v1.15' into issue_4375-2
2 parents cd8a624 + 87c854e commit c443e9b

File tree

40 files changed

+821
-132
lines changed

40 files changed

+821
-132
lines changed

.github/workflows/link_validation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
validate:
1414
runs-on: ubuntu-latest
1515
env:
16-
PYTHON_VER: 3.7
16+
PYTHON_VER: 3.12
1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Check Microsoft URLs do not pin localized versions
@@ -27,7 +27,7 @@ jobs:
2727
exit 1
2828
fi
2929
- name: Set up Python ${{ env.PYTHON_VER }}
30-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: ${{ env.PYTHON_VER }}
3333
- name: Install dependencies

daprdocs/content/en/concepts/building-blocks-concept.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ Dapr provides the following building blocks:
3131
| [**Distributed lock**]({{< ref "distributed-lock-api-overview.md" >}}) | `/v1.0-alpha1/lock` | The distributed lock API enables you to take a lock on a resource so that multiple instances of an application can access the resource without conflicts and provide consistency guarantees.
3232
| [**Cryptography**]({{< ref "cryptography-overview.md" >}}) | `/v1.0-alpha1/crypto` | The Cryptography API enables you to perform cryptographic operations, such as encrypting and decrypting messages, without exposing keys to your application.
3333
| [**Jobs**]({{< ref "jobs-overview.md" >}}) | `/v1.0-alpha1/jobs` | The Jobs API enables you to schedule and orchestrate jobs. Example scenarios include: <ul><li>Schedule batch processing jobs to run every business day</li><li>Schedule various maintenance scripts to perform clean-ups</li><li>Schedule ETL jobs to run at specific times (hourly, daily) to fetch new data, process it, and update the data warehouse with the latest information.</li></ul>
34+
| [**Conversation**]({{< ref "conversation-overview.md" >}}) | `/v1.0-alpha1/conversation` | The Conversation API enables you to supply prompts to converse with different large language models (LLMs) and includes features such as prompt caching and personally identifiable information (PII) obfuscation.

daprdocs/content/en/concepts/components-concept.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,18 @@ Lock components are used as a distributed lock to provide mutually exclusive acc
122122

123123
### Cryptography
124124

125-
[Cryptography]({{< ref cryptography-overview.md >}}) components are used to perform crypographic operations, including encrypting and decrypting messages, without exposing keys to your application.
125+
[Cryptography]({{< ref cryptography-overview.md >}}) components are used to perform cryptographic operations, including encrypting and decrypting messages, without exposing keys to your application.
126126

127127
- [List of supported cryptography components]({{< ref supported-cryptography >}})
128128
- [Cryptography implementations](https://github.com/dapr/components-contrib/tree/master/crypto)
129129

130+
### Conversation
131+
132+
Dapr provides developers a way to abstract interactions with large language models (LLMs) with built-in security and reliability features. Use [conversation]({{< ref conversation-overview.md >}}) components to send prompts to different LLMs, along with the conversation context.
133+
134+
- [List of supported conversation components]({{< ref supported-conversation >}})
135+
- [Conversation implementations](https://github.com/dapr/components-contrib/tree/main/conversation)
136+
130137
### Middleware
131138

132139
Dapr allows custom [middleware]({{< ref "middleware.md" >}}) to be plugged into the HTTP request processing pipeline. Middleware can perform additional actions on an HTTP request (such as authentication, encryption, and message transformation) before the request is routed to the user code, or the response is returned to the client. The middleware components are used with the [service invocation]({{< ref "service-invocation-overview.md" >}}) building block.
@@ -136,4 +143,4 @@ Dapr allows custom [middleware]({{< ref "middleware.md" >}}) to be plugged into
136143

137144
{{% alert title="Note" color="primary" %}}
138145
Since pluggable components are not required to be written in Go, they follow a different implementation process than built-in Dapr components. For more information on developing built-in components, read [developing new components](https://github.com/dapr/components-contrib/blob/master/docs/developing-component.md).
139-
{{% /alert %}}
146+
{{% /alert %}}

daprdocs/content/en/concepts/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Each of these building block APIs is independent, meaning that you can use any n
5555
| [**Distributed lock**]({{< ref "distributed-lock-api-overview.md" >}}) | The distributed lock API enables your application to acquire a lock for any resource that gives it exclusive access until either the lock is released by the application, or a lease timeout occurs.
5656
| [**Cryptography**]({{< ref "cryptography-overview.md" >}}) | The cryptography API provides an abstraction layer on top of security infrastructure such as key vaults. It contains APIs that allow you to perform cryptographic operations, such as encrypting and decrypting messages, without exposing keys to your applications.
5757
| [**Jobs**]({{< ref "jobs-overview.md" >}}) | The jobs API enables you to schedule jobs at specific times or intervals.
58+
| [**Conversation**]({{< ref "conversation-overview.md" >}}) | The conversation API enables you to abstract the complexities of interacting with large language models (LLMs) and includes features such as prompt caching and personally identifiable information (PII) obfuscation. Using [conversation components]({{< ref supported-conversation >}}), you can supply prompts to converse with different LLMs.
5859

5960
### Cross-cutting APIs
6061

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
type: docs
3+
title: "Conversation"
4+
linkTitle: "Conversation"
5+
weight: 130
6+
description: "Utilize prompts with Large Language Models (LLMs)"
7+
---
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
type: docs
3+
title: "Conversation overview"
4+
linkTitle: "Overview"
5+
weight: 1000
6+
description: "Overview of the conversation API building block"
7+
---
8+
9+
{{% alert title="Alpha" color="primary" %}}
10+
The conversation API is currently in [alpha]({{< ref "certification-lifecycle.md#certification-levels" >}}).
11+
{{% /alert %}}
12+
13+
14+
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.
15+
16+
## Features
17+
18+
### Prompt caching
19+
20+
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.
21+
22+
### Personally identifiable information (PII) obfuscation
23+
24+
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.
25+
26+
## Try out conversation
27+
28+
### Quickstarts and tutorials
29+
30+
Want to put the Dapr conversation API to the test? Walk through the following quickstart and tutorials to see it in action:
31+
32+
| Quickstart/tutorial | Description |
33+
| ------------------- | ----------- |
34+
| [Conversation quickstart](todo) | . |
35+
36+
### Start using the conversation API directly in your app
37+
38+
Want to skip the quickstarts? Not a problem. You can try out the conversation building block directly in your application. After [Dapr is installed]({{< ref "getting-started/_index.md" >}}), you can begin using the conversation API starting with [the how-to guide]({{< ref howto-conversation-layer.md >}}).
39+
40+
## Next steps
41+
42+
- [How-To: Converse with an LLM using the conversation API]({{< ref howto-conversation-layer.md >}})
43+
- [Conversation API components]({{< ref supported-conversation >}})
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
type: docs
3+
title: "How-To: Converse with an LLM using the conversation API"
4+
linkTitle: "How-To: Converse"
5+
weight: 2000
6+
description: "Learn how to abstract the complexities of interacting with large language models"
7+
---
8+
9+
{{% alert title="Alpha" color="primary" %}}
10+
The conversation API is currently in [alpha]({{< ref "certification-lifecycle.md#certification-levels" >}}).
11+
{{% /alert %}}
12+
13+
Let's get started using the [conversation API]({{< ref conversation-overview.md >}}). In this guide, you'll learn how to:
14+
15+
- Set up one of the available Dapr components (echo) that work with the conversation API.
16+
- Add the conversation client to your application.
17+
18+
## Set up the conversation component
19+
20+
Create a new configuration file called `conversation.yaml` and save to a components or config sub-folder in your application directory.
21+
22+
Select your [preferred conversation component spec]({{< ref supported-conversation >}}) for your `conversation.yaml` file.
23+
24+
For this scenario, we use a simple echo component.
25+
26+
```yml
27+
apiVersion: dapr.io/v1alpha1
28+
kind: Component
29+
metadata:
30+
name: echo
31+
spec:
32+
type: conversation.echo
33+
version: v1
34+
```
35+
36+
## Connect the conversation client
37+
38+
39+
{{< tabs ".NET" "Go" "Rust" >}}
40+
41+
42+
<!-- .NET -->
43+
{{% codetab %}}
44+
45+
```dotnet
46+
todo
47+
```
48+
49+
{{% /codetab %}}
50+
51+
<!-- Go -->
52+
{{% codetab %}}
53+
54+
```go
55+
package main
56+
57+
import (
58+
"context"
59+
"fmt"
60+
dapr "github.com/dapr/go-sdk/client"
61+
"log"
62+
)
63+
64+
func main() {
65+
client, err := dapr.NewClient()
66+
if err != nil {
67+
panic(err)
68+
}
69+
70+
input := dapr.ConversationInput{
71+
Message: "hello world",
72+
// Role: nil, // Optional
73+
// ScrubPII: nil, // Optional
74+
}
75+
76+
fmt.Printf("conversation input: %s\n", input.Message)
77+
78+
var conversationComponent = "echo"
79+
80+
request := dapr.NewConversationRequest(conversationComponent, []dapr.ConversationInput{input})
81+
82+
resp, err := client.ConverseAlpha1(context.Background(), request)
83+
if err != nil {
84+
log.Fatalf("err: %v", err)
85+
}
86+
87+
fmt.Printf("conversation output: %s\n", resp.Outputs[0].Result)
88+
}
89+
```
90+
91+
{{% /codetab %}}
92+
93+
<!-- Rust -->
94+
{{% codetab %}}
95+
96+
```rust
97+
use dapr::client::{ConversationInputBuilder, ConversationRequestBuilder};
98+
use std::thread;
99+
use std::time::Duration;
100+
101+
type DaprClient = dapr::Client<dapr::client::TonicClient>;
102+
103+
#[tokio::main]
104+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
105+
// Sleep to allow for the server to become available
106+
thread::sleep(Duration::from_secs(5));
107+
108+
// Set the Dapr address
109+
let address = "https://127.0.0.1".to_string();
110+
111+
let mut client = DaprClient::connect(address).await?;
112+
113+
let input = ConversationInputBuilder::new("hello world").build();
114+
115+
let conversation_component = "echo";
116+
117+
let request =
118+
ConversationRequestBuilder::new(conversation_component, vec![input.clone()]).build();
119+
120+
println!("conversation input: {:?}", input.message);
121+
122+
let response = client.converse_alpha1(request).await?;
123+
124+
println!("conversation output: {:?}", response.outputs[0].result);
125+
Ok(())
126+
}
127+
```
128+
129+
{{% /codetab %}}
130+
131+
{{< /tabs >}}
132+
133+
134+
## Next steps
135+
136+
- [Conversation API reference guide]({{< ref conversation_api.md >}})
137+
- [Available conversation components]({{< ref supported-conversation >}})

daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ weight: 5000
66
description: "Learn how to develop and author workflows"
77
---
88

9-
{{% alert title="Note" color="primary" %}}
10-
Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}).
11-
{{% /alert %}}
12-
139
This article provides a high-level overview of how to author workflows that are executed by the Dapr Workflow engine.
1410

1511
{{% alert title="Note" color="primary" %}}

daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ weight: 6000
66
description: Manage and run workflows
77
---
88

9-
{{% alert title="Note" color="primary" %}}
10-
Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}).
11-
{{% /alert %}}
12-
139
Now that you've [authored the workflow and its activities in your application]({{< ref howto-author-workflow.md >}}), you can start, terminate, and get information about the workflow using HTTP API calls. For more information, read the [workflow API reference]({{< ref workflow_api.md >}}).
1410

1511
{{< tabs Python JavaScript ".NET" Java Go HTTP >}}

daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ weight: 4000
66
description: "The Dapr Workflow engine architecture"
77
---
88

9-
{{% alert title="Note" color="primary" %}}
10-
Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}).
11-
{{% /alert %}}
12-
139
[Dapr Workflows]({{< ref "workflow-overview.md" >}}) allow developers to define workflows using ordinary code in a variety of programming languages. The workflow engine runs inside of the Dapr sidecar and orchestrates workflow code deployed as part of your application. This article describes:
1410

1511
- The architecture of the Dapr Workflow engine

0 commit comments

Comments
 (0)