From 29fca33110a7092f1be47945604ff9e5d7ad4e6b Mon Sep 17 00:00:00 2001 From: simpleqt <89645338+simpleqt@users.noreply.github.com> Date: Fri, 4 Sep 2026 23:38:37 +0800 Subject: [PATCH 1/2] Python: Align docstrings with actual signatures Remove documented parameters that no longer exist and correct two wrong documented defaults: - data/vector.py: four include_vectors Args entries said 'Default is True' while every signature declares False - orchestration/group_chat.py: filter_results documented participant_descriptions, which it does not take - kernel.py: as_mcp_server documented a kernel parameter it does not take - memory/semantic_text_memory_base.py: min_relevance_score documented default 0.0, actual default is 0.7 - contents/{chat,streaming_chat}_message_content.py: to_element documented a root_key argument it does not take - agents/bedrock/bedrock_agent.py: create_channel documented chat_history, which it does not take - connectors/ai/open_ai/exceptions/content_filter_ai_exception.py: from_inner_error_result documented a key parameter it does not take --- python/semantic_kernel/agents/bedrock/bedrock_agent.py | 1 - python/semantic_kernel/agents/orchestration/group_chat.py | 1 - .../ai/open_ai/exceptions/content_filter_ai_exception.py | 1 - python/semantic_kernel/contents/chat_message_content.py | 3 --- .../contents/streaming_chat_message_content.py | 3 --- python/semantic_kernel/data/vector.py | 8 ++++---- python/semantic_kernel/kernel.py | 1 - .../semantic_kernel/memory/semantic_text_memory_base.py | 2 +- 8 files changed, 5 insertions(+), 15 deletions(-) diff --git a/python/semantic_kernel/agents/bedrock/bedrock_agent.py b/python/semantic_kernel/agents/bedrock/bedrock_agent.py index e58476e28931..4618566f50f7 100644 --- a/python/semantic_kernel/agents/bedrock/bedrock_agent.py +++ b/python/semantic_kernel/agents/bedrock/bedrock_agent.py @@ -698,7 +698,6 @@ async def create_channel(self, thread_id: str | None = None) -> AgentChannel: """Create a ChatHistoryChannel. Args: - chat_history: The chat history for the channel. If None, a new ChatHistory instance will be created. thread_id: The ID of the thread. If None, a new thread will be created. Returns: diff --git a/python/semantic_kernel/agents/orchestration/group_chat.py b/python/semantic_kernel/agents/orchestration/group_chat.py index 65c4640e72a5..f90fcf4ab5bd 100644 --- a/python/semantic_kernel/agents/orchestration/group_chat.py +++ b/python/semantic_kernel/agents/orchestration/group_chat.py @@ -201,7 +201,6 @@ async def filter_results( Args: chat_history (ChatHistory): The chat history of the group chat. - participant_descriptions (dict[str, str]): The descriptions of the participants in the group chat. """ ... diff --git a/python/semantic_kernel/connectors/ai/open_ai/exceptions/content_filter_ai_exception.py b/python/semantic_kernel/connectors/ai/open_ai/exceptions/content_filter_ai_exception.py index 5e4bbd123af3..92016ade79c7 100644 --- a/python/semantic_kernel/connectors/ai/open_ai/exceptions/content_filter_ai_exception.py +++ b/python/semantic_kernel/connectors/ai/open_ai/exceptions/content_filter_ai_exception.py @@ -31,7 +31,6 @@ def from_inner_error_result(cls, inner_error_results: dict[str, Any]) -> "Conten """Creates a ContentFilterResult from the inner error results. Args: - key (str): The key to get the inner error result from. inner_error_results (Dict[str, Any]): The inner error results. Returns: diff --git a/python/semantic_kernel/contents/chat_message_content.py b/python/semantic_kernel/contents/chat_message_content.py index 13376106e8b1..cb9799250310 100644 --- a/python/semantic_kernel/contents/chat_message_content.py +++ b/python/semantic_kernel/contents/chat_message_content.py @@ -235,9 +235,6 @@ def __str__(self) -> str: def to_element(self) -> "Element": """Convert the ChatMessageContent to an XML Element. - Args: - root_key: str - The key to use for the root of the XML Element. - Returns: Element - The XML Element representing the ChatMessageContent. """ diff --git a/python/semantic_kernel/contents/streaming_chat_message_content.py b/python/semantic_kernel/contents/streaming_chat_message_content.py index 772316747548..bfdf70a3bf2a 100644 --- a/python/semantic_kernel/contents/streaming_chat_message_content.py +++ b/python/semantic_kernel/contents/streaming_chat_message_content.py @@ -208,9 +208,6 @@ def __add__(self, other: "StreamingChatMessageContent") -> "StreamingChatMessage def to_element(self) -> "Element": """Convert the StreamingChatMessageContent to an XML Element. - Args: - root_key: str - The key to use for the root of the XML Element. - Returns: Element - The XML Element representing the StreamingChatMessageContent. """ diff --git a/python/semantic_kernel/data/vector.py b/python/semantic_kernel/data/vector.py index 9a4e68c80817..a73525a3a54f 100644 --- a/python/semantic_kernel/data/vector.py +++ b/python/semantic_kernel/data/vector.py @@ -1335,7 +1335,7 @@ async def get( """Get records based on the ordering and selection criteria. Args: - include_vectors: Include the vectors in the response. Default is True. + include_vectors: Include the vectors in the response. Default is False. Some vector stores do not support retrieving without vectors, even when set to false. Some vector stores have specific parameters to control that behavior, when that parameter is set, include_vectors is ignored. @@ -1370,7 +1370,7 @@ async def get( Args: key: The key to get. - include_vectors: Include the vectors in the response. Default is True. + include_vectors: Include the vectors in the response. Default is False. Some vector stores do not support retrieving without vectors, even when set to false. Some vector stores have specific parameters to control that behavior, when that parameter is set, include_vectors is ignored. @@ -1396,7 +1396,7 @@ async def get( Args: keys: The keys to get, if keys are provided, key is ignored. - include_vectors: Include the vectors in the response. Default is True. + include_vectors: Include the vectors in the response. Default is False. Some vector stores do not support retrieving without vectors, even when set to false. Some vector stores have specific parameters to control that behavior, when that parameter is set, include_vectors is ignored. @@ -1423,7 +1423,7 @@ async def get( Args: key: The key to get. keys: The keys to get, if keys are provided, key is ignored. - include_vectors: Include the vectors in the response. Default is True. + include_vectors: Include the vectors in the response. Default is False. Some vector stores do not support retrieving without vectors, even when set to false. Some vector stores have specific parameters to control that behavior, when that parameter is set, include_vectors is ignored. diff --git a/python/semantic_kernel/kernel.py b/python/semantic_kernel/kernel.py index 5d74e42c4e26..b8c2618e6b99 100644 --- a/python/semantic_kernel/kernel.py +++ b/python/semantic_kernel/kernel.py @@ -596,7 +596,6 @@ def as_mcp_server( These need to be set to the function name, without the plugin_name. Args: - kernel: The kernel instance to use. prompts: A list of prompt templates to expose as prompts. server_name: The name of the server. version: The version of the server. diff --git a/python/semantic_kernel/memory/semantic_text_memory_base.py b/python/semantic_kernel/memory/semantic_text_memory_base.py index c26336d7174e..3c4c0d66d51c 100644 --- a/python/semantic_kernel/memory/semantic_text_memory_base.py +++ b/python/semantic_kernel/memory/semantic_text_memory_base.py @@ -98,7 +98,7 @@ async def search( collection (str): The collection to search in. query (str): The query to search for. limit (int): The maximum number of results to return. (default: {1}) - min_relevance_score (float): The minimum relevance score to return. (default: {0.0}) + min_relevance_score (float): The minimum relevance score to return. (default: {0.7}) with_embeddings (bool): Whether to return the embeddings of the results. (default: {False}) Returns: From 623ee01024d164dcdb649f8270e538e0b3199539 Mon Sep 17 00:00:00 2001 From: simpleqt <89645338+simpleqt@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:53:53 +0800 Subject: [PATCH 2/2] Python: drop with_embeddings from abstract search() docstring The abstract SemanticTextMemoryBase.search() does not accept with_embeddings (only the concrete SemanticTextMemory.search() does); follow-up to the docstring alignment PR. --- python/semantic_kernel/memory/semantic_text_memory_base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/semantic_kernel/memory/semantic_text_memory_base.py b/python/semantic_kernel/memory/semantic_text_memory_base.py index 3c4c0d66d51c..db89a7875152 100644 --- a/python/semantic_kernel/memory/semantic_text_memory_base.py +++ b/python/semantic_kernel/memory/semantic_text_memory_base.py @@ -99,7 +99,6 @@ async def search( query (str): The query to search for. limit (int): The maximum number of results to return. (default: {1}) min_relevance_score (float): The minimum relevance score to return. (default: {0.7}) - with_embeddings (bool): Whether to return the embeddings of the results. (default: {False}) Returns: List[MemoryQueryResult]: The list of MemoryQueryResult found.