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

Describe workflow intefrace #644

Merged
merged 21 commits into from
Sep 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
PawelPeczek-Roboflow committed Sep 17, 2024
commit 98942313fc40ddcd93356c94a8555356b90259ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Dict, List

from inference.core.workflows.execution_engine.introspection.blocks_loader import describe_available_blocks
from inference.core.workflows.execution_engine.introspection.connections_discovery import \
parse_all_schemas, get_all_inputs_kind_major
from inference.core.workflows.execution_engine.v1.core import EXECUTION_ENGINE_V1_VERSION
from inference.core.workflows.execution_engine.v1.dynamic_blocks.block_assembler import compile_dynamic_blocks


def describe_workflow_inputs(definition: dict) -> Dict[str, List[str]]:
dynamic_blocks = compile_dynamic_blocks(
dynamic_blocks_definitions=definition.get("dynamic_blocks_definitions", [])
)
blocks_description = describe_available_blocks(
dynamic_blocks=dynamic_blocks,
execution_engine_version=EXECUTION_ENGINE_V1_VERSION,
)
all_schemas = parse_all_schemas(blocks_description=blocks_description)
detailed_input_kind2schemas = get_all_inputs_kind_major(
blocks_description=blocks_description,
all_schemas=all_schemas,
)