Use open-message-format to serialize and deserialize embeddings api (#18)

* Use open-message-format to serialize and deserialize embeddings api
This commit is contained in:
Adil Hafeez 2024-07-23 11:56:49 -07:00 committed by GitHub
parent a59c7df2a2
commit cad38295bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 1265 additions and 47 deletions

View file

@ -41,8 +41,13 @@ async def embedding(req: EmbeddingRequest, res: Response):
"index": len(data)
})
usage = {
"prompt_tokens": 0,
"total_tokens": 0,
}
return {
"data": data,
"model": req.model,
"object": "list"
"object": "list",
"usage": usage
}