Repository navigation
Python: drop docstring arguments the signatures no longer accept - #14744
Open
Hyacinth-of-Security (lxcxjxhx) wants to merge 1 commit into
Open
Hyacinth-of-Security (lxcxjxhx) wants to merge 1 commit into
Hyacinth-of-Security (lxcxjxhx) wants to merge 1 commit into
Conversation
Hyacinth-of-Security (lxcxjxhx)
requested a review
from a team
as a code owner
November 7, 2026 13:38
Hyacinth-of-Security (lxcxjxhx)
deployed
to
github-app-auth
November 7, 2026 13:38 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the docstring cleanup that removes unsupported argument descriptions.
No open issues 🎉
What changed in this PR
Aligns ten Python SDK docstrings with their function signatures, removing unsupported arguments from generated API documentation and editor tooltips.
Changes:
- Removes stale argument descriptions across nine files.
- Removes empty
Args:sections from both chat-messageto_elementdocstrings. - Leaves function signatures, defaults, and implementation code unchanged.
| File | Description |
|---|---|
python/semantic_kernel/memory/semantic_text_memory_base.py |
Removes with_embeddings from search documentation. |
python/semantic_kernel/kernel.py |
Removes kernel from as_mcp_server documentation. |
python/semantic_kernel/core_plugins/text_memory_plugin.py |
Removes kernel from save documentation. |
python/semantic_kernel/contents/streaming_chat_message_content.py |
Removes the obsolete root_key argument section. |
python/semantic_kernel/contents/chat_message_content.py |
Removes the obsolete root_key argument section. |
python/semantic_kernel/connectors/memory_stores/azure_cognitive_search/azure_cognitive_search_memory_store.py |
Removes semantic_config from create_collection documentation. |
python/semantic_kernel/connectors/ai/open_ai/exceptions/content_filter_ai_exception.py |
Removes key from from_inner_error_result documentation. |
python/semantic_kernel/agents/orchestration/group_chat.py |
Removes participant_descriptions from filter_results documentation. |
python/semantic_kernel/agents/bedrock/bedrock_agent.py |
Removes stale prompt_template_config and chat_history argument descriptions. |
Review effort: Balanced
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Ten docstrings across nine files in
python/semantic_kernellist an argument that the function below them does not accept. Nothing here changes behaviour: signatures, defaults and bodies are untouched, only the prose.This matters because these are the docstrings that end up in the generated API reference and in editor tooltips.
Kernel.as_mcp_servertelling the reader to passkernel=is the clearest example —Kernelis the instance, so anyone following the docs writes a call that silently goes into**kwargs.Description
kernel.py—Kernel.as_mcp_serverkernelself(nokernel;**kwargswould swallow it silently)core_plugins/text_memory_plugin.py—TextMemoryPlugin.savekerneltext,key,collectionagents/orchestration/group_chat.py—GroupChatManager.filter_resultsparticipant_descriptionschat_history(the siblingselect_next_agentdoes take it — that docstring is correct and untouched)agents/bedrock/bedrock_agent.py—create_and_prepare_agentprompt_template_configname,instructions, and the keyword-only arguments listed thereagents/bedrock/bedrock_agent.py—create_channelchat_historythread_idonlyconnectors/memory_stores/azure_cognitive_search/..._memory_store.py—create_collectionsemantic_configcollection_name,vector_config,search_resource_encryption_keyconnectors/ai/open_ai/exceptions/content_filter_ai_exception.py—from_inner_error_resultkeyinner_error_resultscontents/chat_message_content.py—to_elementroot_keycontents/streaming_chat_message_content.py—to_elementroot_keymemory/semantic_text_memory_base.py—SemanticTextMemoryBase.searchwith_embeddingscollection,query,limit,min_relevance_score9 files changed, 14 deletions(-)— every line removed is a docstring line.Verification
ruff checkon the nine touched files: one finding,D421atcontents/chat_message_content.py:201, which is a pre-existing property docstring this PR does not touch (my change in that file is at line 235).ruff format --checkon the same files: already formatted.What I left alone
ChromaMemoryStore.__init__still documentssimilarity_fetch_limit— the class is marked@deprecatedand points atChromaStore, so it is not worth a docstring commit.OpenAIResponsesAgent.get_response/invoke/invoke_streamdocumentadditional_instructions,additional_messages,max_prompt_tokens;BedrockAgent.create_and_prepare_agentneighbours andAutoGenConversableAgent.invokehave the same shape. All of these forward**kwargs, so whether the names are dead or merely undocumented keyword passthroughs is a maintainer call rather than something a static check can settle.data/text_search.pycreate_search_functiondocumentsstring_mapper, which exists on an@overloadof the same name — correct, not drift.AI assistance: the list was produced by a static check over Google-style
Args:blocks, then each row was read against its signature and, where relevant, against the sibling overloads before being kept. The description was written from those diffs.Contribution Checklist
ruffreports nothing new on the touched files.ruff check/ruff format --checkrun as the pre-submission formatting step describes.