MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / createEmbedding

Function createEmbedding

local_inference/localInferenceService.js:102–113  ·  view source on GitHub ↗
(request, options = {})

Source from the content-addressed store, hash-verified

100 return backend.streamResponse(normalized, { ...options, emitStatus: emit });
101 },
102 async createEmbedding(request, options = {}) {
103 const normalized = normalizeEmbeddingRequest(request);
104 if (!normalized.model) {
105 throw new Error('Embedding request is missing a model id.');
106 }
107 const backend = resolveBackendOrThrow(options.backendId || normalized.backend_id || normalized.backendId);
108 if (typeof backend.createEmbedding !== 'function') {
109 throw new Error('Embedding is not supported for this backend.');
110 }
111 const emit = (event) => emitStatus(wrapBackendStatus(backend, event));
112 return backend.createEmbedding(normalized, { ...options, emitStatus: emit });
113 },
114 async clearModelCache(backendId, modelId) {
115 const backend = resolveBackendOrThrow(backendId);
116 if (typeof backend.clearModelCache !== 'function') {

Callers

nothing calls this directly

Calls 3

resolveBackendOrThrowFunction · 0.85
createEmbeddingMethod · 0.80

Tested by

no test coverage detected