mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context Delete all *_async where *_sync doesn't exist to make the library more Pythonic. Fixes #4629 ### 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 😄 --------- Co-authored-by: Evan Mattson <[email protected]>
22 lines
542 B
Python
22 lines
542 B
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
from typing import Protocol, runtime_checkable
|
|
|
|
from semantic_kernel.orchestration.kernel_context import KernelContext
|
|
|
|
|
|
@runtime_checkable
|
|
class CodeRenderer(Protocol):
|
|
"""
|
|
Protocol for dynamic code blocks that need async IO to be rendered.
|
|
"""
|
|
|
|
async def render_code(self, context: KernelContext) -> str:
|
|
"""
|
|
Render the block using the given context.
|
|
|
|
:param context: kernel execution context
|
|
:return: Rendered content
|
|
"""
|
|
...
|