feat: price

This commit is contained in:
archer
2023-06-23 18:05:53 +08:00
parent 64c35eaa3a
commit 6787f19d78
5 changed files with 16 additions and 16 deletions

View File

@@ -61,7 +61,7 @@ export async function openaiEmbedding({
}
)
.then((res) => ({
tokenLen: res.data.usage.total_tokens || 0,
tokenLen: res.data?.usage?.total_tokens || 0,
vectors: res.data.data.map((item) => item.embedding)
}));

View File

@@ -114,10 +114,10 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| 知识库 - 索引 | 0.001 |
| chatgpt - 对话 | 0.022 |
| chatgpt16K - 对话 | 0.025 |
| gpt4 - 对话 | 0.5 |
| 文件拆分 | 0.025 |`}
| chatgpt - 对话 | 0.015 |
| chatgpt16K - 对话 | 0.015 |
| gpt4 - 对话 | 0.1 |
| 文件拆分 | 0.015 |`}
/>
</>
)}