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

docs: add react agent guide using functional API #3129

Open
wants to merge 2 commits into
base: ey/01-15/functional-api-docs
Choose a base branch
from

Conversation

ccurme
Copy link
Contributor

@ccurme ccurme commented Jan 21, 2025

No description provided.

Copy link
Contributor

@nfcampos nfcampos left a comment

Choose a reason for hiding this comment

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

  • should we make each tool a @task?
  • I'd probably suggest using concurrent.futures.as_completed when waiting for the results of the tool calls, but not necessary

"model = ChatOpenAI(model=\"gpt-4o-mini\")\n",
"\n",
"\n",
"@tool(response_format=\"content_and_artifact\")\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why @tool(response_format="content_and_artifact")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this isn't needed, will remove

@ccurme
Copy link
Contributor Author

ccurme commented Jan 22, 2025

  • should we make each tool a @task?

@nfcampos is there a good way to associate the name of a tool (e.g., from a tool call) to a task?

One option is something like

def _make_task_from_tool(tool):

    @task
    def tool_task(tool_call):
        observation = tool.invoke(tool_call)
        return ToolMessage(content=observation, tool_call_id=tool_call["id"])

    tool_task.__wrapped__.__name__ = tool.name
    return tool_task

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.

3 participants