会话组件规范
与Dapr集成的会话组件
Table headers to note:
Header | Description | Example |
---|
Status | Component certification status | Alpha Beta Stable
|
Component version | The version of the component | v1 |
Since runtime version | The version of the Dapr runtime when the component status was set or updated | 1.11 |
Amazon Web Services (AWS)
Component | Status | Component version | Since runtime version |
---|
AWS Bedrock | Alpha | v1 | 1.15 |
Generic
1 -
yaml
type: docs
title: “AWS Bedrock”
linkTitle: “AWS Bedrock”
description: AWS Bedrock conversation组件的详细信息
组件格式
一个Dapr conversation.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
警告
上述示例中,secret以明文字符串形式使用。建议使用secret存储来保护secret,详情请参阅
此处。
规格元数据字段
字段 | 必需 | 详情 | 示例 |
---|
endpoint | N | 组件连接到AWS模拟器的端点。不建议在生产环境中使用。 | http://localhost:4566 |
model | N | 使用的语言模型(LLM)。默认为Amazon的Bedrock默认提供商模型。 | amazon.titan-text-express-v1 |
cacheTTL | N | 提示缓存的生存时间(TTL),即缓存过期时间。使用Golang持续时间格式。 | 10m |
相关链接
2 - Anthropic
关于Anthropic conversation组件的详细信息
组件格式
一个Dapr conversation.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
警告
上述示例中,secret使用了明文字符串。建议使用secret存储,如
此处所述。
元数据字段说明
字段 | 必需 | 详情 | 示例 |
---|
key | Y | Anthropic的API密钥。 | "mykey" |
model | N | 要使用的Anthropic LLM。默认为claude-3-5-sonnet-20240620 | claude-3-5-sonnet-20240620 |
cacheTTL | N | 提示缓存的过期时间。使用Golang的持续时间格式。 | 10m |
相关链接
3 - Huggingface
Huggingface 对话组件的详细信息
组件格式
一个 Dapr conversation.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
警告
上述示例中,密钥以明文字符串形式使用。建议使用密钥存储来保存密钥,如
此处所述。
元数据字段说明
字段 | 必需 | 详情 | 示例 |
---|
key | Y | Huggingface 的 API 密钥。 | mykey |
model | N | 要使用的 Huggingface LLM。默认为 meta-llama/Meta-Llama-3-8B 。 | meta-llama/Meta-Llama-3-8B |
cacheTTL | N | 提示缓存的过期时间。使用 Golang 持续时间格式。 | 10m |
相关链接
4 - Mistral
Mistral 会话组件的详细信息
组件格式
一个 Dapr conversation.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
警告
上述示例中,密钥以明文形式展示。建议使用密钥存储来保护密钥,具体方法请参见
此处。
规格元数据字段
字段 | 必需 | 详情 | 示例 |
---|
key | Y | Mistral 的 API 密钥。 | mykey |
model | N | 要使用的 Mistral LLM 模型。默认为 open-mistral-7b 。 | open-mistral-7b |
cacheTTL | N | 提示缓存的有效期,使用 Golang 的持续时间格式。 | 10m |
相关链接
5 - OpenAI
OpenAI conversation组件的详细信息
组件格式说明
一个Dapr conversation.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
警告
上述示例中使用了明文字符串作为密钥。建议使用密钥存储来保护密钥,具体方法请参见
此处。
规格元数据说明
字段 | 必需 | 详情 | 示例 |
---|
key | 是 | OpenAI的API密钥。 | mykey |
model | 否 | 要使用的OpenAI语言模型。默认为gpt-4-turbo 。 | gpt-4-turbo |
cacheTTL | 否 | 提示缓存的有效期。使用Golang的时间格式表示。 | 10m |
相关链接