(request, options = {})
| 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') { |
nothing calls this directly
no test coverage detected