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

Python: fix class type #6183

Merged
merged 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async def handle_streaming(
streamed_chunks: List[StreamingChatMessageContent] = []
async for message in response:
if not execution_settings.function_call_behavior.auto_invoke_kernel_functions and isinstance(
message[0], FunctionCallContent
message[0], ChatMessageContent
):
streamed_chunks.append(message[0])
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.function_call_behavior import FunctionCallBehavior
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion
from semantic_kernel.contents import ChatHistory
from semantic_kernel.utils.settings import azure_openai_settings_from_dot_env_as_dict
Expand Down Expand Up @@ -44,7 +45,9 @@
req_settings.max_tokens = 2000
req_settings.temperature = 0.7
req_settings.top_p = 0.8
req_settings.auto_invoke_kernel_functions = True
req_settings.function_call_behavior = FunctionCallBehavior.EnableFunctions(
auto_invoke=True, filters={"excluded_plugins": []}
)
## The third method is the most specific as the returned request settings class is the one that is registered for the service and has some fields already filled in, like the service_id and ai_model_id. # noqa: E501 E266


Expand Down