-
Notifications
You must be signed in to change notification settings - Fork 28
Agent chat algorithm
Christopher David edited this page Mar 20, 2024
·
2 revisions
As of March 20
-
/chat/{id}
loads LivewireChat
- On user chat input:
- Add Message to Thread
- Create a RunService
- Call
$runService->triggerRun()
and save output as response- Creates a new
Run
and calls itstrigger
method- Check to see if we should override the node flow with a semantic route
- Vectorize the input with Mistral
- Compare vector by similarity search with semantic routes
- If a route is matched (imagegen, bitcoin price, finance, shitcoin), send down that route (flow or rejection message), otherwise continue
- Loop through the flow of nodes, passing user input to the first, and passing each's output as input to the next, returning the final output
- Call each node's
trigger
method- Current node types:
inference
,finnhub_function_call
,stability_text_to_image
,plugin
- Current node types:
- Call each node's
- Check to see if we should override the node flow with a semantic route
- Creates a new