Skip to content

Commit

Permalink
feat: implement Provider interface for registry support
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomez committed Jun 29, 2024
1 parent 6925c01 commit cd73c6b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/ollama/src/ollama-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ export interface OllamaProvider {
modelId: OllamaEmbeddingModelId,
settings?: OllamaEmbeddingSettings,
): OllamaEmbeddingModel

languageModel(
modelId: OllamaChatModelId,
settings?: OllamaChatSettings,
): OllamaChatLanguageModel

textEmbedding(
modelId: OllamaEmbeddingModelId,
settings?: OllamaEmbeddingSettings,
): OllamaEmbeddingModel
}

export interface OllamaProviderSettings {
Expand Down Expand Up @@ -92,6 +102,8 @@ export function createOllama(

provider.chat = createChatModel
provider.embedding = createEmbeddingModel
provider.languageModel = createChatModel
provider.textEmbedding = createEmbeddingModel

return provider as OllamaProvider
}
Expand Down

0 comments on commit cd73c6b

Please sign in to comment.