mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 19:21:03 +02:00
Working for multiple interfaces
This commit is contained in:
parent
73bced123b
commit
bba84dbe39
1 changed files with 9 additions and 4 deletions
|
|
@ -121,18 +121,23 @@ class DispatcherManager:
|
|||
flow = params.get("flow")
|
||||
kind = params.get("kind")
|
||||
|
||||
if flow not in self.flows:
|
||||
raise RuntimeError("Invalid flow")
|
||||
|
||||
if kind not in request_response_dispatchers:
|
||||
raise RuntimeError("Invalid kind")
|
||||
|
||||
key = (flow, kind)
|
||||
|
||||
if flow not in self.flows:
|
||||
raise RuntimeError("Invalid flow")
|
||||
|
||||
if key in self.dispatchers:
|
||||
return await self.dispatchers[key].process(data, responder)
|
||||
|
||||
qconfig = self.flows[flow]["interfaces"]["embeddings"]
|
||||
intf_defs = self.flows[flow]["interfaces"]
|
||||
|
||||
if kind not in intf_defs:
|
||||
raise RuntimeError("This kind not supported by flow")
|
||||
|
||||
qconfig = intf_defs[kind]
|
||||
|
||||
dispatcher = request_response_dispatchers[kind](
|
||||
pulsar_client = self.pulsar_client,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue