feat: route workflow image inputs natively
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from services.runtime_variables import DynamicVariableStore
|
||||
from services.workflow.models import EdgeEvaluation, RouteStatus
|
||||
@@ -23,7 +24,12 @@ class WorkflowEdgeEvaluator:
|
||||
self._store = store
|
||||
self._router_for_node = router_for_node
|
||||
|
||||
async def evaluate(self, node_id: str) -> EdgeEvaluation:
|
||||
async def evaluate(
|
||||
self,
|
||||
node_id: str,
|
||||
*,
|
||||
current_user_message: dict[str, Any] | None = None,
|
||||
) -> EdgeEvaluation:
|
||||
"""Select the first matching conditional path, then the default path."""
|
||||
outgoing = self._engine.outgoing(node_id)
|
||||
expression_edge = self._engine.deterministic_edge(
|
||||
@@ -61,6 +67,7 @@ class WorkflowEdgeEvaluator:
|
||||
node_prompt=self._engine.routing_prompt(node_id, self._store),
|
||||
edges=llm_edges,
|
||||
history=self._store.history,
|
||||
current_user_message=current_user_message,
|
||||
variables={
|
||||
key: value
|
||||
for key, value in self._store.values.items()
|
||||
@@ -94,4 +101,3 @@ class WorkflowEdgeEvaluator:
|
||||
if edge is None:
|
||||
return EdgeEvaluation(status=RouteStatus.NO_MATCH)
|
||||
return EdgeEvaluation(status=RouteStatus.MATCHED, edge=edge)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user