Files
semantic-kernel/python/semantic_kernel/template_engine/protocols/code_renderer.py
T
Julio Carlos MenendezandEvan Mattson d97f9536c4 Python: Removes the _async suffix where is not needed (#4735)
### 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]>
2024-01-26 17:15:35 +00:00

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
"""
...