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

How to implement routing function: #71

Open
smileyboy2019 opened this issue Jan 21, 2025 · 3 comments
Open

How to implement routing function: #71

smileyboy2019 opened this issue Jan 21, 2025 · 3 comments
Labels
question Further information is requested

Comments

@smileyboy2019
Copy link

How to implement routing function:
How to achieve intent recognition
similar:
The selector for LlamaIndex
Pydant Router in LlamaIndex
ZeroShot TextRouter in Haystack

Image

@bsorrentino
Copy link
Owner

HI @smileyboy2019

The routing is based on conditional edge that use a routing function to decide what is the next step.

In the routing function you got the Agent State and based on it you can choose the route

graph.addConditionalEdges("nl-router", routingFunction, Map.of( "first": "llm-router", "second": "semantic-router" ) );

It is very important define and contribute to the Agent State in order to have in each node or edge the right information to do the right actions

@bsorrentino bsorrentino added the question Further information is requested label Jan 21, 2025
@smileyboy2019
Copy link
Author

1.How to pass parameters during the routing process
2. Can the entire arrangement be implemented through JSON

@bsorrentino
Copy link
Owner

1.How to pass parameters during the routing process 2. Can the entire arrangement be implemented through JSON

  1. Only Agent State is passed to node and edge actions so, you have to store parameters into state itself
  2. Could be, but it is not so and should be implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants