From c57206bfa26c5af32d2646b230c9ed5520580d24 Mon Sep 17 00:00:00 2001 From: Devis Lucato Date: Wed, 23 Apr 2025 12:08:14 -0700 Subject: [PATCH 1/2] Doc typos/updates --- runtime/prompty/README.md | 2 +- runtime/promptycs/Prompty.Core/Prompty.cs | 2 +- runtime/promptycs/Tests/chat.prompty | 2 +- runtime/promptyjs/tests/prompts/basic.mustache.prompty | 2 +- .../tests/prompts/basic.mustache.prompty.parsed.json | 2 +- runtime/promptyjs/tests/prompts/basic.prompty | 2 +- runtime/promptyjs/tests/prompts/basic.prompty.parsed.json | 2 +- web/docs/contributing/page.mdx | 2 +- web/docs/getting-started/concepts/page.mdx | 2 +- web/docs/getting-started/debugging-prompty/page.mdx | 2 +- web/docs/guides/prompty-observability/page.mdx | 2 +- web/docs/tutorials/using-langchain/page.mdx | 2 +- web/docs/tutorials/using-semantic-kernel/page.mdx | 6 +++--- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/runtime/prompty/README.md b/runtime/prompty/README.md index 5508f51d..be265507 100644 --- a/runtime/prompty/README.md +++ b/runtime/prompty/README.md @@ -132,7 +132,7 @@ class SimplePromptyTracer: json.dump(trace, f, indent=4) ``` -The tracing mechanism is supported for all of the prompty runtime internals and can be used to trace the execution of the prompt along with all of the paramters. There is also a `@trace` decorator that can be used to trace the execution of any function external to the runtime. This is provided as a facility to trace the execution of the prompt and whatever supporting code you have. +The tracing mechanism is supported for all of the prompty runtime internals and can be used to trace the execution of the prompt along with all of the parameters. There is also a `@trace` decorator that can be used to trace the execution of any function external to the runtime. This is provided as a facility to trace the execution of the prompt and whatever supporting code you have. ```python import prompty diff --git a/runtime/promptycs/Prompty.Core/Prompty.cs b/runtime/promptycs/Prompty.Core/Prompty.cs index dea9d013..3ff0f954 100644 --- a/runtime/promptycs/Prompty.Core/Prompty.cs +++ b/runtime/promptycs/Prompty.Core/Prompty.cs @@ -47,7 +47,7 @@ public static async Task LoadAsync(string path, string configuration = /// Load a prompty file using the provided text content. /// /// Id of the configuration to use. - /// Global configuration to use. + /// Global configuration to use. /// Optional: File path to the prompty file. public static Prompty Load(string text, Dictionary globalConfig, string? path = null) { diff --git a/runtime/promptycs/Tests/chat.prompty b/runtime/promptycs/Tests/chat.prompty index dc56c0bd..8b08b825 100644 --- a/runtime/promptycs/Tests/chat.prompty +++ b/runtime/promptycs/Tests/chat.prompty @@ -1,6 +1,6 @@ --- name: Contoso Chat Prompt -description: A retail assistent for Contoso Outdoors products retailer. +description: A retail assistant for Contoso Outdoors products retailer. authors: - Cassie Breviu model: diff --git a/runtime/promptyjs/tests/prompts/basic.mustache.prompty b/runtime/promptyjs/tests/prompts/basic.mustache.prompty index cd225ca6..8d6e272d 100644 --- a/runtime/promptyjs/tests/prompts/basic.mustache.prompty +++ b/runtime/promptyjs/tests/prompts/basic.mustache.prompty @@ -37,7 +37,7 @@ You are helping {{firstName}} to find answers to their questions. Use their name to address them in your responses. # context -Use the follow contex to provide a more personalized response to {{firstName}}: +Use the follow context to provide a more personalized response to {{firstName}}: {{context}} {{#chat_history}} diff --git a/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json b/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json index 5edc0ef8..88070f51 100644 --- a/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json +++ b/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json @@ -1,7 +1,7 @@ [ { "role": "system", - "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow contex to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" + "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" }, { "role": "assistant", diff --git a/runtime/promptyjs/tests/prompts/basic.prompty b/runtime/promptyjs/tests/prompts/basic.prompty index efff070f..fc78f5d1 100644 --- a/runtime/promptyjs/tests/prompts/basic.prompty +++ b/runtime/promptyjs/tests/prompts/basic.prompty @@ -31,7 +31,7 @@ You are helping {{firstName}} to find answers to their questions. Use their name to address them in your responses. # context -Use the follow contex to provide a more personalized response to {{firstName}}: +Use the follow context to provide a more personalized response to {{firstName}}: {{context}} user: diff --git a/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json b/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json index 545cd9cd..a10f5e5d 100644 --- a/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json +++ b/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json @@ -1,7 +1,7 @@ [ { "role": "system", - "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow contex to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" + "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" }, { "role": "user", diff --git a/web/docs/contributing/page.mdx b/web/docs/contributing/page.mdx index 6120d4c3..2cddaa01 100644 --- a/web/docs/contributing/page.mdx +++ b/web/docs/contributing/page.mdx @@ -14,7 +14,7 @@ tags: [Prompty](https://github.com/microsoft/prompty) is an open-source project from Microsoft that makes it easy for developers to _create, manage, debug, and evaluate_ LLM prompts for generative AI applications. We welcome contributions from the community that can help make the technology more useful, and usable, by developers from all backgrounds. Before you get started, review this page for contributor guidelines. ## Code Of Conduct -Read the project's [Code of Conduct](https://github.com/microsoft/prompty/blob/main/CODE_OF_CONDUCT.md) and adhere to it. The project is alse governed by the Microsoft Open Source Code of Conduct - [Read their FAQ](https://opensource.microsoft.com/codeofconduct/faq/) to learn why the CoC matters and how you can raise concerns or provide feedback. +Read the project's [Code of Conduct](https://github.com/microsoft/prompty/blob/main/CODE_OF_CONDUCT.md) and adhere to it. The project is also governed by the Microsoft Open Source Code of Conduct - [Read their FAQ](https://opensource.microsoft.com/codeofconduct/faq/) to learn why the CoC matters and how you can raise concerns or provide feedback. ## Providing feedback diff --git a/web/docs/getting-started/concepts/page.mdx b/web/docs/getting-started/concepts/page.mdx index d046b3d5..a1712b22 100644 --- a/web/docs/getting-started/concepts/page.mdx +++ b/web/docs/getting-started/concepts/page.mdx @@ -67,7 +67,7 @@ The [Prompty specification](https://github.com/microsoft/prompty/blob/main/Promp ### 1.2 The Prompty Tooling -The [Prompty Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.prompty) helps you create, manage, and execute, your `.prompty` assets - effectively giving you a _playground_ right in your editor, to streamline your prompt engineering workflow and speed up your prototype iterations. We'll get hands-on experience with this in the [Tutorials](/docs/tutorials) section. For now, click to expand the section and get an intutive sense for how this enhances your developer experience. +The [Prompty Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.prompty) helps you create, manage, and execute, your `.prompty` assets - effectively giving you a _playground_ right in your editor, to streamline your prompt engineering workflow and speed up your prototype iterations. We'll get hands-on experience with this in the [Tutorials](/docs/tutorials) section. For now, click to expand the section and get an intuitive sense for how this enhances your developer experience.
**Learn More**: The Prompty Visual Studio Code Extension diff --git a/web/docs/getting-started/debugging-prompty/page.mdx b/web/docs/getting-started/debugging-prompty/page.mdx index 3254c2b2..c355b330 100644 --- a/web/docs/getting-started/debugging-prompty/page.mdx +++ b/web/docs/getting-started/debugging-prompty/page.mdx @@ -120,7 +120,7 @@ The trace output is divided into three: _load, prepare_ and _run_. Load refers t ![Trace Output](trace-output.png) -From the trace output, you can see the inputs, outputs and metrics such as time to execute the prompt and tokens. This information can be used to debug and fix any issues in your code. For example, we can see output has been truncated and the `Completion Tokens` count is less than 1000, which might not be sufficent for the prompt to generate different outputs. We can increase the `max_tokens` in our Prompty to 1000 to generate more tokens. Once done, run the code again and confirm you get 5 examples of the short message inviting friends to a Game Night. +From the trace output, you can see the inputs, outputs and metrics such as time to execute the prompt and tokens. This information can be used to debug and fix any issues in your code. For example, we can see output has been truncated and the `Completion Tokens` count is less than 1000, which might not be sufficient for the prompt to generate different outputs. We can increase the `max_tokens` in our Prompty to 1000 to generate more tokens. Once done, run the code again and confirm you get 5 examples of the short message inviting friends to a Game Night. ![updated trace output](trace-bug-fixed.png) diff --git a/web/docs/guides/prompty-observability/page.mdx b/web/docs/guides/prompty-observability/page.mdx index 7c303e1d..de2e1ad7 100644 --- a/web/docs/guides/prompty-observability/page.mdx +++ b/web/docs/guides/prompty-observability/page.mdx @@ -68,7 +68,7 @@ class SimplePromptyTracer: json.dump(trace, f, indent=4) ``` -The tracing mechanism is supported for all of the prompty runtime internals and can be used to trace the execution of the prompt along with all of the paramters. There is also a `@trace` decorator that can be used to trace the execution of any function external to the runtime. This is provided as a facility to trace the execution of the prompt and whatever supporting code you have. +The tracing mechanism is supported for all of the prompty runtime internals and can be used to trace the execution of the prompt along with all of the parameters. There is also a `@trace` decorator that can be used to trace the execution of any function external to the runtime. This is provided as a facility to trace the execution of the prompt and whatever supporting code you have. ```python import prompty diff --git a/web/docs/tutorials/using-langchain/page.mdx b/web/docs/tutorials/using-langchain/page.mdx index 1f7215fc..5196cf54 100644 --- a/web/docs/tutorials/using-langchain/page.mdx +++ b/web/docs/tutorials/using-langchain/page.mdx @@ -17,7 +17,7 @@ This guide explains how to use Prompty templates with the [LangChain framework]( ## What is LangChain -[LangChain](https://python.langchain.com/docs/introduction/) is a composable framework for building context-aware, reasoning applications pwoered by large language models, and using your organization's data and APIs. It has an [extensive set of integrations](https://python.langchain.com/docs/integrations/providers/) with both plaforms ([like AzureAI](https://python.langchain.com/api_reference/azure_ai/)) and tools (like [Prompty](https://python.langchain.com/docs/integrations/providers/microsoft/)) - allowing you to work seamlessly with a diverse set of model providers and integrations. +[LangChain](https://python.langchain.com/docs/introduction/) is a composable framework for building context-aware, reasoning applications pwoered by large language models, and using your organization's data and APIs. It has an [extensive set of integrations](https://python.langchain.com/docs/integrations/providers/) with both platforms ([like AzureAI](https://python.langchain.com/api_reference/azure_ai/)) and tools (like [Prompty](https://python.langchain.com/docs/integrations/providers/microsoft/)) - allowing you to work seamlessly with a diverse set of model providers and integrations. > Explore these resources · [Microsoft Integrations](https://python.langchain.com/docs/integrations/providers/microsoft/) · [`langchain-prompty` docs](https://python.langchain.com/api_reference/prompty/) · [`langchain-prompty` package](https://pypi.org/project/langchain-prompty/) · [`langchain-prompty` source](https://github.com/langchain-ai/langchain/tree/master/libs/partners/prompty) diff --git a/web/docs/tutorials/using-semantic-kernel/page.mdx b/web/docs/tutorials/using-semantic-kernel/page.mdx index 343c615d..276047d3 100644 --- a/web/docs/tutorials/using-semantic-kernel/page.mdx +++ b/web/docs/tutorials/using-semantic-kernel/page.mdx @@ -35,13 +35,13 @@ The "Advanced" code example below explains how this can be used to populate rele ## Prerequisites -1. **Install [Microsoft.SemanticKernel.Prompty (Alpha)](https://www.nuget.org/packages/Microsoft.SemanticKernel.Prompty/1.24.1-alpha) package** with this command: +1. **Install [Microsoft.SemanticKernel.Prompty (Beta)](https://www.nuget.org/packages/Microsoft.SemanticKernel.Prompty/1.47.0-beta) package** with this command: ``` - dotnet add package Microsoft.SemanticKernel.Prompty --version 1.24.1-alpha + dotnet add package Microsoft.SemanticKernel.Prompty --version 1.47.0-beta ``` -1. **Setup Semantic Kernel and configure it**. Follow the [Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/get-started/quick-start-guide?pivots=programming-language-csharp) quickstart for guidance if you are new to this framework. +1. **Setup Semantic Kernel and configure it**. Follow the [Semantic Kernel](https://learn.microsoft.com/semantic-kernel/get-started/quick-start-guide?pivots=programming-language-csharp) quickstart for guidance if you are new to this framework. --- From b67b0ead54887b6512fda0c20a3860e28c7cc54d Mon Sep 17 00:00:00 2001 From: Devis Lucato Date: Wed, 23 Apr 2025 12:10:26 -0700 Subject: [PATCH 2/2] =?UTF-8?q?=E2=80=9Cfollowing=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/promptyjs/tests/prompts/basic.mustache.prompty | 2 +- .../promptyjs/tests/prompts/basic.mustache.prompty.parsed.json | 2 +- runtime/promptyjs/tests/prompts/basic.prompty | 2 +- runtime/promptyjs/tests/prompts/basic.prompty.parsed.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/promptyjs/tests/prompts/basic.mustache.prompty b/runtime/promptyjs/tests/prompts/basic.mustache.prompty index 8d6e272d..5a58a44a 100644 --- a/runtime/promptyjs/tests/prompts/basic.mustache.prompty +++ b/runtime/promptyjs/tests/prompts/basic.mustache.prompty @@ -37,7 +37,7 @@ You are helping {{firstName}} to find answers to their questions. Use their name to address them in your responses. # context -Use the follow context to provide a more personalized response to {{firstName}}: +Use the following context to provide a more personalized response to {{firstName}}: {{context}} {{#chat_history}} diff --git a/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json b/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json index 88070f51..855ec781 100644 --- a/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json +++ b/runtime/promptyjs/tests/prompts/basic.mustache.prompty.parsed.json @@ -1,7 +1,7 @@ [ { "role": "system", - "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" + "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the following context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" }, { "role": "assistant", diff --git a/runtime/promptyjs/tests/prompts/basic.prompty b/runtime/promptyjs/tests/prompts/basic.prompty index fc78f5d1..47100206 100644 --- a/runtime/promptyjs/tests/prompts/basic.prompty +++ b/runtime/promptyjs/tests/prompts/basic.prompty @@ -31,7 +31,7 @@ You are helping {{firstName}} to find answers to their questions. Use their name to address them in your responses. # context -Use the follow context to provide a more personalized response to {{firstName}}: +Use the following context to provide a more personalized response to {{firstName}}: {{context}} user: diff --git a/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json b/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json index a10f5e5d..fa09ec66 100644 --- a/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json +++ b/runtime/promptyjs/tests/prompts/basic.prompty.parsed.json @@ -1,7 +1,7 @@ [ { "role": "system", - "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the follow context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" + "content": "You are an AI assistant who helps people find information. As the assistant, \nyou answer questions briefly, succinctly, and in a personable manner using \nmarkdown and even add some personal flair with appropriate emojis.\n\n# Customer\nYou are helping Seth to find answers to their questions.\nUse their name to address them in your responses.\n\n# context\nUse the following context to provide a more personalized response to Seth:\nThe Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature!" }, { "role": "user",