Open sartyagi91 opened 3 months ago
Hi, @okhat. Can you share the relevant code? There's a good chance I can resolve that, but without some code to refer to it would be hard to say. I'm interested in the indefinite retries as well, but again it would be hard to help without some reference to what your code is doing now.
Hey Unfortunately I cannot share the code as it is with a company I am working with it
Thanks for opening this! We released DSPy 2.5 yesterday. I think the new dspy.LM
and the underlying dspy.ChatAdapter
will probably resolve this problem.
Here's the (very short) migration guide, it should typically take you 2-3 minutes to change the LM definition and you should be good to go: https://github.com/stanfordnlp/dspy/blob/main/examples/migration.ipynb
Please let us know if this resolves your issue. I will close for now but please feel free to re-open if the problem persists.
I am currently working on a project that labels the sentiment of a response, For a response the API results in a BadRequestError due to Azure's content policy management. I am trying to catch this exception by handling it via a try-and-catch block but It isn't getting caught and I get the error repeatedly as it retries sending that response to API indefinitely. I am using DSPY to abstract away the prompting techniques but I am curious about how I can access the payload to handle exceptions from the API calls to Azure OpenAI models