Open DSamuelHodge opened 2 months ago
Maybe this issue is resolved in #46 and is just updated for v2.4.3. Does it work for you?
Its broken still. I actually fixed it in #792
Thanks @DSamuelHodge for raising the issue and @sebbyjp for the fix! @sebbyjp could you actually create a separate PR for this change just to separate it from the rest of the changes in #792 so we can push it out faster? I still think we need to import cohere as it is used for creating clients within the model functionality but would be good to check on this separate branch. Thanks!
Please give this one priority. I cannot use dspy at all.
Description: The
cohere.py
module in thedsp
package is experiencing circular import andNameError
issues.The circular import occurs when the
dsp.modules.lm
module and thedsp.modules.cohere
module try to import each other, leading to a partial initialization of one of the modules.The
NameError
occurs when thecohere
module is not imported successfully, and the code tries to accesscohere.CohereAPIError
in the@backoff.on_exception
decorator.To reproduce the issue:
dsp
package.Cohere
class fromdsp.modules.cohere
.Cohere
class.Expected behavior: The
Cohere
class should be imported and instantiated without any circular import orNameError
issues.Actual behavior: The code raises a
NameError
when trying to accesscohere.CohereAPIError
in the@backoff.on_exception
decorator.Traceback:
Possible solutions:
dsp.modules.lm
anddsp.modules.cohere
modules.cohere
module is not imported successfully and use a genericException
in the@backoff.on_exception
decorator.Additional information:
dsp
package version: [insert version here]Please let me know if you need any further information or have any suggestions to resolve this issue.