Skip to content

Commit d58884c

Browse files
authored
Merge pull request #264464 from ChenJieting/jieting/update_tool_usage
update doc regarding how to install tool packages
2 parents ede8365 + 6140955 commit d58884c

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed
Loading

articles/ai-studio/how-to/prompt-flow-tools/prompt-flow-tools-overview.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ author: lgayhardt
1515

1616
[!INCLUDE [Azure AI Studio preview](../../includes/preview-ai-studio.md)]
1717

18-
The following table provides an index of tools in prompt flow. If existing tools don't meet your requirements, you can [develop your own custom tool and make a tool package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html).
18+
The following table provides an index of tools in prompt flow.
1919

2020
| Tool name | Description | Environment | Package name |
2121
|------|-----------|-------------|--------------|
@@ -32,6 +32,11 @@ The following table provides an index of tools in prompt flow. If existing tools
3232

3333
To discover more custom tools developed by the open-source community, see [More custom tools](https://microsoft.github.io/promptflow/integrations/tools/index.html).
3434

35+
## Remarks
36+
- If existing tools don't meet your requirements, you can [develop your own custom tool and make a tool package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html).
37+
- To install the custom tools, if you are using the automatic runtime, you can readily install the package by adding the custom tool package name into the `requirements.txt` file in the flow folder. Then select the **Save and install** button to start installation. After completion, you can see the custom tools displayed in the tool list. To learn more, see [How to create and manage a runtime](../create-manage-runtime.md).
38+
:::image type="content" source="./media/prompt-flow-tools-overview/install-package-on-automatic-runtime.png" alt-text="Screenshot of how to install packages on automatic runtime."lightbox = "./media/prompt-flow-tools-overview/install-package-on-automatic-runtime.png":::
39+
3540
## Next steps
3641

3742
- [Create a flow](../flow-develop.md)

articles/machine-learning/prompt-flow/how-to-custom-tool-package-creation-and-usage.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@ ms.date: 09/12/2023
1616

1717
# Custom tool package creation and usage
1818

19-
When developing flows, you can not only use the built-in tools provided by prompt flow, but also develop your own custom tool. In this document, we guide you through the process of developing your own tool package, offering detailed steps and advice on how to utilize your creation.
19+
When developing flows, you can not only use the built-in tools provided by prompt flow, but also develop your own custom tool. In this document, we guide you through the process of developing your own tool package, offering detailed steps and advice on how to utilize the custom tool package.
2020

2121
After successful installation, your custom "tool" can show up in the tool list:
2222
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui.png" alt-text="Screenshot of custom tools in the UI tool list."lightbox = "./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui.png":::
2323

2424
## Create your own tool package
2525

26-
Your tool package should be a python package. To develop your custom tool, follow the steps **Create your own tool package** and **build and share the tool package** in [Create and Use Tool package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html). You can also [Add a tool icon](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/add-a-tool-icon.html) and [Add Category and tags](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/add-category-and-tags-for-tool.html) for your tool.
26+
Your tool package should be a python package. To develop your custom tool, follow the steps **Create your own tool package** and **build and share the tool package** in [Create and Use Tool Package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html). You can find more advanced development guidance in [How to develop a tool](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/index.html).
2727

2828
## Prepare runtime
2929

30-
To add the custom tool to your tool list, it's necessary to create a runtime, which is based on a customized environment where your custom tool is preinstalled. Here we use [my-tools-package](https://pypi.org/project/my-tools-package/) as an example to prepare the runtime.
30+
In order to add the custom tool to your tool list for use, it's necessary to prepare the runtime. Here we use [my-tools-package](https://pypi.org/project/my-tools-package/) as an example.
31+
32+
**If you use the automatic runtime**, you can readily install the package by adding the custom tool package name into the `requirements.txt` file in the flow folder. Then select the 'Save and install' button to start installation. After completion, you can see the custom tools displayed in the tool list. To learn more, see [How to create and manage runtime](./how-to-create-manage-runtime.md).
33+
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/install-package-on-automatic-runtime.png" alt-text="Screenshot of how to install packages on automatic runtime."lightbox = "./media/how-to-custom-tool-package-creation-and-usage/install-package-on-automatic-runtime.png":::
34+
35+
**If you use the compute instance runtime**, which should be based on a customized environment where your custom tool is preinstalled, please take the following steps:
3136

3237
### Create customized environment
3338

@@ -65,23 +70,21 @@ To add the custom tool to your tool list, it's necessary to create a runtime, wh
6570
3. Change flow based on your requirements and run flow in the selected runtime.
6671
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui-step-2.png" alt-text="Screenshot of flow in Azure Machine Learning studio showing adding a tool."lightbox ="./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui-step-2.png":::
6772

68-
## Test from VS Code extension
69-
73+
## FAQ
74+
### How to install the custom tool package in the VS Code extension?
7075
1. Install prompt flow for VS Code extension
7176
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/prompt-flow-vs-code-extension.png" alt-text="Screenshot of prompt flow VS Code extension."lightbox ="./media/how-to-custom-tool-package-creation-and-usage/prompt-flow-vs-code-extension.png":::
72-
2. Go to terminal and install your tool package in conda environment of the extension. Assume your conda env name is `prompt-flow`.
77+
2. Go to terminal and install the tool package in conda environment of the extension. Assume your conda env name is `prompt-flow`.
7378

7479
```sh
7580
(local_test) PS D:\projects\promptflow\tool-package-quickstart> conda activate prompt-flow
76-
(prompt-flow) PS D:\projects\promptflow\tool-package-quickstart> pip install .\dist\my_tools_package-0.0.1-py3-none-any.whl
81+
(prompt-flow) PS D:\projects\promptflow\tool-package-quickstart> pip install my-tools-package==0.0.1
7782
```
7883

7984
3. Go to the extension and open one flow folder. Select 'flow.dag.yaml' and preview the flow. Next, select `+` button and you can see your tools. You need to **reload the windows** to clean previous cache if you don't see your tool in the list.
8085
8186
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/auto-list-tool-in-extension.png" alt-text="Screenshot of the VS Code showing the tools." lightbox ="./media/how-to-custom-tool-package-creation-and-usage/auto-list-tool-in-extension.png":::
8287
83-
## FAQ
84-
8588
### Why is my custom tool not showing up in the UI?
8689
You can test your tool package using the following script to ensure that you've packaged your tool YAML files and configured the package tool entry point correctly.
8790

Loading

articles/machine-learning/prompt-flow/tools-reference/overview.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ ms.date: 10/24/2023
1515
---
1616

1717
# Overview of tools in prompt flow
18+
This page provides an overview of the tools that are available in prompt flow. It also offers instructions on how to create your own custom tool and how to install custom tools.
1819

19-
The following table provides an index of tools in prompt flow. If existing tools don't meet your requirements, you can [develop your own custom tool and make a tool package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html).
20+
21+
## An index of tools
22+
The following table shows an index of tools in prompt flow.
2023

2124
| Tool name | Description | Environment | Package name |
2225
|------|-----------|-------------|--------------|
@@ -32,6 +35,9 @@ The following table provides an index of tools in prompt flow. If existing tools
3235
| [Vector DB Lookup](./vector-db-lookup-tool.md) | Searches a vector-based query from existing vector database. | Default | [promptflow-vectordb](https://pypi.org/project/promptflow-vectordb/) |
3336
| [Vector Index Lookup](./vector-index-lookup-tool.md) | Searches text or a vector-based query from Azure Machine Learning vector index. | Default | [promptflow-vectordb](https://pypi.org/project/promptflow-vectordb/) |
3437

35-
To discover more custom tools developed by the open-source community, see [More custom tools](https://microsoft.github.io/promptflow/integrations/tools/index.html).
36-
37-
For the tools to use in the custom environment, see [Custom tool package creation and usage](../how-to-custom-tool-package-creation-and-usage.md#prepare-runtime) to prepare the runtime. Then the tools can be displayed in the tool list.
38+
To discover more custom tools developed by the open-source community, see [More custom tools](https://microsoft.github.io/promptflow/integrations/tools/index.html).
39+
40+
41+
## Remarks
42+
- If existing tools don't meet your requirements, you can [develop your own custom tool and make a tool package](https://microsoft.github.io/promptflow/how-to-guides/develop-a-tool/create-and-use-tool-package.html).
43+
- To install custom tools or add more tools to the custom environment, see [Custom tool package creation and usage](../how-to-custom-tool-package-creation-and-usage.md#prepare-runtime) to prepare the runtime. Then the tools can be displayed in the tool list.

0 commit comments

Comments
 (0)