🐛 fix(agents.py): change type annotation of name parameter in format_field method to Optional[str] for better clarity

The type annotation of the name parameter in the format_field method has been changed to Optional[str] to indicate that it can be either a string or None. This change improves the clarity of the code and makes it easier to understand the expected input for the method.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-06 17:18:32 -03:00
commit 8cba8514c4

View file

@ -15,7 +15,7 @@ NON_CHAT_AGENTS = {
class AgentFrontendNode(FrontendNode):
@staticmethod
def format_field(field: TemplateField, name: str | None = None) -> None:
def format_field(field: TemplateField, name: Optional[str] = None) -> None:
if field.name in ["suffix", "prefix"]:
field.show = True
if field.name == "Tools" and name == "ZeroShotAgent":