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 {
additionalChatOptions?: Record<string, unknown>;
callbackManager?: CallbackManager;
protected modelMetadata: Partial<LLMMetadata>;
constructor(
init: Partial<Ollama> & {
// model is required
model: string;
modelMetadata?: Partial<LLMMetadata>;
},
) {
super();
this.model = init.model;
this.modelMetadata = init.modelMetadata ?? {};
Object.assign(this, init);
}
......@@ -56,6 +60,7 @@ export class Ollama extends BaseEmbedding implements LLM {
maxTokens: undefined,
contextWindow: this.contextWindow,
tokenizer: undefined,
...this.modelMetadata,
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment