Skip to content

Conversation

@limnick
Copy link
Contributor

@limnick limnick commented Apr 8, 2024

This change allows you to pass key word arguments such as the max_retries argument to the typed predictors while using the decorator method to construct them. Example:

class MyModule(dspy.Module):
    @dspy.cot(max_retries=5, explain_errors=True)
    def my_cool_function(self, input: Input) -> Output:
        """Does some incredibly cool stuff up to five times with an explanation for errors"""
        pass

    ... rest of module implementation

The arguments are optional, so @dspy.cot and @dspy.cot(max_retries=1) will both work under this patch.

@CholoTook
Copy link

Can you add some tests plz?

@okhat okhat merged commit 3132a7f into stanfordnlp:main Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants