From 55832b0670640463c01f12f9884306497c5cadd2 Mon Sep 17 00:00:00 2001 From: ninglinLiu Date: Mon, 9 Nov 2026 08:43:09 +0800 Subject: [PATCH] docs: remove duplicated words in comments, samples, and ADRs --- docs/decisions/0021-json-serializable-custom-types.md | 2 +- docs/decisions/0035-skfunction-type-descriptions.md | 4 ++-- docs/decisions/0041-function-call-content.md | 2 +- docs/decisions/0048-agent-chat-serialization.md | 8 ++++---- docs/decisions/0054-processes.md | 2 +- docs/decisions/0072-agents-with-memory.md | 2 +- .../Functions/FunctionResultTests.cs | 2 +- .../TemplateEngine/Blocks/CodeBlockTests.cs | 4 ++-- python/samples/demos/telemetry/README.md | 2 +- .../chat_completion/step07_kernel_function_strategies.py | 2 +- python/samples/getting_started_with_processes/README.md | 4 ++-- .../core_plugins/sessions_python_tool/README.md | 2 +- python/semantic_kernel/functions/kernel_function.py | 4 ++-- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/decisions/0021-json-serializable-custom-types.md b/docs/decisions/0021-json-serializable-custom-types.md index 08e017db2060..5757b7be2238 100644 --- a/docs/decisions/0021-json-serializable-custom-types.md +++ b/docs/decisions/0021-json-serializable-custom-types.md @@ -116,7 +116,7 @@ Required Not required - **Native to Native:** Passing variables from Native to Native **will not** require any serialization or deserialization as the complex type can be passed as-is. -- **Semantic to Semantic:** Passing variables from Semantic to Semantic **will not** require any serialization or deserialization as the the complex type will be passed around using its string representation. +- **Semantic to Semantic:** Passing variables from Semantic to Semantic **will not** require any serialization or deserialization as the complex type will be passed around using its string representation. **2. Only use native serialization methods** This option was originally considered, which would have effectively removed the use of the `TypeConverter`s in favor of a simple `JsonConverter`, but it was pointed out that this may result in lossy conversion between primitive types. For example, when converting from a `float` to an `int`, the primitive may be truncated in a way by the native serialization methods that does not provide an accurate result. diff --git a/docs/decisions/0035-skfunction-type-descriptions.md b/docs/decisions/0035-skfunction-type-descriptions.md index 6af743bb4c51..6eb8529315ce 100644 --- a/docs/decisions/0035-skfunction-type-descriptions.md +++ b/docs/decisions/0035-skfunction-type-descriptions.md @@ -12,7 +12,7 @@ informed: ## Context and Problem Statement -Today, Semantic Kernel only retains a small amount of information about the parameters of SKFunctions, and no information at all about the output of an SKFunction. This has a large negative impact on the effectiveness of our planners because it is not possible to adequately describe the schema of the the plugin function's inputs and outputs. +Today, Semantic Kernel only retains a small amount of information about the parameters of SKFunctions, and no information at all about the output of an SKFunction. This has a large negative impact on the effectiveness of our planners because it is not possible to adequately describe the schema of the plugin function's inputs and outputs. Planners depend on a description of the plugins available to it, which we refer to as a Functions Manual. Think of this as the user manual that is provided to the LLM and is intended to explain to the LLM the functions that are available to it and how they can be used. An example of a current Functions Manual from our Sequential planner looks like this: @@ -98,7 +98,7 @@ One way that we could provide the missing type information is to use Json Schema ] ``` -This Functions Manual provides much more information about the the inputs and outputs of the functions that the LLM has access to. It allows to see that the output of the first functions is a complex objects that contain the information required by the second function. This also comes with an increase in the amount of tokens used, however the increase in functionality derived the type information outweighs this expense. With this information we can now expect the LLM to generate a plan that includes an understanding of how values should be extracted from outputs and passed to inputs. One effective method that we've used in testing is to ask the LLM to specify inputs as a Json Path into the appropriate output. An equivalent plan shown in pseudo code would look like this: +This Functions Manual provides much more information about the inputs and outputs of the functions that the LLM has access to. It allows to see that the output of the first functions is a complex objects that contain the information required by the second function. This also comes with an increase in the amount of tokens used, however the increase in functionality derived the type information outweighs this expense. With this information we can now expect the LLM to generate a plan that includes an understanding of how values should be extracted from outputs and passed to inputs. One effective method that we've used in testing is to ask the LLM to specify inputs as a Json Path into the appropriate output. An equivalent plan shown in pseudo code would look like this: ```csharp var dateResponse = DatePluginSimpleComplex.GetDate1(1); diff --git a/docs/decisions/0041-function-call-content.md b/docs/decisions/0041-function-call-content.md index cdd86619f877..5ad1b730b8a6 100644 --- a/docs/decisions/0041-function-call-content.md +++ b/docs/decisions/0041-function-call-content.md @@ -356,7 +356,7 @@ foreach (FunctionCallContent functionCall in functionCalls) Questions: - How to pass the original `FunctionCallContent` to connectors along with the function result. It's actually not clear atm whether it's needed or not. The current rationale is that some models might expect properties of the original function call, such as arguments, to be passed back to the LLM along with the function result. An argument can be made that the original function call can be found in the chat history by the connector if needed. However, a counterargument is that it may not always be possible because the chat history might be truncated to save tokens, reduce hallucination, etc. - How to pass function id to connector? -- How to communicate exception to the connectors? It was proposed to add the `Exception` property the the `FunctionResult` class that will always be assigned by the `KernelFunction.InvokeAsync` method. However, this change will break C# function calling semantic, where the function should be executed if the contract is satisfied, or an exception should be thrown if the contract is not fulfilled. +- How to communicate exception to the connectors? It was proposed to add the `Exception` property to the `FunctionResult` class that will always be assigned by the `KernelFunction.InvokeAsync` method. However, this change will break C# function calling semantic, where the function should be executed if the contract is satisfied, or an exception should be thrown if the contract is not fulfilled. - If `FunctionResult` becomes a non-steaming content by inheriting `KernelContent` class, how the `FunctionResult` can represent streaming content capabilities represented by the `StreamingKernelContent` class when/if it needed later? C# does not support multiple inheritance. **Pros** diff --git a/docs/decisions/0048-agent-chat-serialization.md b/docs/decisions/0048-agent-chat-serialization.md index e37feb0bdab7..4d465affb009 100644 --- a/docs/decisions/0048-agent-chat-serialization.md +++ b/docs/decisions/0048-agent-chat-serialization.md @@ -15,7 +15,7 @@ Formalizing a mechanism that supports serialization and deserialization of any ` #### Goals - **Capture & Restore Primary Chat History**: The primary `AgentChat` history must be captured and restored for full fidelity. - **Capture & Restore Channel State**: In addition to the primary chat history, the state for each `AgentChannel` within the `AgentChat` must be captured and restored. -- **Capture Agent Metadata**: Capturing the agent Identifier, Name, and Type upon serialization provides a guidance on how to restore the the `AgentChat` during deserialization. +- **Capture Agent Metadata**: Capturing the agent Identifier, Name, and Type upon serialization provides a guidance on how to restore the `AgentChat` during deserialization. #### Non-Goals @@ -31,7 +31,7 @@ Formalizing a mechanism that supports serialization and deserialization of any ` When restoring an `AgentChat`, the application must also re-create the `Agent` instances participating in the chat (outside of the control of the deserialization process). This creates the opportunity for the following cases: #### 1. **Equivalent:** All of the original agent types (channels) available in the restored chat. -This shall result in a full-fidelity restoration of of the original chat. +This shall result in a full-fidelity restoration of the original chat. |Source Chat|Target Chat| |---|---| @@ -40,7 +40,7 @@ This shall result in a full-fidelity restoration of of the original chat. |`ChatCompletionAgent` & `OpenAIAssistantAgent`|`ChatCompletionAgent` & `OpenAIAssistantAgent`| #### 2. **Enhanced:** Additional original agent types (channels) available in the restored chat. -This shall also result in a full-fidelity restoration of of the original chat. +This shall also result in a full-fidelity restoration of the original chat. Any new agent type (channel) will synchronize to the chat once restored (identical to adding a new agent type to a chat that is progress). |Source Chat|Target Chat| @@ -49,7 +49,7 @@ Any new agent type (channel) will synchronize to the chat once restored (identic |`OpenAIAssistantAgent`|`ChatCompletionAgent` & `OpenAIAssistantAgent`| #### 3. **Reduced:** A subset of original agent types (channels) available in the restored chat. -This shall also result in a full-fidelity restoration of of the original chat to the available channels. Introduction of a missing agent type (channel) post restoration will +This shall also result in a full-fidelity restoration of the original chat to the available channels. Introduction of a missing agent type (channel) post restoration will synchronize the channel to the current chat (identical to adding a new agent type to a chat that is progress). |Source Chat|Target Chat| diff --git a/docs/decisions/0054-processes.md b/docs/decisions/0054-processes.md index ed2f0c7c17ef..29366e802edc 100644 --- a/docs/decisions/0054-processes.md +++ b/docs/decisions/0054-processes.md @@ -279,7 +279,7 @@ The instance of `KernelProcess` that we've created is nothing more than an objec #### Step 5 - Run the Process: -Running a Process requires using a "connector" to a supported runtime. As part of the core packages we will include an in-process runtime that is capable of of running a process locally on a dev machine or in a server. This runtime will initially use memory or file based persistence and will allow for easy development and debugging. +Running a Process requires using a "connector" to a supported runtime. As part of the core packages we will include an in-process runtime that is capable of running a process locally on a dev machine or in a server. This runtime will initially use memory or file based persistence and will allow for easy development and debugging. Additionally we will provide support for [Orleans](https://learn.microsoft.com/en-us/dotnet/orleans/overview) and [Dapr Actor](https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview/) based runtimes which will allow customers to easily deploy processes as a distributed and highly scalable cloud based system. diff --git a/docs/decisions/0072-agents-with-memory.md b/docs/decisions/0072-agents-with-memory.md index 79b770a3ed9b..eb8c6a7281ed 100644 --- a/docs/decisions/0072-agents-with-memory.md +++ b/docs/decisions/0072-agents-with-memory.md @@ -68,7 +68,7 @@ Building a service to host an agent comes with challenges. It's hard to build a stateful service, but service consumers expect an experience that looks stateful from the outside. E.g. on each invocation, the user expects that the service can continue a conversation they are having. -This means that where the the service is exposing a local agent with local conversation state management (e.g. via `ChatHistory`) +This means that where the service is exposing a local agent with local conversation state management (e.g. via `ChatHistory`) that conversation state needs to be loaded and persisted for each invocation of the service. It also means that any memory components that may have some in-memory state will need to be loaded and persisted too. diff --git a/dotnet/src/SemanticKernel.UnitTests/Functions/FunctionResultTests.cs b/dotnet/src/SemanticKernel.UnitTests/Functions/FunctionResultTests.cs index 44ba05c5e547..f8f6ff2c9c98 100644 --- a/dotnet/src/SemanticKernel.UnitTests/Functions/FunctionResultTests.cs +++ b/dotnet/src/SemanticKernel.UnitTests/Functions/FunctionResultTests.cs @@ -289,7 +289,7 @@ public void GetValueCanRetrieveMEAITypes() Assert.Same(valueType.Messages[0].Contents[0], target.GetValue()); Assert.Same(valueType.Messages[0].Contents[0], target.GetValue()); - // Check the the content list is returned + // Check the content list is returned Assert.Same(valueType.Messages[0].Contents, target.GetValue>()!); Assert.Same(valueType.Messages[0].Contents[0], target.GetValue>()![0]); Assert.IsType(target.GetValue>()![0]); diff --git a/dotnet/src/SemanticKernel.UnitTests/TemplateEngine/Blocks/CodeBlockTests.cs b/dotnet/src/SemanticKernel.UnitTests/TemplateEngine/Blocks/CodeBlockTests.cs index 34c9f1c7a779..4c7c9b31cb0e 100644 --- a/dotnet/src/SemanticKernel.UnitTests/TemplateEngine/Blocks/CodeBlockTests.cs +++ b/dotnet/src/SemanticKernel.UnitTests/TemplateEngine/Blocks/CodeBlockTests.cs @@ -294,11 +294,11 @@ public async Task ItReturnsArgumentValueAndTypeAsync() var functionWithNamedArgument = new CodeBlock([funcId, namedArgBlock], ""); var variable = new CodeBlock([varBlock], ""); - // Assert function positional argument passed to the the function with no changes + // Assert function positional argument passed to the function with no changes await functionWithPositionedArgument.RenderCodeAsync(this._kernel, new() { ["p1"] = expectedValue, ["var"] = expectedValue }); Assert.Same(expectedValue, canary); // Ensuring that the two variables point to the same object, as there is no other way to verify that the argument has not been transformed from object -> string -> object during the process. - // Assert function named argument passed to the the function with no changes + // Assert function named argument passed to the function with no changes await functionWithNamedArgument.RenderCodeAsync(this._kernel, new() { ["p1"] = expectedValue, ["a1"] = expectedValue }); Assert.Same(expectedValue, canary); diff --git a/python/samples/demos/telemetry/README.md b/python/samples/demos/telemetry/README.md index 97049ec63006..cc56d5fbbb61 100644 --- a/python/samples/demos/telemetry/README.md +++ b/python/samples/demos/telemetry/README.md @@ -70,7 +70,7 @@ Please refer to here on how to analyze metrics in [Azure Monitor](https://learn. > Make sure you have the dashboard running to receive telemetry data. -Once the the sample finishes running, navigate to http://localhost:18888 in a web browser to see the telemetry data. Follow the instructions [here](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/explore) to authenticate to the dashboard and start exploring! +Once the sample finishes running, navigate to http://localhost:18888 in a web browser to see the telemetry data. Follow the instructions [here](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/explore) to authenticate to the dashboard and start exploring! ## Console output diff --git a/python/samples/getting_started_with_agents/chat_completion/step07_kernel_function_strategies.py b/python/samples/getting_started_with_agents/chat_completion/step07_kernel_function_strategies.py index b485aed16ca1..73a091d2f67e 100644 --- a/python/samples/getting_started_with_agents/chat_completion/step07_kernel_function_strategies.py +++ b/python/samples/getting_started_with_agents/chat_completion/step07_kernel_function_strategies.py @@ -85,7 +85,7 @@ async def main(): selection_function = KernelFunctionFromPrompt( function_name="selection", prompt=f""" - Determine which participant takes the next turn in a conversation based on the the most recent participant. + Determine which participant takes the next turn in a conversation based on the most recent participant. State only the name of the participant to take the next turn. No participant should take more than one turn in a row. diff --git a/python/samples/getting_started_with_processes/README.md b/python/samples/getting_started_with_processes/README.md index be9dd899df4a..5c4974ffe781 100644 --- a/python/samples/getting_started_with_processes/README.md +++ b/python/samples/getting_started_with_processes/README.md @@ -119,7 +119,7 @@ The processes in this subsection contain the following modifications/additions t ###### Potato Fries Preparation With Knife Sharpening and Ingredient Stock Process The following processes is a modification on the process [Potato Fries Preparation](#potato-fries-preparation-process) -with the the stateful steps mentioned previously. +with the stateful steps mentioned previously. ``` mermaid flowchart LR @@ -154,7 +154,7 @@ flowchart LR ###### Fried Fish Preparation With Knife Sharpening and Ingredient Stock Process The following process is a modification on the process [Fried Fish Preparation](#fried-fish-preparation-process) -with the the stateful steps mentioned previously. +with the stateful steps mentioned previously. ``` mermaid flowchart LR diff --git a/python/semantic_kernel/core_plugins/sessions_python_tool/README.md b/python/semantic_kernel/core_plugins/sessions_python_tool/README.md index 14d83d9f87bf..354e552012f7 100644 --- a/python/semantic_kernel/core_plugins/sessions_python_tool/README.md +++ b/python/semantic_kernel/core_plugins/sessions_python_tool/README.md @@ -12,7 +12,7 @@ Next, as an environment variable or in the .env file, add the `poolManagementEnd https://eastus.acasessions.io/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroup}}/sessionPools/{{sessionPool}}/python/execute ``` -You can also provide the the `ACA_TOKEN_ENDPOINT` if you want to override the default value of `https://acasessions.io/.default`. If this token endpoint doesn't need to be overridden, then it is +You can also provide the `ACA_TOKEN_ENDPOINT` if you want to override the default value of `https://acasessions.io/.default`. If this token endpoint doesn't need to be overridden, then it is not necessary to include this as an environment variable, in the .env file, or via the plugin's constructor. Please follow the [Azure Container Apps Documentation](https://learn.microsoft.com/en-us/azure/container-apps/sessions-code-interpreter) to review the proper role required to authenticate with the `AsyncTokenCredential`. Next, let's move on to implementing the plugin in code. It is possible to add the code interpreter plugin as follows: diff --git a/python/semantic_kernel/functions/kernel_function.py b/python/semantic_kernel/functions/kernel_function.py index fee32dd437c1..50a7d8124ca5 100644 --- a/python/semantic_kernel/functions/kernel_function.py +++ b/python/semantic_kernel/functions/kernel_function.py @@ -226,7 +226,7 @@ async def __call__( @abstractmethod async def _invoke_internal(self, context: FunctionInvocationContext) -> None: - """Internal invoke method of the the function with the given arguments. + """Internal invoke method of the function with the given arguments. This function should be implemented by the subclass. It relies on updating the context with the result from the function. @@ -298,7 +298,7 @@ async def invoke( @abstractmethod async def _invoke_internal_stream(self, context: FunctionInvocationContext) -> None: - """Internal invoke method of the the function with the given arguments. + """Internal invoke method of the function with the given arguments. The abstract method is defined without async because otherwise the typing fails. A implementation of this function should be async.