Skip to content

Commit d006990

Browse files
luckloveroot
andauthored
Fix InvokeWithList & InvokeWithDict (#84)
Co-authored-by: root <[email protected]>
1 parent a065835 commit d006990

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blocks/invoke.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def invoke(
157157
if not version:
158158
raise VersionnNotFound(version_id)
159159
graph = self.initialize_graph(version.configuration)
160-
if type(input) != graph.input_type():
160+
if not isinstance(input, graph.input_type()):
161161
raise ApplicationInputTypeMismatch(graph.input_type(), type(input))
162162

163163
_id = str(uuid.uuid4())
@@ -322,7 +322,7 @@ def __call__(self, input: list) -> str:
322322
return invoke(
323323
user=self.context["user"] + "@" + self.context["interaction_id"][:8],
324324
app_id=self.app_id,
325-
input=input,
325+
input=HashableList(input),
326326
timeout=self.timeout,
327327
session_id=self.context.get("session_id"),
328328
)
@@ -342,7 +342,7 @@ def __call__(self, input: dict) -> str:
342342
return invoke(
343343
user=self.context["user"] + "@" + self.context["interaction_id"][:8],
344344
app_id=self.app_id,
345-
input=input,
345+
input=HashableDict(input),
346346
timeout=self.timeout,
347347
session_id=self.context.get("session_id"),
348348
)

0 commit comments

Comments
 (0)