This repository was archived by the owner on May 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Stricter linting and CI/CD #35
Copy link
Copy link
Open
Description
At the moment we do have only a release pipeline, but it would be worth to have at least a linting pipeline to verify the code is somehow correct. Such a pipeline would run an opinionated linter, such as wemake-python-styleguide and encourage better practices.
For example, this code
def camel_agent(
user_role: str,
assistant_role: str,
task_prompt: str,
max_turns: int,
user_prompt: str = None,
assistant_prompt: str = None,
summary_model: str = None,
llm: LLM = None,presents a couple of problems. First of all, given the large number of arguments that have the same type, it's easy to make mistakes in inverting the error, and for those scenarios Python introduced keyword-only named arguments
def camel_agent(
* ,
user_role: str,
assistant_role: str,
task_prompt: str,
max_turns: int,
user_prompt: str = None,
assistant_prompt: str = None,
summary_model: str = None,
llm: LLM = None,which would force client code to invoke it like so:
camel_agent(
user_role='biochemist',
assistant_role='professor',
...
)Also, the code would not pass mypy, because None are not valid types for str. It should rather be Optional[str] like so:
def camel_agent(
* ,
user_role: str,
assistant_role: str,
task_prompt: str,
max_turns: int,
user_prompt: Optional[str] = None,
assistant_prompt: Optional[str] = None,
summary_model: Optional[str] = None,
llm: LLM = None,Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels