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

docstring args for ToolCallingAgent, CodeAgent and ManagedAgent #335

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

touseefahmed96
Copy link
Contributor

@touseefahmed96 touseefahmed96 commented Jan 23, 2025

Add args to ToolCallingAgent ``CodeAgent and ManagedAgent docstring.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you saw my PR:

Indeed, I am not sure about the syntax in a couple of lines.
My idea was to check them in the PR docs, but its deployment is not working at the moment.
Once this fixed, I will check/fix my syntax doubts.

@touseefahmed96
Copy link
Contributor Author

@albertvillanova I was going to do this yesterday, but I thought it will cause issues and today I saw your PR, so I did the rest of them.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@@ -655,6 +655,14 @@ def planning_step(self, task, is_first_step: bool, step: int) -> None:
class ToolCallingAgent(MultiStepAgent):
"""
This agent uses JSON-like tool calls, using method `model.get_tool_call` to leverage the LLM engine's tool calling capabilities.

Args:
tools (`list[Tool]`):List of tools that the agent can use.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tools (`list[Tool]`):List of tools that the agent can use.
tools (`list[Tool]`): List of tools that the agent can use.

model (Callable[[list[dict[str, str]]], [`ChatMessage`]]): Model that will generate the agent's actions.
system_prompt (`str`, *optional*): System prompt that will be used to generate the agent's actions.
grammar (`dict[str, str]`, *optional*): Grammar used to parse the LLM output.
additional_authorized_imports (`list[str]`, *optional*): List of additional imports that are authorized for the agent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use its type (List) to define the parameter.

Comment on lines +963 to +968
agent (`object`): The agent to be managed.
name (`str`): The name of the managed agent.
description (`str`): A description of the managed agent.
additional_prompting (`Optional[str]`, *optional*): Additional prompting for the managed agent. Defaults to None.
provide_run_summary (`bool`, *optional*): Whether to provide a run summary after the agent completes its task. Defaults to False.
managed_agent_prompt (`Optional[str]`, *optional*): Custom prompt for the managed agent. Defaults to None.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's align the definitions with the ones above: better not start the description with "the" or "a".

agent (`object`): The agent to be managed.
name (`str`): The name of the managed agent.
description (`str`): A description of the managed agent.
additional_prompting (`Optional[str]`, *optional*): Additional prompting for the managed agent. Defaults to None.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant Optional[] and *optional*. Better removing the first one.

@albertvillanova albertvillanova merged commit b5b55a5 into huggingface:main Jan 24, 2025
3 checks passed
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.

2 participants