Skip to content
Snippets Groups Projects
Unverified Commit e9c2366b authored by Alex Yang's avatar Alex Yang Committed by GitHub
Browse files

fix: allow passing model metadata (#588)

parent 6278152e
No related branches found
No related tags found
No related merge requests found
...@@ -37,14 +37,18 @@ export class Ollama extends BaseEmbedding implements LLM { ...@@ -37,14 +37,18 @@ export class Ollama extends BaseEmbedding implements LLM {
additionalChatOptions?: Record<string, unknown>; additionalChatOptions?: Record<string, unknown>;
callbackManager?: CallbackManager; callbackManager?: CallbackManager;
protected modelMetadata: Partial<LLMMetadata>;
constructor( constructor(
init: Partial<Ollama> & { init: Partial<Ollama> & {
// model is required // model is required
model: string; model: string;
modelMetadata?: Partial<LLMMetadata>;
}, },
) { ) {
super(); super();
this.model = init.model; this.model = init.model;
this.modelMetadata = init.modelMetadata ?? {};
Object.assign(this, init); Object.assign(this, init);
} }
...@@ -56,6 +60,7 @@ export class Ollama extends BaseEmbedding implements LLM { ...@@ -56,6 +60,7 @@ export class Ollama extends BaseEmbedding implements LLM {
maxTokens: undefined, maxTokens: undefined,
contextWindow: this.contextWindow, contextWindow: this.contextWindow,
tokenizer: undefined, tokenizer: undefined,
...this.modelMetadata,
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment