MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / _getEmbeddingsDeserialize

Function _getEmbeddingsDeserialize

out/cli.cjs:78452–78466  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

78450function _getEmbeddingsSend(context, deploymentId, body, options = { requestOptions: {} }) {
78451 return context.path("/deployments/{deploymentId}/embeddings", deploymentId).post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
78452 user: body["user"],
78453 model: body["model"],
78454 input: body["input"],
78455 dimensions: body["dimensions"]
78456 } }));
78457}
78458async function _getEmbeddingsDeserialize(result) {
78459 if (isUnexpected(result)) {
78460 throw result.body.error;
78461 }
78462 return {
78463 data: result.body["data"].map((p4) => ({
78464 embedding: p4["embedding"],
78465 index: p4["index"]
78466 })),
78467 usage: {
78468 promptTokens: result.body.usage["prompt_tokens"],
78469 totalTokens: result.body.usage["total_tokens"]

Callers 1

getEmbeddingsFunction · 0.85

Calls 1

isUnexpectedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…