Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Prompter to support class-based approach #173

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 24, 2024

Refactor the Prompter class to support both function-based and class-based approaches.

Changes:

  • Add BasePrompter abstract base class
  • Modify Prompter to inherit from BasePrompter
  • Support both function-based and class-based approaches
  • Add comprehensive tests for both approaches
  • Add example implementation and documentation
  • Maintain backward compatibility

Link to Devin run: https://preview.devin.ai/devin/b55b6037489046fdb9215eea7a562b48

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

- Add BasePrompter abstract base class
- Modify Prompter to inherit from BasePrompter
- Support both function-based and class-based approaches
- Maintain backward compatibility
- Add comprehensive documentation with examples
- Add TestClassBasedPrompter test suite
- Test class-based implementation
- Test mixed approach (class with function override)
- Test invalid method signatures
- Verify custom parsing behavior
- Ensure backward compatibility
- Add comprehensive example showing class-based approach
- Include both single and batch processing examples
- Demonstrate custom prompt generation and response parsing
- Show proper type hints and documentation
- Add comprehensive examples in docstrings
- Document both function-based and class-based approaches
- Include detailed usage examples
- Improve method documentation
- Remove duplicate initialization code in prompter.py
- Fix long type hints formatting
- Improve method signature formatting in base_prompter.py
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.

0 participants