Skip to content

Commit f993d49

Browse files
committed
- Introduced `model_key` property in `SmartEmbedOllamaAdapter` for improved model identification. - Refactored `to_platform` method in `SmartEmbedModelOllamaRequestAdapter` to utilize `model_key` instead of `id`. - Removed unused parameters and comments for clarity while maintaining existing comments and methods unrelated to the changes.
1 parent 9e97fc8 commit f993d49

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

smart-embed-model/adapters/ollama.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class SmartEmbedOllamaAdapter extends SmartEmbedModelApiAdapter {
9292
signup_url: null, // Not applicable for local instance
9393
batch_size: 30,
9494
models: {},
95+
model_key: 'nomic-embed-text',
9596
};
9697

9798
get endpoint() {
@@ -273,17 +274,12 @@ export class SmartEmbedOllamaAdapter extends SmartEmbedModelApiAdapter {
273274
class SmartEmbedModelOllamaRequestAdapter extends SmartEmbedModelRequestAdapter {
274275
/**
275276
* Convert request to Ollama's embed API format.
276-
* @param {boolean} [streaming=false] - Whether streaming is enabled (not used here)
277277
* @returns {Object} Request parameters in Ollama's format
278278
*/
279-
to_platform(streaming = false) {
279+
to_platform() {
280280
const ollama_body = {
281-
model: this.adapter.model_config.id,
281+
model: this.adapter.model_config.model_key,
282282
input: this.embed_inputs,
283-
// Advanced parameters can be added here if needed
284-
// truncate: true, // Defaults to true, adjust based on requirements
285-
// options: { temperature: 0.7 }, // Example option
286-
// keep_alive: "5m", // Example option
287283
};
288284

289285
return {
@@ -301,7 +297,6 @@ class SmartEmbedModelOllamaRequestAdapter extends SmartEmbedModelRequestAdapter
301297
get_headers() {
302298
return {
303299
"Content-Type": "application/json",
304-
// Add additional headers if required by Ollama
305300
};
306301
}
307302
}

0 commit comments

Comments
 (0)