DSPy: The framework for programming—not prompting—language models
Python
Make chromadb_rm compatible with openai 0.28
DanielUH2019c1da8ff753ce
diff --git a/dspy/retrieve/chromadb_rm.py b/dspy/retrieve/chromadb_rm.pyindex 03ddd8ad9..c9798f8fd 100644--- a/dspy/retrieve/chromadb_rm.py+++ b/dspy/retrieve/chromadb_rm.py@@ -8,6 +8,12 @@ import dspyimport backofffrom dsp.utils import dotdict+try:+ import openai.error+ ERRORS = (openai.error.RateLimitError, openai.error.ServiceUnavailableError, openai.error.APIError)+except Exception:+ ERRORS = (openai.RateLimitError, openai.APIError)+try:import chromadbfrom chromadb.config import Settings@@ -108,7 +114,7 @@ class ChromadbRM(dspy.Retrieve):@backoff.on_exception(backoff.expo,- (openai.RateLimitError),+ ERRORS,max_time=15,)def _get_embeddings(self, queries: List[str]) -> List[List[float]]: