mirror of https://github.com/dapr/docs.git
Merge branch 'v1.15' into endgame_1.15-updates
This commit is contained in:
commit
61f4b60a11
|
@ -81,6 +81,14 @@ In production environments, it's recommended to perform periodic backups of this
|
|||
|
||||
To perform backup and restore operations, you'll need to access the embedded etcd instance. This requires port forwarding to expose the etcd ports (port 2379).
|
||||
|
||||
#### Kubernetes Example
|
||||
|
||||
Here's how to port forward and connect to the etcd instance:
|
||||
|
||||
```shell
|
||||
kubectl port-forward svc/dapr-scheduler-server 2379:2379 -n dapr-system
|
||||
```
|
||||
|
||||
#### Docker Compose Example
|
||||
|
||||
Here's how to expose the etcd ports in a Docker Compose configuration for standalone mode:
|
||||
|
@ -111,6 +119,16 @@ When running in HA mode, you only need to expose the ports for one scheduler ins
|
|||
|
||||
Once you have access to the etcd ports, you can follow the [official etcd backup and restore documentation](https://etcd.io/docs/v3.5/op-guide/recovery/) to perform backup and restore operations. The process involves using standard etcd commands to create snapshots and restore from them.
|
||||
|
||||
## Monitoring Scheduler's etcd Metrics
|
||||
|
||||
Port forward the Scheduler instance and view etcd's metrics with the following:
|
||||
|
||||
```shell
|
||||
curl -s http://localhost:2379/metrics
|
||||
```
|
||||
|
||||
Fine tune the embedded etcd to your needs by [reviewing and configuring the Scheduler's etcd flags as needed](https://github.com/dapr/dapr/blob/master/charts/dapr/README.md#dapr-scheduler-options).
|
||||
|
||||
## Disabling the Scheduler service
|
||||
|
||||
If you are not using any features that require the Scheduler service (Jobs API, Actor Reminders, or Workflows), you can disable it by setting `global.scheduler.enabled=false`.
|
||||
|
|
|
@ -52,8 +52,6 @@ spec:
|
|||
value: <REPLACE_WITH_YOUR_KEY>
|
||||
- name: model
|
||||
value: gpt-4-turbo
|
||||
- name: cacheTTL
|
||||
value: 10m
|
||||
```
|
||||
|
||||
## Connect the conversation client
|
||||
|
@ -114,12 +112,12 @@ func main() {
|
|||
}
|
||||
|
||||
input := dapr.ConversationInput{
|
||||
Message: "Please write a witty haiku about the Dapr distributed programming framework at dapr.io",
|
||||
// Role: nil, // Optional
|
||||
// ScrubPII: nil, // Optional
|
||||
Content: "Please write a witty haiku about the Dapr distributed programming framework at dapr.io",
|
||||
// Role: "", // Optional
|
||||
// ScrubPII: false, // Optional
|
||||
}
|
||||
|
||||
fmt.Printf("conversation input: %s\n", input.Message)
|
||||
fmt.Printf("conversation input: %s\n", input.Content)
|
||||
|
||||
var conversationComponent = "echo"
|
||||
|
||||
|
@ -163,7 +161,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let request =
|
||||
ConversationRequestBuilder::new(conversation_component, vec![input.clone()]).build();
|
||||
|
||||
println!("conversation input: {:?}", input.message);
|
||||
println!("conversation input: {:?}", input.content);
|
||||
|
||||
let response = client.converse_alpha1(request).await?;
|
||||
|
||||
|
@ -224,6 +222,16 @@ dapr run --app-id=conversation --resources-path ./config --dapr-grpc-port 3500 -
|
|||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Advanced features
|
||||
|
||||
The conversation API supports the following features:
|
||||
|
||||
1. **Prompt caching:** Allows developers to cache prompts in Dapr, leading to much faster response times and reducing costs on egress and on inserting the prompt into the LLM provider's cache.
|
||||
|
||||
1. **PII scrubbing:** Allows for the obfuscation of data going in and out of the LLM.
|
||||
|
||||
To learn how to enable these features, see the [conversation API reference guide]({{< ref conversation_api.md >}}).
|
||||
|
||||
## Related links
|
||||
|
||||
Try out the conversation API using the full examples provided in the supported SDK repos.
|
||||
|
|
|
@ -149,7 +149,7 @@ services:
|
|||
- type: tmpfs
|
||||
target: /data
|
||||
tmpfs:
|
||||
size: "10000"
|
||||
size: "64m"
|
||||
|
||||
networks:
|
||||
hello-dapr: null
|
||||
|
|
|
@ -231,6 +231,8 @@ kubectl rollout restart -n <DAPR_NAMESPACE> deployment/dapr-sentry
|
|||
```bash
|
||||
kubectl rollout restart deploy/dapr-operator -n <DAPR_NAMESPACE>
|
||||
kubectl rollout restart statefulsets/dapr-placement-server -n <DAPR_NAMESPACE>
|
||||
kubectl rollout restart deploy/dapr-sidecar-injector -n <DAPR_NAMESPACE>
|
||||
kubectl rollout restart deploy/dapr-scheduler-server -n <DAPR_NAMESPACE>
|
||||
```
|
||||
|
||||
4. Restart your Dapr applications to pick up the latest trust bundle.
|
||||
|
@ -332,12 +334,13 @@ Example:
|
|||
dapr status -k
|
||||
|
||||
NAME NAMESPACE HEALTHY STATUS REPLICAS VERSION AGE CREATED
|
||||
dapr-sentry dapr-system True Running 1 1.7.0 17d 2022-03-15 09:29.45
|
||||
dapr-dashboard dapr-system True Running 1 0.9.0 17d 2022-03-15 09:29.45
|
||||
dapr-sidecar-injector dapr-system True Running 1 1.7.0 17d 2022-03-15 09:29.45
|
||||
dapr-operator dapr-system True Running 1 1.7.0 17d 2022-03-15 09:29.45
|
||||
dapr-placement-server dapr-system True Running 1 1.7.0 17d 2022-03-15 09:29.45
|
||||
⚠ Dapr root certificate of your Kubernetes cluster expires in 2 days. Expiry date: Mon, 04 Apr 2022 15:01:03 UTC.
|
||||
dapr-operator dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26
|
||||
dapr-placement-server dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.27
|
||||
dapr-dashboard dapr-system True Running 1 0.15.0 4m 2025-02-19 17:36.27
|
||||
dapr-sentry dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26
|
||||
dapr-scheduler-server dapr-system True Running 3 1.15.0 4m 2025-02-19 17:36.27
|
||||
dapr-sidecar-injector dapr-system True Running 1 1.15.0 4m 2025-02-19 17:36.26
|
||||
⚠ Dapr root certificate of your Kubernetes cluster expires in 2 days. Expiry date: Mon, 04 Apr 2025 15:01:03 UTC.
|
||||
Please see docs.dapr.io for certificate renewal instructions to avoid service interruptions.
|
||||
```
|
||||
|
||||
|
|
|
@ -30,40 +30,34 @@ POST http://localhost:<daprPort>/v1.0-alpha1/conversation/<llm-name>/converse
|
|||
|
||||
| Field | Description |
|
||||
| --------- | ----------- |
|
||||
| `conversationContext` | The ID of an existing chat room (like in ChatGPT). |
|
||||
| `inputs` | Inputs for the conversation. Multiple inputs at one time are supported. |
|
||||
| `metadata` | [Metadata](#metadata) passed to conversation components. |
|
||||
| `inputs` | Inputs for the conversation. Multiple inputs at one time are supported. Required |
|
||||
| `cacheTTL` | A time-to-live value for a prompt cache to expire. Uses Golang duration format. Optional |
|
||||
| `scrubPII` | A boolean value to enable obfuscation of sensitive information returning from the LLM. Optional |
|
||||
| `temperature` | A float value to control the temperature of the model. Used to optimize for consistency and creativity. Optional |
|
||||
| `metadata` | [Metadata](#metadata) passed to conversation components. Optional |
|
||||
|
||||
#### Metadata
|
||||
#### Input body
|
||||
|
||||
Metadata can be sent in the request’s URL. It must be prefixed with `metadata.`, as shown in the table below.
|
||||
|
||||
| Parameter | Description |
|
||||
| Field | Description |
|
||||
| --------- | ----------- |
|
||||
| `metadata.key` | The API key for the component. `key` is not applicable to the [AWS Bedrock component]({{< ref "aws-bedrock.md#authenticating-aws" >}}). |
|
||||
| `metadata.model` | The Large Language Model you're using. Value depends on which conversation component you're using. `model` is not applicable to the [DeepSeek component]({{< ref deepseek.md >}}). |
|
||||
| `metadata.cacheTTL` | A time-to-live value for a prompt cache to expire. Uses Golang duration format. |
|
||||
| `content` | The message content to send to the LLM. Required |
|
||||
| `role` | The role for the LLM to assume. Possible values: 'user', 'tool', 'assistant' |
|
||||
| `scrubPII` | A boolean value to enable obfuscation of sensitive information present in the content field. Optional |
|
||||
|
||||
For example, to call for [Anthropic]({{< ref anthropic.md >}}):
|
||||
|
||||
```bash
|
||||
curl POST http://localhost:3500/v1.0-alpha1/conversation/anthropic/converse?metadata.key=key1&metadata.model=claude-3-5-sonnet-20240620&metadata.cacheTTL=10m
|
||||
```
|
||||
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
The metadata parameters available depend on the conversation component you use. [See all the supported components for the conversation API.]({{< ref supported-conversation >}})
|
||||
{{% /alert %}}
|
||||
|
||||
### Request content
|
||||
### Request content example
|
||||
|
||||
```json
|
||||
REQUEST = {
|
||||
"inputs": ["what is Dapr", "Why use Dapr"],
|
||||
"metadata": {
|
||||
"model": "model-type-based-on-component-used",
|
||||
"key": "authKey",
|
||||
"cacheTTL": "10m",
|
||||
}
|
||||
"inputs": [
|
||||
{
|
||||
"content": "What is Dapr?",
|
||||
"role": "user", // Optional
|
||||
"scrubPII": "true", // Optional. Will obfuscate any sensitive information found in the content field
|
||||
},
|
||||
],
|
||||
"cacheTTL": "10m", // Optional
|
||||
"scrubPII": "true", // Optional. Will obfuscate any sensitive information returning from the LLM
|
||||
"temperature": 0.5 // Optional. Optimizes for consistency (0) or creativity (1)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -37,6 +37,9 @@ A list of features enabled via Configuration spec (including build-time override
|
|||
### App connection details
|
||||
The metadata API returns information related to Dapr's connection to the app. This includes the app port, protocol, host, max concurrency, along with health check details.
|
||||
|
||||
### Scheduler connection details
|
||||
Information related to the connection to one or more scheduler hosts.
|
||||
|
||||
### Attributes
|
||||
|
||||
The metadata API allows you to store additional attribute information in the format of key-value pairs. These are ephemeral in-memory and are not persisted if a sidecar is reloaded. This information should be added at the time of a sidecar creation (for example, after the application has started).
|
||||
|
@ -82,6 +85,7 @@ components | [Metadata API Response Component](#metadataapiresponsec
|
|||
httpEndpoints | [Metadata API Response HttpEndpoint](#metadataapiresponsehttpendpoint)[] | A json encoded array of loaded HttpEndpoints metadata.
|
||||
subscriptions | [Metadata API Response Subscription](#metadataapiresponsesubscription)[] | A json encoded array of pub/sub subscriptions metadata.
|
||||
appConnectionProperties| [Metadata API Response AppConnectionProperties](#metadataapiresponseappconnectionproperties) | A json encoded object of app connection properties.
|
||||
scheduler | [Metadata API Response Scheduler](#metadataapiresponsescheduler) | A json encoded object of scheduler connection properties.
|
||||
|
||||
<a id="metadataapiresponseactor"></a>**Metadata API Response Registered Actor**
|
||||
|
||||
|
@ -142,6 +146,12 @@ healthProbeInterval | string | Time between each health probe, in go duration fo
|
|||
healthProbeTimeout | string | Timeout for each health probe, in go duration format.
|
||||
healthThreshold | integer | Max number of failed health probes before the app is considered unhealthy.
|
||||
|
||||
<a id="metadataapiresponsescheduler"></a>**Metadata API Response Scheduler**
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
connected_addresses | string[] | List of strings representing the addresses of the conntected scheduler hosts.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
@ -215,6 +225,13 @@ curl http://localhost:3500/v1.0/metadata
|
|||
"healthProbeTimeout": "500ms",
|
||||
"healthThreshold": 3
|
||||
}
|
||||
},
|
||||
"scheduler": {
|
||||
"connected_addresses": [
|
||||
"10.244.0.47:50006",
|
||||
"10.244.0.48:50006",
|
||||
"10.244.0.49:50006"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -338,6 +355,13 @@ Get the metadata information to confirm your custom attribute was added:
|
|||
"healthProbeTimeout": "500ms",
|
||||
"healthThreshold": 3
|
||||
}
|
||||
},
|
||||
"scheduler": {
|
||||
"connected_addresses": [
|
||||
"10.244.0.47:50006",
|
||||
"10.244.0.48:50006",
|
||||
"10.244.0.49:50006"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -9,7 +9,7 @@ aliases:
|
|||
|
||||
## Component format
|
||||
|
||||
To set up the SFTP binding, create a component of type `bindings.sftp`. See [this guide]({{ ref bindings-overview.md }}) on how to create and apply a binding configuration.
|
||||
To set up the SFTP binding, create a component of type `bindings.sftp`. See [this guide]({{< ref bindings-overview.md >}}) on how to create and apply a binding configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
@ -459,8 +459,8 @@ Apache Kafka supports the following bulk metadata options:
|
|||
|
||||
| Configuration | Default |
|
||||
|----------|---------|
|
||||
| `maxBulkAwaitDurationMs` | `10000` (10s) |
|
||||
| `maxBulkSubCount` | `80` |
|
||||
| `maxAwaitDurationMs` | `10000` (10s) |
|
||||
| `maxMessagesCount` | `80` |
|
||||
|
||||
## Per-call metadata fields
|
||||
|
||||
|
@ -540,6 +540,7 @@ app.include_router(router)
|
|||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Receiving message headers with special characters
|
||||
|
|
|
@ -19,8 +19,8 @@ data:
|
|||
zpages:
|
||||
endpoint: :55679
|
||||
exporters:
|
||||
logging:
|
||||
loglevel: debug
|
||||
debug:
|
||||
verbosity: detailed
|
||||
# Depending on where you want to export your trace, use the
|
||||
# correct OpenTelemetry trace exporter here.
|
||||
#
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit ab3ef305f2e841d044a0190a2351726c3c7ad5db
|
||||
Subproject commit 52f0851780202f71ac4c7fbbcd5c5fb7d674db5a
|
|
@ -1 +1 @@
|
|||
Subproject commit 58d6218861e77a2588b0af360c978a25e5723091
|
||||
Subproject commit 22d9874ae05c2adaf1eea9fe45e1e6f40c30fb04
|
|
@ -1 +1 @@
|
|||
Subproject commit fc52f993afe5fd11b3c8ff5406b8904b280224f1
|
||||
Subproject commit f1dba55586bb734e55de98098284f9139d6e5304
|
|
@ -1 +1 @@
|
|||
Subproject commit fe2ef4be3bce327a9802d75515f478600a415cb0
|
||||
Subproject commit fc4980daaa4802bfb2590f133c332b934b196205
|
Loading…
Reference in New Issue