DSPy: The framework for programming—not prompting—language models
Python
refactor(cohere-lm): retry wrapper should ignore optional coheere (#46)
Sri Vardhamanan12d7f1106f2f
diff --git a/dsp/modules/cohere.py b/dsp/modules/cohere.pyindex f30191195..bce5ab324 100644--- a/dsp/modules/cohere.py+++ b/dsp/modules/cohere.py@@ -6,7 +6,9 @@ from dsp.modules.lm import LMtry:import cohere+ cohere_api_error = cohere.CohereAPIErrorexcept ImportError:+ cohere_api_error = Exceptionprint("Not loading Cohere because it is not installed.")@@ -90,7 +92,7 @@ class Cohere(LM):@backoff.on_exception(backoff.expo,- (cohere.CohereAPIError),+ (cohere_api_error),max_time=1000,on_backoff=backoff_hdlr,giveup=giveup_hdlr,