You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: