diff --git a/python/semantic_kernel/orchestration/sk_function.py b/python/semantic_kernel/orchestration/sk_function.py index af0cbbbc3bb7..17af6d375cfa 100644 --- a/python/semantic_kernel/orchestration/sk_function.py +++ b/python/semantic_kernel/orchestration/sk_function.py @@ -1,6 +1,8 @@ # Copyright (c) Microsoft. All rights reserved. import asyncio +import platform +import sys import threading from enum import Enum from logging import Logger @@ -36,6 +38,9 @@ ) from semantic_kernel.utils.null_logger import NullLogger +if platform.system() == "Windows" and sys.version_info >= (3, 8, 0): + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + class SKFunction(SKFunctionBase): """