From a857d3d96a300e027c387be68f88258295de9ac1 Mon Sep 17 00:00:00 2001 From: Pavel Jbanov Date: Thu, 9 May 2024 21:43:36 -0400 Subject: [PATCH] Renamed ollama plugin to `genkitx-ollama` (#97) --- docs/index.md | 2 +- docs/plugins/ollama.md | 6 +++--- genkit-tools/cli/src/commands/init.ts | 4 ++-- js/plugins/ollama/package.json | 2 +- js/pnpm-lock.yaml | 8 ++++---- js/samples/coffee-shop/package.json | 2 +- js/samples/dev-ui-gallery/package.json | 2 +- js/samples/dev-ui-gallery/src/index.ts | 2 +- js/samples/express/package.json | 2 +- js/samples/express/src/index.ts | 2 +- js/samples/langchain/genkit-getting-started.txt | 2 +- js/samples/langchain/package.json | 2 +- js/samples/langchain/src/index.ts | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/index.md b/docs/index.md index c4382d924..8289ca694 100644 --- a/docs/index.md +++ b/docs/index.md @@ -35,7 +35,7 @@ can specify custom configurations. ```js import { geminiPro } from '@genkit-ai/vertexai'; -import { ollama } from '@genkit-ai/ollama'; +import { ollama } from 'genkitx-ollama'; import { generate } from '@genkit-ai/ai'; function flipACoin(a, b) { diff --git a/docs/plugins/ollama.md b/docs/plugins/ollama.md index 542e57f2b..8e0a85aa2 100644 --- a/docs/plugins/ollama.md +++ b/docs/plugins/ollama.md @@ -6,7 +6,7 @@ The Ollama plugin provides interfaces to any of the local LLMs supported by ## Installation ```posix-terminal -npm i --save @genkit-ai/ollama +npm i --save genkitx-ollama ``` ## Configuration @@ -24,7 +24,7 @@ ollama pull gemma To use this plugin, specify it when you call `configureGenkit()`. ```js -import { ollama } from '@genkit-ai/ollama'; +import { ollama } from 'genkitx-ollama'; export default configureGenkit({ plugins: [ @@ -63,7 +63,7 @@ the Google Auth library: ```js import { GoogleAuth } from 'google-auth-library'; -import { ollama, OllamaPluginParams } from '@genkit-ai/ollama'; +import { ollama, OllamaPluginParams } from 'genkitx-ollama'; import { configureGenkit, isDevEnv } from '@genkit-ai/core'; const ollamaCommon = {models: [{name: "gemma:2b"}]}; diff --git a/genkit-tools/cli/src/commands/init.ts b/genkit-tools/cli/src/commands/init.ts index a06fa7aa2..17680728c 100644 --- a/genkit-tools/cli/src/commands/init.ts +++ b/genkit-tools/cli/src/commands/init.ts @@ -87,7 +87,7 @@ const modelOptions: Record = { label: 'Google Cloud Vertex AI', plugin: '@genkit-ai/vertexai', }, - ollama: { label: 'Ollama (e.g. Gemma)', plugin: '@genkit-ai/ollama' }, + ollama: { label: 'Ollama (e.g. Gemma)', plugin: 'genkitx-ollama' }, none: { label: 'None', plugin: undefined }, }; @@ -127,7 +127,7 @@ const pluginToInfo: Record = { init: "vertexAI({ location: 'us-central1' })", model: 'geminiPro', }, - '@genkit-ai/ollama': { + 'genkitx-ollama': { imports: 'ollama', init: `ollama({ models: [{ name: 'gemma' }], diff --git a/js/plugins/ollama/package.json b/js/plugins/ollama/package.json index ef29c3e20..4f6272baa 100644 --- a/js/plugins/ollama/package.json +++ b/js/plugins/ollama/package.json @@ -1,5 +1,5 @@ { - "name": "@genkit-ai/ollama", + "name": "genkitx-ollama", "description": "Genkit AI framework plugin for Ollama APIs.", "keywords": [ "genkit", diff --git a/js/pnpm-lock.yaml b/js/pnpm-lock.yaml index c9096de0b..12ad7d228 100644 --- a/js/pnpm-lock.yaml +++ b/js/pnpm-lock.yaml @@ -762,7 +762,7 @@ importers: '@genkit-ai/googleai': specifier: workspace:* version: link:../../plugins/googleai - '@genkit-ai/ollama': + 'genkitx-ollama': specifier: workspace:* version: link:../../plugins/ollama '@genkit-ai/vertexai': @@ -808,7 +808,7 @@ importers: '@genkit-ai/googleai': specifier: workspace:* version: link:../../plugins/googleai - '@genkit-ai/ollama': + 'genkitx-ollama': specifier: workspace:* version: link:../../plugins/ollama '@genkit-ai/vertexai': @@ -907,7 +907,7 @@ importers: '@genkit-ai/googleai': specifier: workspace:* version: link:../../plugins/googleai - '@genkit-ai/ollama': + 'genkitx-ollama': specifier: workspace:* version: link:../../plugins/ollama '@genkit-ai/vertexai': @@ -1000,7 +1000,7 @@ importers: '@genkit-ai/googleai': specifier: workspace:* version: link:../../plugins/googleai - '@genkit-ai/ollama': + 'genkitx-ollama': specifier: workspace:* version: link:../../plugins/ollama '@genkit-ai/vertexai': diff --git a/js/samples/coffee-shop/package.json b/js/samples/coffee-shop/package.json index d6cb8b070..46031216a 100644 --- a/js/samples/coffee-shop/package.json +++ b/js/samples/coffee-shop/package.json @@ -23,7 +23,7 @@ "@genkit-ai/dev-local-vectorstore": "workspace:*", "@genkit-ai/firebase": "workspace:*", "@genkit-ai/googleai": "workspace:*", - "@genkit-ai/ollama": "workspace:*", + "genkitx-ollama": "workspace:*", "genkitx-pinecone": "workspace:*", "@genkit-ai/evaluator": "workspace:*", "@genkit-ai/vertexai": "workspace:*", diff --git a/js/samples/dev-ui-gallery/package.json b/js/samples/dev-ui-gallery/package.json index f4add6c60..140915cb8 100644 --- a/js/samples/dev-ui-gallery/package.json +++ b/js/samples/dev-ui-gallery/package.json @@ -26,7 +26,7 @@ "@genkit-ai/dev-local-vectorstore": "workspace:*", "@genkit-ai/firebase": "workspace:*", "@genkit-ai/googleai": "workspace:*", - "@genkit-ai/ollama": "workspace:*", + "genkitx-ollama": "workspace:*", "genkitx-pinecone": "workspace:*", "@genkit-ai/evaluator": "workspace:*", "@genkit-ai/vertexai": "workspace:*", diff --git a/js/samples/dev-ui-gallery/src/index.ts b/js/samples/dev-ui-gallery/src/index.ts index 7734b0a8c..86aea503e 100644 --- a/js/samples/dev-ui-gallery/src/index.ts +++ b/js/samples/dev-ui-gallery/src/index.ts @@ -20,7 +20,6 @@ import { dotprompt } from '@genkit-ai/dotprompt'; import { genkitEval, GenkitMetric } from '@genkit-ai/evaluator'; import { firebase } from '@genkit-ai/firebase'; import { geminiPro, googleAI } from '@genkit-ai/googleai'; -import { ollama } from '@genkit-ai/ollama'; import { claude3Haiku, claude3Opus, @@ -30,6 +29,7 @@ import { VertexAIEvaluationMetricType, } from '@genkit-ai/vertexai'; import { chroma } from 'genkitx-chromadb'; +import { ollama } from 'genkitx-ollama'; import { pinecone } from 'genkitx-pinecone'; // Turn off safety checks for evaluation so that the LLM as an evaluator can diff --git a/js/samples/express/package.json b/js/samples/express/package.json index 3d3ac6963..1c697b809 100644 --- a/js/samples/express/package.json +++ b/js/samples/express/package.json @@ -20,7 +20,7 @@ "@genkit-ai/flow": "workspace:*", "@genkit-ai/firebase": "workspace:*", "@genkit-ai/googleai": "workspace:*", - "@genkit-ai/ollama": "workspace:*", + "genkitx-ollama": "workspace:*", "@genkit-ai/vertexai": "workspace:*", "express": "~4.19.2", "zod": "^3.22.4" diff --git a/js/samples/express/src/index.ts b/js/samples/express/src/index.ts index 34cabafb3..f5bbc87c2 100644 --- a/js/samples/express/src/index.ts +++ b/js/samples/express/src/index.ts @@ -19,9 +19,9 @@ import { configureGenkit } from '@genkit-ai/core'; import { firebase } from '@genkit-ai/firebase'; import { defineFlow, run, runFlow } from '@genkit-ai/flow'; import { googleAI } from '@genkit-ai/googleai'; -import { ollama } from '@genkit-ai/ollama'; import { vertexAI } from '@genkit-ai/vertexai'; import express, { Request, Response } from 'express'; +import { ollama } from 'genkitx-ollama'; import * as z from 'zod'; configureGenkit({ diff --git a/js/samples/langchain/genkit-getting-started.txt b/js/samples/langchain/genkit-getting-started.txt index 77f421894..dc831ffde 100644 --- a/js/samples/langchain/genkit-getting-started.txt +++ b/js/samples/langchain/genkit-getting-started.txt @@ -11,7 +11,7 @@ To get you started, here are 10 key Genkit features we think you'll love: 1. Many models, one interface Genkit provides plugins that give you access to popular models out of the box and a flexible model abstraction that makes it easy to integrate any model API and use community-maintained models. Trying out a new model is as easy as changing a single argument, but each model can specify custom configurations. import { geminiPro } from '@genkit-ai/vertexai'; -import { ollama } from '@genkit-ai/ollama'; +import { ollama } from 'genkitx-ollama'; import { generate } from '@genkit-ai/ai'; diff --git a/js/samples/langchain/package.json b/js/samples/langchain/package.json index 28eb06569..4d1593b66 100644 --- a/js/samples/langchain/package.json +++ b/js/samples/langchain/package.json @@ -20,7 +20,7 @@ "@genkit-ai/firebase": "workspace:*", "@genkit-ai/flow": "workspace:*", "@genkit-ai/googleai": "workspace:*", - "@genkit-ai/ollama": "workspace:*", + "genkitx-ollama": "workspace:*", "@genkit-ai/vertexai": "workspace:*", "genkitx-langchain": "workspace:*", "@langchain/community": "^0.0.53", diff --git a/js/samples/langchain/src/index.ts b/js/samples/langchain/src/index.ts index 9df072ac4..1366a7e2d 100644 --- a/js/samples/langchain/src/index.ts +++ b/js/samples/langchain/src/index.ts @@ -18,7 +18,6 @@ import { configureGenkit } from '@genkit-ai/core'; import { firebase } from '@genkit-ai/firebase'; import { defineFlow, run, startFlowsServer } from '@genkit-ai/flow'; import { googleAI } from '@genkit-ai/googleai'; -import { ollama } from '@genkit-ai/ollama'; import { vertexAI } from '@genkit-ai/vertexai'; import { GoogleVertexAIEmbeddings } from '@langchain/community/embeddings/googlevertexai'; import { GoogleVertexAI } from '@langchain/community/llms/googlevertexai'; @@ -29,6 +28,7 @@ import { RunnableSequence, } from '@langchain/core/runnables'; import { GenkitTracer } from 'genkitx-langchain'; +import { ollama } from 'genkitx-ollama'; import { PDFLoader } from 'langchain/document_loaders/fs/pdf'; import { formatDocumentsAsString } from 'langchain/util/document'; import { MemoryVectorStore } from 'langchain/vectorstores/memory';