mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context In addition to the Python local process runtime, we're adding the ability to congfigure the Dapr runtime for Python SK processes. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description The PR introduces: - The ability to configure the Dapr Runtime for Python processes - Adds a sample FastAPI app showing how to configure the Dapr runtime with a sample SK Python process (see the README for details on setup) - Adds some unit test coverage for the Dapr runtime - Closes #9355 <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
19 lines
853 B
Python
19 lines
853 B
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
from semantic_kernel.processes.kernel_process.kernel_process_edge import KernelProcessEdge
|
|
from semantic_kernel.processes.kernel_process.kernel_process_function_target import KernelProcessFunctionTarget
|
|
from semantic_kernel.processes.process_message_factory import ProcessMessageFactory
|
|
|
|
|
|
def test_create_from_edge():
|
|
"""Test initialization of KernelProcessEdge with valid input."""
|
|
source_step_id = "step_1"
|
|
output_target = KernelProcessFunctionTarget(
|
|
step_id="step_2", function_name="process_data", parameter_name="input_data", target_event_id="event_1"
|
|
)
|
|
edge = KernelProcessEdge(source_step_id=source_step_id, output_target=output_target)
|
|
|
|
process_message = ProcessMessageFactory.create_from_edge(edge, "data")
|
|
|
|
assert process_message.source_id == source_step_id
|