From 9a6e91cd931cc4d7a738bb1b8c968f0631b75fbd Mon Sep 17 00:00:00 2001 From: Matthew Farrellee Date: Mon, 12 May 2025 09:27:01 -0400 Subject: [PATCH] fix: chromadb type hint (#2136) ``` $ INFERENCE_MODEL=meta-llama/Llama-3.2-3B-Instruct \ CHROMADB_URL=http://localhost:8000 \ llama stack build --image-type conda --image-name llama \ --providers vector_io=remote::chromadb,inference=remote::ollama \ --run ... File ".../llama_stack/providers/remote/vector_io/chroma/chroma.py", line 31, in ChromaClientType = chromadb.AsyncHttpClient | chromadb.PersistentClient TypeError: unsupported operand type(s) for |: 'function' and 'function' ``` issue: AsyncHttpClient and PersistentClient are functions that return AsyncClientAPI and ClientAPI types, respectively. | cannot be used to construct a type from functions. previously the code was Union[AsyncHttpClient, PersistentClient], which did not trigger an error # What does this PR do? Closes #2135 --- llama_stack/providers/remote/vector_io/chroma/chroma.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llama_stack/providers/remote/vector_io/chroma/chroma.py b/llama_stack/providers/remote/vector_io/chroma/chroma.py index 5381a48ef..a919963ab 100644 --- a/llama_stack/providers/remote/vector_io/chroma/chroma.py +++ b/llama_stack/providers/remote/vector_io/chroma/chroma.py @@ -26,8 +26,7 @@ from .config import ChromaVectorIOConfig as RemoteChromaVectorIOConfig log = logging.getLogger(__name__) - -ChromaClientType = chromadb.AsyncHttpClient | chromadb.PersistentClient +ChromaClientType = chromadb.api.AsyncClientAPI | chromadb.api.ClientAPI # this is a helper to allow us to use async and non-async chroma clients interchangeably