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)
}));