You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: daprdocs/content/en/reference/api/conversation_api.md
+31-7
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Dapr provides an API to interact with Large Language Models (LLMs) and enables c
17
17
This endpoint lets you converse with LLMs.
18
18
19
19
```
20
-
POST /v1.0-alpha1/conversation/<llm-name>/converse
20
+
POST http://localhost:<daprPort>/v1.0-alpha1/conversation/<llm-name>/converse
21
21
```
22
22
23
23
### URL parameters
@@ -30,17 +30,40 @@ POST /v1.0-alpha1/conversation/<llm-name>/converse
30
30
31
31
| Field | Description |
32
32
| --------- | ----------- |
33
-
|`conversationContext`||
34
-
|`inputs`||
35
-
|`parameters`||
33
+
|`conversationContext`|The ID of an existing chat room (like in ChatGPT).|
34
+
|`inputs`|Inputs for the conversation. Multiple inputs at one time are supported. |
35
+
|`metadata`|[Metadata](#metadata) passed to conversation components. |
36
36
37
+
#### Metadata
38
+
39
+
Metadata can be sent in the request’s URL. It must be prefixed with `metadata.`, as shown in the table below.
40
+
41
+
| Parameter | Description |
42
+
| --------- | ----------- |
43
+
|`metadata.key`| The API key for the component. `key` is not applicable to the [AWS Bedrock component]({{< ref "aws-bedrock.md#authenticating-aws" >}}). |
44
+
|`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 >}}). |
45
+
|`metadata.cacheTTL`| A time-to-live value for a prompt cache to expire. Uses Golang duration format. |
46
+
47
+
For example, to call for [Anthropic]({{< ref anthropic.md >}}):
48
+
49
+
```bash
50
+
curl POST http://localhost:3500/v1.0-alpha1/conversation/anthropic/converse?metadata.key=key1&metadata.model=claude-3-5-sonnet-20240620&metadata.cacheTTL=10m
51
+
```
52
+
53
+
{{% alert title="Note" color="primary" %}}
54
+
The metadata parameters available depend on the conversation component you use. [See all the supported components for the conversation API.]({{< ref supported-conversation >}})
55
+
{{% /alert %}}
37
56
38
57
### Request content
39
58
40
59
```json
41
60
REQUEST = {
42
61
"inputs": ["what is Dapr", "Why use Dapr"],
43
-
"parameters": {},
62
+
"metadata": {
63
+
"model": "model-type-based-on-component-used",
64
+
"key": "authKey",
65
+
"cacheTTL": "10m",
66
+
}
44
67
}
45
68
```
46
69
@@ -50,7 +73,7 @@ Code | Description
50
73
---- | -----------
51
74
`202` | Accepted
52
75
`400` | Request was malformed
53
-
`500` | Request formatted correctly, error in dapr code or underlying component
76
+
`500` | Request formatted correctly, error in Dapr code or underlying component
54
77
55
78
### Response content
56
79
@@ -71,4 +94,5 @@ RESPONSE = {
71
94
72
95
## Next steps
73
96
74
-
[Conversation API overview]({{< ref conversation-overview.md >}})
97
+
-[Conversation API overview]({{< ref conversation-overview.md >}})
Copy file name to clipboardexpand all lines: daprdocs/content/en/reference/components-reference/supported-conversation/aws-bedrock.md
+4
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,10 @@ The above example uses secrets as plain strings. It is recommended to use a secr
37
37
| `model` | N | The LLM to use. Defaults to Bedrock's default provider model from Amazon. | `amazon.titan-text-express-v1` |
38
38
| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` |
39
39
40
+
## Authenticating AWS
41
+
42
+
Instead of using a `key` parameter, AWS Bedrock authenticates using Dapr's standard method of IAM or static credentials. [Learn more about authenticating with AWS.]({{< ref authenticating-aws.md >}})
43
+
40
44
## Related links
41
45
42
46
- [Conversation API overview]({{< ref conversation-overview.md >}})
0 commit comments