You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The example runs fine when using devLocalndexer / Retriever, but throws an exception when running with a ChromaDB. So there seems to be a crucial information missing on the chromaDB Plugin documentation.
Environment
Hostmachine: MacOS
ChromaServer is running in a docker Container
Embedding and LLM connect to openAI
Behaviour
I can add content to the database in the DevUI by running the flow fillDB
calling the flow requestDB from DevUi throws an exception:
Exception
Running action `/flow/requestDB`...
{ start: { input: 'are green cars the worst ? ' } } runEnvelope
save flow state 2b7a967c-5dc9-47c7-8aef-caad1dc537e8
Fetching traces for env `dev`.
Fetching trace `43c3efc4410189f919848c36276950ff` for env `dev`.
Fetching flow state `2b7a967c-5dc9-47c7-8aef-caad1dc537e8` for env `dev`.
Fetching actions.
/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parsers/nativeEnum.js:6
const actualKeys = Object.keys(def.values).filter((key) => {
^
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at parseNativeEnumDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parsers/nativeEnum.js:6:31)
at selectParser (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:119:59)
at parseDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:52:24)
at parseArrayDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parsers/array.js:12:48)
at selectParser (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:104:49)
at parseDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:52:24)
at parseOptionalDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parsers/optional.js:7:43)
at selectParser (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:123:55)
at parseDef (/Users/friedrich.wessel/work/AI-Taskforce/unity-firebase-genkit-template/backend/node_modules/zod-to-json-schema/dist/cjs/parseDef.js:52:24)
Script
import*asdotenvfrom'dotenv'dotenv.config()import{configureGenkit}from'@genkit-ai/core';import{defineFlow}from'@genkit-ai/flow';import{gpt4o,openAI,textEmbedding3Small}from'genkitx-openai';import{Document,index,retrieve}from'@genkit-ai/ai/retriever';import{chroma,chromaIndexerRef,chromaRetrieverRef}from'genkitx-chromadb';import{z}from'zod';import{generate}from'@genkit-ai/ai';configureGenkit({plugins: [openAI(),chroma([{collectionName: 'example_db',embedder: textEmbedding3Small,createCollectionIfMissing: true,clientParams: {path: "http://localhost:8000",}},])],logLevel: 'debug',enableTracingAndMetrics: true,});exportconstretriever=chromaRetrieverRef({collectionName: 'example_db',});exportconstindexer=chromaIndexerRef({collectionName: 'example_db',});exportconstfillDB=defineFlow({name: 'fillDB',inputSchema: z.string(),outputSchema: z.string(),},async(data)=>{letdoc=Document.fromText(`This is test content about ${data}`);constdocuments=[doc]awaitindex({indexer: indexer, documents })return`Added ${data} to the DB`;});exportconstrequestDB=defineFlow({name: 'requestDB',inputSchema: z.string(),outputSchema: z.string(),},async(question)=>{
let options : any={k : 3}constdocs=awaitretrieve({retriever: retriever,query : question,
options,});constllmResponse=awaitgenerate({model: gpt4o,prompt: `${question}`,context: docs});returnllmResponse.text();});
The text was updated successfully, but these errors were encountered:
Based on the documentation for the Chroma Plugin ( https://firebase.google.com/docs/genkit/plugins/chroma )
I created a simple example script for the ChromaPlugin.
Description
The example runs fine when using devLocalndexer / Retriever, but throws an exception when running with a ChromaDB. So there seems to be a crucial information missing on the chromaDB Plugin documentation.
Environment
Hostmachine: MacOS
ChromaServer is running in a docker Container
Embedding and LLM connect to openAI
Behaviour
fillDB
requestDB
from DevUi throws an exception:Exception
Script
The text was updated successfully, but these errors were encountered: