Skip to content

Commit 27487b3

Browse files
authored
Merge pull request #269155 from ChenJieting/jieting/custom-package-installation
update how to use custom tool package
2 parents 511e56d + ef93786 commit 27487b3

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To discover more custom tools developed by the open-source community, see [More
3838

3939
## Remarks
4040
- 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).
41-
- To install the custom tools, if you're 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).
41+
- To install the custom tools, if you're using the automatic runtime, you can readily install the publicly released 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. In addition, if you want to use local or private feed package, please build an image first, then set up the runtime based on your image. To learn more, see [How to create and manage a runtime](../create-manage-runtime.md).
4242
:::image type="content" source="../../media/prompt-flow/install-package-on-automatic-runtime.png" alt-text="Screenshot of how to install packages on automatic runtime."lightbox = "../../media/prompt-flow/install-package-on-automatic-runtime.png":::
4343

4444
## Next steps

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

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,14 @@ Your tool package should be a python package. To develop your custom tool, follo
2929

3030
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.
3131

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).
32+
When using automatic runtime, you can readily install the publicly released 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).
3333
:::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":::
3434

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:
36-
37-
### Create customized environment
38-
39-
1. Create a customized environment with docker context.
40-
41-
1. Create a customized environment in Azure Machine Learning studio by going to **Environments** then select **Create**. In the settings tab under *Select environment source*, choose " Create a new docker content."
42-
43-
Currently we support creating environment with "Create a new docker context" environment source. "Use existing docker image with optional conda file" has known [limitation](../how-to-manage-environments-v2.md#create-an-environment-from-a-conda-specification) and isn't supported now.
44-
45-
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/create-customized-environment-step-1.png" alt-text="Screenshot of create environment in Azure Machine Learning studio."lightbox = "./media/how-to-custom-tool-package-creation-and-usage/create-customized-environment-step-1.png":::
46-
47-
1. Under **Customize**, replace the text in the Dockerfile:
48-
49-
```sh
50-
FROM mcr.microsoft.com/azureml/promptflow/promptflow-runtime:latest
51-
RUN pip install my-tools-package==0.0.1
52-
```
53-
54-
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/create-customized-environment-step-2.png" alt-text="Screenshot of create environment in Azure Machine Learning studio on the customize step."lightbox ="./media/how-to-custom-tool-package-creation-and-usage/create-customized-environment-step-2.png":::
55-
56-
It takes several minutes to create the environment. After it succeeded, you can copy the Azure Container Registry (ACR) from environment detail page for the next step.
57-
58-
### Prepare compute instance runtime
59-
60-
1. Create a compute instance runtime using the customized environment created in step 2.
61-
1. Create a new compute instance. Existing compute instance created long time ago can possibly hit unexpected issue.
62-
2. Create runtime on CI with customized environment.
63-
64-
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/create-runtime-on-compute-instance.png" alt-text="Screenshot of add compute instance runtime in Azure Machine Learning studio."lightbox ="./media/how-to-custom-tool-package-creation-and-usage/create-runtime-on-compute-instance.png":::
35+
Another method is applicable for not only publicly released packages, but also local or private feed packages. Firstly you should build an image following the two steps in [how to customize environment](./how-to-customize-environment-runtime.md#customize-environment-with-docker-context-for-runtime), and then [change the base image for automatic runtime](./how-to-create-manage-runtime.md#change-the-base-image-for-automatic-runtime-preview) or [create a compute instance runtime based on your customized environment](./how-to-create-manage-runtime.md#create-a-compute-instance-runtime-on-a-runtime-page).
6536

6637
## Test from prompt flow UI
6738
1. Create a standard flow.
68-
2. Select the correct runtime ("my-tool-runtime") and add your tools.
39+
2. Select the correct runtime and add your tools.
6940
:::image type="content" source="./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui-step-1.png" alt-text="Screenshot of flow in Azure Machine Learning studio showing the runtime and more tools dropdown."lightbox ="./media/how-to-custom-tool-package-creation-and-usage/test-customer-tool-on-ui-step-1.png":::
7041
3. Change flow based on your requirements and run flow in the selected runtime.
7142
:::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":::

0 commit comments

Comments
 (0)