diff --git a/daprdocs/content/en/concepts/building-blocks-concept.md b/daprdocs/content/en/concepts/building-blocks-concept.md index a66ba848a24..2134ee55018 100644 --- a/daprdocs/content/en/concepts/building-blocks-concept.md +++ b/daprdocs/content/en/concepts/building-blocks-concept.md @@ -31,3 +31,4 @@ Dapr provides the following building blocks: | [**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. | [**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. | [**Jobs**]({{< ref "jobs-overview.md" >}}) | `/v1.0-alpha1/jobs` | The Jobs API enables you to schedule and orchestrate jobs. Example scenarios include: +| [**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. \ No newline at end of file diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index d7a4f92ab5b..27c64796968 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -122,11 +122,18 @@ Lock components are used as a distributed lock to provide mutually exclusive acc ### Cryptography -[Cryptography]({{< ref cryptography-overview.md >}}) components are used to perform crypographic operations, including encrypting and decrypting messages, without exposing keys to your application. +[Cryptography]({{< ref cryptography-overview.md >}}) components are used to perform cryptographic operations, including encrypting and decrypting messages, without exposing keys to your application. - [List of supported cryptography components]({{< ref supported-cryptography >}}) - [Cryptography implementations](https://github.com/dapr/components-contrib/tree/master/crypto) +### Conversation + +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. + +- [List of supported conversation components]({{< ref supported-conversation >}}) +- [Conversation implementations](https://github.com/dapr/components-contrib/tree/main/conversation) + ### Middleware 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 {{% alert title="Note" color="primary" %}} 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). -{{% /alert %}} +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/concepts/overview.md b/daprdocs/content/en/concepts/overview.md index ff0f7ad3114..7613042ff93 100644 --- a/daprdocs/content/en/concepts/overview.md +++ b/daprdocs/content/en/concepts/overview.md @@ -55,6 +55,7 @@ Each of these building block APIs is independent, meaning that you can use any n | [**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. | [**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. | [**Jobs**]({{< ref "jobs-overview.md" >}}) | The jobs API enables you to schedule jobs at specific times or intervals. +| [**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. ### Cross-cutting APIs diff --git a/daprdocs/content/en/developing-applications/building-blocks/conversation/_index.md b/daprdocs/content/en/developing-applications/building-blocks/conversation/_index.md new file mode 100644 index 00000000000..efd11575950 --- /dev/null +++ b/daprdocs/content/en/developing-applications/building-blocks/conversation/_index.md @@ -0,0 +1,7 @@ +--- +type: docs +title: "Conversation" +linkTitle: "Conversation" +weight: 130 +description: "Utilize prompts with Large Language Models (LLMs)" +--- \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md new file mode 100644 index 00000000000..f7621517e6e --- /dev/null +++ b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md @@ -0,0 +1,43 @@ +--- +type: docs +title: "Conversation overview" +linkTitle: "Overview" +weight: 1000 +description: "Overview of the conversation API building block" +--- + +{{% alert title="Alpha" color="primary" %}} +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. + +## Features + +### 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. + +### 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. + +## Try out conversation + +### Quickstarts and tutorials + +Want to put the Dapr conversation API to the test? Walk through the following quickstart and tutorials to see it in action: + +| Quickstart/tutorial | Description | +| ------------------- | ----------- | +| [Conversation quickstart](todo) | . | + +### Start using the conversation API directly in your app + +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 >}}). + +## Next steps + +- [How-To: Converse with an LLM using the conversation API]({{< ref howto-conversation-layer.md >}}) +- [Conversation API components]({{< ref supported-conversation >}}) \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/conversation/howto-conversation-layer.md b/daprdocs/content/en/developing-applications/building-blocks/conversation/howto-conversation-layer.md new file mode 100644 index 00000000000..3a6266f4d8c --- /dev/null +++ b/daprdocs/content/en/developing-applications/building-blocks/conversation/howto-conversation-layer.md @@ -0,0 +1,137 @@ +--- +type: docs +title: "How-To: Converse with an LLM using the conversation API" +linkTitle: "How-To: Converse" +weight: 2000 +description: "Learn how to abstract the complexities of interacting with large language models" +--- + +{{% alert title="Alpha" color="primary" %}} +The conversation API is currently in [alpha]({{< ref "certification-lifecycle.md#certification-levels" >}}). +{{% /alert %}} + +Let's get started using the [conversation API]({{< ref conversation-overview.md >}}). In this guide, you'll learn how to: + +- Set up one of the available Dapr components (echo) that work with the conversation API. +- Add the conversation client to your application. + +## Set up the conversation component + +Create a new configuration file called `conversation.yaml` and save to a components or config sub-folder in your application directory. + +Select your [preferred conversation component spec]({{< ref supported-conversation >}}) for your `conversation.yaml` file. + +For this scenario, we use a simple echo component. + +```yml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: echo +spec: + type: conversation.echo + version: v1 +``` + +## Connect the conversation client + + +{{< tabs ".NET" "Go" "Rust" >}} + + + +{{% codetab %}} + +```dotnet +todo +``` + +{{% /codetab %}} + + +{{% codetab %}} + +```go +package main + +import ( + "context" + "fmt" + dapr "github.com/dapr/go-sdk/client" + "log" +) + +func main() { + client, err := dapr.NewClient() + if err != nil { + panic(err) + } + + input := dapr.ConversationInput{ + Message: "hello world", + // Role: nil, // Optional + // ScrubPII: nil, // Optional + } + + fmt.Printf("conversation input: %s\n", input.Message) + + var conversationComponent = "echo" + + request := dapr.NewConversationRequest(conversationComponent, []dapr.ConversationInput{input}) + + resp, err := client.ConverseAlpha1(context.Background(), request) + if err != nil { + log.Fatalf("err: %v", err) + } + + fmt.Printf("conversation output: %s\n", resp.Outputs[0].Result) +} +``` + +{{% /codetab %}} + + +{{% codetab %}} + +```rust +use dapr::client::{ConversationInputBuilder, ConversationRequestBuilder}; +use std::thread; +use std::time::Duration; + +type DaprClient = dapr::Client; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Sleep to allow for the server to become available + thread::sleep(Duration::from_secs(5)); + + // Set the Dapr address + let address = "https://127.0.0.1".to_string(); + + let mut client = DaprClient::connect(address).await?; + + let input = ConversationInputBuilder::new("hello world").build(); + + let conversation_component = "echo"; + + let request = + ConversationRequestBuilder::new(conversation_component, vec![input.clone()]).build(); + + println!("conversation input: {:?}", input.message); + + let response = client.converse_alpha1(request).await?; + + println!("conversation output: {:?}", response.outputs[0].result); + Ok(()) +} +``` + +{{% /codetab %}} + +{{< /tabs >}} + + +## Next steps + +- [Conversation API reference guide]({{< ref conversation_api.md >}}) +- [Available conversation components]({{< ref supported-conversation >}}) \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md index a12478250a0..3345b97b2a8 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md @@ -6,10 +6,6 @@ weight: 5000 description: "Learn how to develop and author workflows" --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - This article provides a high-level overview of how to author workflows that are executed by the Dapr Workflow engine. {{% alert title="Note" color="primary" %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md index 8aeeab0b0ff..f03f4a4c471 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md @@ -6,10 +6,6 @@ weight: 6000 description: Manage and run workflows --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - 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 >}}). {{< tabs Python JavaScript ".NET" Java Go HTTP >}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md index 06269e0ad9a..186ea32643f 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md @@ -6,10 +6,6 @@ weight: 4000 description: "The Dapr Workflow engine architecture" --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - [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: - The architecture of the Dapr Workflow engine diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index b0392fa7818..7ee3b500dae 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -6,10 +6,6 @@ weight: 2000 description: "Learn more about the Dapr Workflow features and concepts" --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - Now that you've learned about the [workflow building block]({{< ref workflow-overview.md >}}) at a high level, let's deep dive into the features and concepts included with the Dapr Workflow engine and SDKs. Dapr Workflow exposes several core features and concepts which are common across all supported languages. {{% alert title="Note" color="primary" %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md index ed9f747b882..a4447fc652c 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md @@ -6,10 +6,6 @@ weight: 1000 description: "Overview of Dapr Workflow" --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations]({{< ref "#limitations" >}}). -{{% /alert %}} - Dapr workflow makes it easy for developers to write business logic and integrations in a reliable way. Since Dapr workflows are stateful, they support long-running and fault-tolerant applications, ideal for orchestrating microservices. Dapr workflow works seamlessly with other Dapr building blocks, such as service invocation, pub/sub, state management, and bindings. The durable, resilient Dapr Workflow capability: @@ -94,7 +90,7 @@ Want to put workflows to the test? Walk through the following quickstart and tut | Quickstart/tutorial | Description | | ------------------- | ----------- | | [Workflow quickstart]({{< ref workflow-quickstart.md >}}) | Run a workflow application with four workflow activities to see Dapr Workflow in action | -| [Workflow Python SDK example](https://github.com/dapr/python-sdk/tree/master/examples/demo_workflow) | Learn how to create a Dapr Workflow and invoke it using the Python `DaprClient` package. | +| [Workflow Python SDK example](https://github.com/dapr/python-sdk/tree/master/examples/demo_workflow) | Learn how to create a Dapr Workflow and invoke it using the Python `dapr-ext-workflow` package. | | [Workflow JavaScript SDK example](https://github.com/dapr/js-sdk/tree/main/examples/workflow) | Learn how to create a Dapr Workflow and invoke it using the JavaScript SDK. | | [Workflow .NET SDK example](https://github.com/dapr/dotnet-sdk/tree/master/examples/Workflow) | Learn how to create a Dapr Workflow and invoke it using ASP.NET Core web APIs. | | [Workflow Java SDK example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows) | Learn how to create a Dapr Workflow and invoke it using the Java `io.dapr.workflows` package. | @@ -107,24 +103,6 @@ Want to skip the quickstarts? Not a problem. You can try out the workflow buildi ## Limitations - **State stores:** Due to underlying limitations in some database choices, more commonly NoSQL databases, you might run into limitations around storing internal states. For example, CosmosDB has a maximum single operation item limit of only 100 states in a single request. -- **Horizontal scaling:** As of the 1.12.0 beta release of Dapr Workflow, it is recommended to use a maximum of two instances of Dapr per workflow application. This limitation is resolved in Dapr 1.14.x when enabling the scheduler service. - -To enable the scheduler service to work for Dapr Workflows, make sure you're using Dapr 1.14.x or later and assign the following configuration to your app: - -```yaml -apiVersion: dapr.io/v1alpha1 -kind: Configuration -metadata: - name: schedulerconfig -spec: - tracing: - samplingRate: "1" - features: - - name: SchedulerReminders - enabled: true -``` - -See more info about [enabling preview features]({{}}). ## Watch the demo diff --git a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md index 0c2c92b36a6..3cf04fac94e 100644 --- a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md @@ -6,10 +6,6 @@ weight: 73 description: Get started with the Dapr Workflow building block --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - {{% alert title="Note" color="primary" %}} Redis is currently used as the state store component for Workflows in the Quickstarts. However, Redis does not support transaction rollbacks and should not be used in production as an actor state store. {{% /alert %}} diff --git a/daprdocs/content/en/operations/support/alpha-beta-apis.md b/daprdocs/content/en/operations/support/alpha-beta-apis.md index 66d9470ff80..7516bfc47d5 100644 --- a/daprdocs/content/en/operations/support/alpha-beta-apis.md +++ b/daprdocs/content/en/operations/support/alpha-beta-apis.md @@ -15,13 +15,13 @@ description: "List of current alpha and beta APIs" | Bulk Publish | [Bulk publish proto](https://github.com/dapr/dapr/blob/5aba3c9aa4ea9b3f388df125f9c66495b43c5c9e/dapr/proto/runtime/v1/dapr.proto#L59) | `v1.0-alpha1/publish/bulk` | The bulk publish API allows you to publish multiple messages to a topic in a single request. | [Bulk Publish and Subscribe API]({{< ref "pubsub-bulk.md" >}}) | v1.10 | | Bulk Subscribe | [Bulk subscribe proto](https://github.com/dapr/dapr/blob/5aba3c9aa4ea9b3f388df125f9c66495b43c5c9e/dapr/proto/runtime/v1/appcallback.proto#L57) | N/A | The bulk subscribe application callback receives multiple messages from a topic in a single call. | [Bulk Publish and Subscribe API]({{< ref "pubsub-bulk.md" >}}) | v1.10 | | Cryptography | [Crypto proto](https://github.com/dapr/dapr/blob/5aba3c9aa4ea9b3f388df125f9c66495b43c5c9e/dapr/proto/runtime/v1/dapr.proto#L118) | `v1.0-alpha1/crypto` | The cryptography API enables you to perform **high level** cryptography operations for encrypting and decrypting messages. | [Cryptography API]({{< ref "cryptography-overview.md" >}}) | v1.11 | -| Jobs | [Jobs proto](https://github.com/dapr/dapr/blob/master/dapr/proto/runtime/v1/dapr.proto#L198-L204) | `v1.0-alpha1/jobs` | The jobs API enables you to schedule and orchestrate jobs. | [Jobs API]({{< ref "jobs-overview.md" >}}) | v1.14 | +| Jobs | [Jobs proto](https://github.com/dapr/dapr/blob/master/dapr/proto/runtime/v1/dapr.proto#L212-219) | `v1.0-alpha1/jobs` | The jobs API enables you to schedule and orchestrate jobs. | [Jobs API]({{< ref "jobs-overview.md" >}}) | v1.14 | +| Conversation | [Conversation proto](https://github.com/dapr/dapr/blob/master/dapr/proto/runtime/v1/dapr.proto#L221-222) | `v1.0-alpha1/conversation` | Converse between different large language models using the conversation API. | [Conversation API]({{< ref "conversation-overview.md" >}}) | v1.15 | + ## Beta APIs -| Building block/API | gRPC | HTTP | Description | Documentation | Version introduced | -| ------------------ | ---- | ---- | ----------- | ------------- | ------------------ | -| Workflow | [Workflow proto](https://github.com/dapr/dapr/blob/5aba3c9aa4ea9b3f388df125f9c66495b43c5c9e/dapr/proto/runtime/v1/dapr.proto#L151) | `/v1.0-beta1/workflow` | The workflow API enables you to define long running, persistent processes or data flows. | [Workflow API]({{< ref "workflow-overview.md" >}}) | v1.10 | +No current beta APIs. ## Related links diff --git a/daprdocs/content/en/reference/api/conversation_api.md b/daprdocs/content/en/reference/api/conversation_api.md new file mode 100644 index 00000000000..366625006de --- /dev/null +++ b/daprdocs/content/en/reference/api/conversation_api.md @@ -0,0 +1,74 @@ +--- +type: docs +title: "Conversation API reference" +linkTitle: "Conversation API" +description: "Detailed documentation on the conversation API" +weight: 1400 +--- + +{{% alert title="Alpha" color="primary" %}} +The conversation API is currently in [alpha]({{< ref "certification-lifecycle.md#certification-levels" >}}). +{{% /alert %}} + +Dapr provides an API to interact with Large Language Models (LLMs) and enables critical performance and security functionality with features like prompt caching and PII data obfuscation. + +## Converse + +This endpoint lets you converse with LLMs. + +``` +POST /v1.0-alpha1/conversation//converse +``` + +### URL parameters + +| Parameter | Description | +| --------- | ----------- | +| `llm-name` | The name of the LLM component. [See a list of all available conversation components.]({{< ref supported-conversation >}}) + +### Request body + +| Field | Description | +| --------- | ----------- | +| `conversationContext` | | +| `inputs` | | +| `parameters` | | + + +### Request content + +```json +REQUEST = { + "inputs": ["what is Dapr", "Why use Dapr"], + "parameters": {}, +} +``` + +### HTTP response codes + +Code | Description +---- | ----------- +`202` | Accepted +`400` | Request was malformed +`500` | Request formatted correctly, error in dapr code or underlying component + +### Response content + +```json +RESPONSE = { + "outputs": { + { + "result": "Dapr is distribution application runtime ...", + "parameters": {}, + }, + { + "result": "Dapr can help developers ...", + "parameters": {}, + } + }, +} +``` + +## Next steps + +[Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/content/en/reference/api/workflow_api.md b/daprdocs/content/en/reference/api/workflow_api.md index 9236fbfce08..c9dddaa618e 100644 --- a/daprdocs/content/en/reference/api/workflow_api.md +++ b/daprdocs/content/en/reference/api/workflow_api.md @@ -6,10 +6,6 @@ description: "Detailed documentation on the workflow API" weight: 300 --- -{{% alert title="Note" color="primary" %}} -Dapr Workflow is currently in beta. [See known limitations for {{% dapr-latest-version cli="true" %}}]({{< ref "workflow-overview.md#limitations" >}}). -{{% /alert %}} - Dapr provides users with the ability to interact with workflows and comes with a built-in `dapr` component. ## Start workflow request diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/_index.md b/daprdocs/content/en/reference/components-reference/supported-conversation/_index.md new file mode 100644 index 00000000000..179162b3bb2 --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/_index.md @@ -0,0 +1,12 @@ +--- +type: docs +title: "Conversation component specs" +linkTitle: "Conversation" +weight: 9000 +description: The supported conversation components that interface with Dapr +no_list: true +--- + +{{< partial "components/description.html" >}} + +{{< partial "components/conversation.html" >}} \ No newline at end of file diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/anthropic.md b/daprdocs/content/en/reference/components-reference/supported-conversation/anthropic.md new file mode 100644 index 00000000000..334b7cb9966 --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/anthropic.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "Anthropic" +linkTitle: "Anthropic" +description: Detailed information on the Anthropic conversation component +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: anthropic +spec: + type: conversation.anthropic + metadata: + - name: key + value: "mykey" + - name: model + value: claude-3-5-sonnet-20240620 + - name: cacheTTL + value: 10m +``` + +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| `key` | Y | API key for Anthropic. | `"mykey"` | +| `model` | N | The Anthropic LLM to use. Defaults to `claude-3-5-sonnet-20240620` | `claude-3-5-sonnet-20240620` | +| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/aws-bedrock.md b/daprdocs/content/en/reference/components-reference/supported-conversation/aws-bedrock.md new file mode 100644 index 00000000000..759e370134d --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/aws-bedrock.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "AWS Bedrock" +linkTitle: "AWS Bedrock" +description: Detailed information on the AWS Bedrock conversation component +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: awsbedrock +spec: + type: conversation.aws.bedrock + metadata: + - name: endpoint + value: "http://localhost:4566" + - name: model + value: amazon.titan-text-express-v1 + - name: cacheTTL + value: 10m +``` + +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| `endpoint` | N | AWS endpoint for the component to use and connect to emulators. Not recommended for production AWS use. | `http://localhost:4566` | +| `model` | N | The LLM to use. Defaults to Bedrock's default provider model from Amazon. | `amazon.titan-text-express-v1` | +| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/hugging-face.md b/daprdocs/content/en/reference/components-reference/supported-conversation/hugging-face.md new file mode 100644 index 00000000000..6429c84e87d --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/hugging-face.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "Huggingface" +linkTitle: "Huggingface" +description: Detailed information on the Huggingface conversation component +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: huggingface +spec: + type: conversation.huggingface + metadata: + - name: key + value: mykey + - name: model + value: meta-llama/Meta-Llama-3-8B + - name: cacheTTL + value: 10m +``` + +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| `key` | Y | API key for Huggingface. | `mykey` | +| `model` | N | The Huggingface LLM to use. Defaults to `meta-llama/Meta-Llama-3-8B`. | `meta-llama/Meta-Llama-3-8B` | +| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/mistral.md b/daprdocs/content/en/reference/components-reference/supported-conversation/mistral.md new file mode 100644 index 00000000000..57504e56b3f --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/mistral.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "Mistral" +linkTitle: "Mistral" +description: Detailed information on the Mistral conversation component +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: mistral +spec: + type: conversation.mistral + metadata: + - name: key + value: mykey + - name: model + value: open-mistral-7b + - name: cacheTTL + value: 10m +``` + +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| `key` | Y | API key for Mistral. | `mykey` | +| `model` | N | The Mistral LLM to use. Defaults to `open-mistral-7b`. | `open-mistral-7b` | +| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md b/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md new file mode 100644 index 00000000000..7148685b1bb --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-conversation/openai.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "OpenAI" +linkTitle: "OpenAI" +description: Detailed information on the OpenAI conversation component +--- + +## Component format + +A Dapr `conversation.yaml` component file has the following structure: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: openai +spec: + type: conversation.openai + metadata: + - name: key + value: mykey + - name: model + value: gpt-4-turbo + - name: cacheTTL + value: 10m +``` + +{{% alert title="Warning" color="warning" %}} +The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described [here]({{< ref component-secrets.md >}}). +{{% /alert %}} + +## Spec metadata fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| `key` | Y | API key for OpenAI. | `mykey` | +| `model` | N | The OpenAI LLM to use. Defaults to `gpt-4-turbo`. | `gpt-4-turbo` | +| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` | + +## Related links + +- [Conversation API overview]({{< ref conversation-overview.md >}}) \ No newline at end of file diff --git a/daprdocs/data/components/conversation/aws.yaml b/daprdocs/data/components/conversation/aws.yaml new file mode 100644 index 00000000000..6f5b33d2022 --- /dev/null +++ b/daprdocs/data/components/conversation/aws.yaml @@ -0,0 +1,5 @@ +- component: AWS Bedrock + link: aws-bedrock + state: Alpha + version: v1 + since: "1.15" \ No newline at end of file diff --git a/daprdocs/data/components/conversation/generic.yaml b/daprdocs/data/components/conversation/generic.yaml new file mode 100644 index 00000000000..26cf8431ce3 --- /dev/null +++ b/daprdocs/data/components/conversation/generic.yaml @@ -0,0 +1,20 @@ +- component: Anthropic + link: anthropic + state: Alpha + version: v1 + since: "1.15" +- component: Huggingface + link: hugging-face + state: Alpha + version: v1 + since: "1.15" +- component: Mistral + link: mistral + state: Alpha + version: v1 + since: "1.15" +- component: OpenAI + link: openai + state: Alpha + version: v1 + since: "1.15" diff --git a/daprdocs/layouts/partials/components/conversation.html b/daprdocs/layouts/partials/components/conversation.html new file mode 100644 index 00000000000..2662170734e --- /dev/null +++ b/daprdocs/layouts/partials/components/conversation.html @@ -0,0 +1,28 @@ +{{- $groups := dict + "Generic" $.Site.Data.components.conversation.generic + "Amazon Web Services (AWS)" $.Site.Data.components.conversation.aws + + }} + + {{ range $group, $components := $groups }} +

{{ $group }}

+ + + + + + + + {{ range sort $components "component" }} + + + + + + + {{ end }} +
ComponentStatusComponent versionSince runtime version
{{ .component }} + {{ .state }}{{ .version }}{{ .since }}
+ {{ end }} + + {{ partial "components/componenttoc.html" . }} \ No newline at end of file diff --git a/daprdocs/static/images/building_blocks.png b/daprdocs/static/images/building_blocks.png index 3a9b5517e85..6e5c51b699f 100644 Binary files a/daprdocs/static/images/building_blocks.png and b/daprdocs/static/images/building_blocks.png differ diff --git a/daprdocs/static/images/buildingblocks-overview.png b/daprdocs/static/images/buildingblocks-overview.png index 9b05f41bea2..9570df61213 100644 Binary files a/daprdocs/static/images/buildingblocks-overview.png and b/daprdocs/static/images/buildingblocks-overview.png differ diff --git a/daprdocs/static/images/concepts-components.png b/daprdocs/static/images/concepts-components.png index f7859df715e..c22c50f2355 100644 Binary files a/daprdocs/static/images/concepts-components.png and b/daprdocs/static/images/concepts-components.png differ diff --git a/daprdocs/static/images/overview.png b/daprdocs/static/images/overview.png index a56714e3bc2..f62c8208553 100644 Binary files a/daprdocs/static/images/overview.png and b/daprdocs/static/images/overview.png differ