-
Notifications
You must be signed in to change notification settings - Fork 3
docs: Add documentation for Services and Tasks #98
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
base: main
Are you sure you want to change the base?
Conversation
This commit introduces a new markdown file, `services_and_tasks.md`, which explains the architecture and usage of Services and Tasks within the Brevia framework. The documentation covers: - The role and implementation of `BaseService`, including how to create custom services. - The role and implementation of `BaseAnalysisTask`, including how to create custom tasks and their interaction with LangChain. - The relationship and typical workflow between Services and Tasks. - Guidance on customization, with references to existing tutorials and prompt management. The `mkdocs.yml` file has also been updated to include this new page in the site navigation under "Services and Tasks".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds comprehensive documentation for the Services and Tasks architecture in the Brevia framework and updates site navigation.
- Introduces
services_and_tasks.mddetailingBaseService,BaseAnalysisTask, typical workflows, and customization guidance. - Updates
mkdocs.ymlto register the new documentation page in the site navigation.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mkdocs.yml | Added “Services and Tasks” to the navigation menu |
| docs/services_and_tasks.md | New documentation on Services, Tasks, and workflows |
Comments suppressed due to low confidence (1)
mkdocs.yml:59
- [nitpick] Indentation here is inconsistent with the surrounding nav entries (which use 4 spaces). Adjust to match the existing format so the page appears correctly under the parent section.
- Services and Tasks: services_and_tasks.md
| # The run method would raise a ValueError if validate returns False | ||
|
|
||
| # print(f"Running with invalid payload (missing key): {invalid_payload_missing}") | ||
| # try: | ||
| # service.run(invalid_payload_missing) | ||
| # except ValueError as e: | ||
| # print(f"Error: {e}") # Similar to above |
Copilot
AI
May 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment contradicts the earlier note about validation printing and returning False. Clarify whether run raises a ValueError on validation failure and update the example comments to reflect the actual behavior.
| # The run method would raise a ValueError if validate returns False | |
| # print(f"Running with invalid payload (missing key): {invalid_payload_missing}") | |
| # try: | |
| # service.run(invalid_payload_missing) | |
| # except ValueError as e: | |
| # print(f"Error: {e}") # Similar to above | |
| # The run method does not raise a ValueError; it relies on validate to handle errors. | |
| # print(f"Running with invalid payload (missing key): {invalid_payload_missing}") | |
| # try: | |
| # service.run(invalid_payload_missing) | |
| # except ValueError as e: | |
| # print(f"Error: {e}") # Similar to above: validate prints the error and returns False, but no exception is raised. |
| class SimpleTextAnalysisTask(BaseAnalysisTask): | ||
| """A simple task to analyze a piece of text.""" | ||
|
|
||
| def __init__(self, text: str, custom_prompt_template: str | None = None): |
Copilot
AI
May 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] It’s recommended to call super().__init__() within the constructor to ensure any initialization in BaseAnalysisTask is properly executed.
| def __init__(self, text: str, custom_prompt_template: str | None = None): | |
| def __init__(self, text: str, custom_prompt_template: str | None = None): | |
| super().__init__() # Ensure proper initialization of the base class |
This commit introduces a new markdown file,
services_and_tasks.md, which explains the architecture and usage of Services and Tasks within the Brevia framework.The documentation covers:
BaseService, including how to create custom services.BaseAnalysisTask, including how to create custom tasks and their interaction with LangChain.The
mkdocs.ymlfile has also been updated to include this new page in the site navigation under "Services and Tasks".