Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Implement Agents as Tools #45

Closed
ogabrielluiz opened this issue Mar 19, 2023 · 0 comments
Closed

Implement Agents as Tools #45

ogabrielluiz opened this issue Mar 19, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ogabrielluiz
Copy link
Contributor

This issue is for us to discuss this topic and its implementation.
This is probably one of the most interesting parts of Langchain and we should build a structure that will allow us to have a more accessible interface with it.

Right now we work with a pretty straight line between LangFlow and langchain but this will require us to point to the run function instead of just building and calling the agent or run function.

I think one approach is to associate the Agent Output node to the action creating a tool from it.
This requires a blank Tool node that has Name, Description, and Func parameters.
The Func could come from outside (Agent Output or Chain output) or we could allow the user to pass a python script that we would have to parse in the backend.

The Agent or Chain output is pretty straightforward in the frontend but will require custom implementation in the backend i.e create the agent and then set its run function to a new Tool.

The python script would require checking for imports and parsing the function itself. There might be solutions for this in the community already.
One option though would be to first allow the use of the requests package for now and build on top of that once we get it working.

The implementation might get confusing once we implement this so the point of this issue is for us to discuss the course of action to build a structure that is robust possibly using pydantic.BaseModel to get the validation basically for free and use an object-oriented approach to build the graph.

If we create classes inheriting from LangChain's classes and we setup functions such as Chain.as_tool(name, description) and maybe a class called GraphProcessor that processes the JSON and goes over the nodes and edges to build the LangChain Agent, I think it will be easier to maintain once LangChain implements a breaking change.

@ogabrielluiz ogabrielluiz added enhancement New feature or request help wanted Extra attention is needed labels Mar 19, 2023
@langflow-ai langflow-ai locked and limited conversation to collaborators Mar 20, 2023
@ogabrielluiz ogabrielluiz converted this issue into discussion #58 Mar 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants