From 1e2d104933b44d7e5f175e1ba16c1a10683387bf Mon Sep 17 00:00:00 2001 From: Yao <46446115+16oeahr@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:00:13 +0800 Subject: [PATCH] [doc] Fix script path and remove useless file for custom tool package guidance. (#320) # Description 1. Remove useless file output.yaml in tool package example 2. Fix relative path to absolute path in custom tool guidance # All Promptflow Contribution checklist: - [X] **The pull request does not introduce [breaking changes]** - [X] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [X] **I have read the [contribution guidelines](../CONTRIBUTING.md).** ## General Guidelines and Best Practices - [X] Title of the pull request is clear and informative. - [X] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [X] Pull request includes test coverage for the included changes. --- .../how-to-create-and-use-your-own-tool-package.md | 8 ++++---- .../my_tool_package/yamls/output.yaml | 12 ------------ 2 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 examples/tools/tool-package-quickstart/my_tool_package/yamls/output.yaml diff --git a/docs/how-to-guides/how-to-create-and-use-your-own-tool-package.md b/docs/how-to-guides/how-to-create-and-use-your-own-tool-package.md index bd2d25f81ae..5e36d3057f3 100644 --- a/docs/how-to-guides/how-to-create-and-use-your-own-tool-package.md +++ b/docs/how-to-guides/how-to-create-and-use-your-own-tool-package.md @@ -21,11 +21,11 @@ git clone https://github.com/microsoft/promptflow.git ### Create custom tool package Run below command under root folder to create your tool project quickly: ``` -python scripts\tool\generate_tool_package_template.py --destination --package-name --tool-name --function-name +python \tool\generate_tool_package_template.py --destination --package-name --tool-name --function-name ``` For example: ``` -python scripts\tool\generate_tool_package_template.py --destination hello-world-proj --package-name hello-world --tool-name hello_world_tool --function-name get_greeting_message +python D:\proj\github\promptflow\scripts\tool\generate_tool_package_template.py --destination hello-world-proj --package-name hello-world --tool-name hello_world_tool --function-name get_greeting_message ``` This auto-generated script will create one tool for you. The parameters _destination_ and _package-name_ are mandatory. The parameters _tool-name_ and _function-name_ are optional. If left unfilled, the _tool-name_ will default to _hello_world_tool_, and the _function-name_ will default to _tool-name_. @@ -64,11 +64,11 @@ hello-world-proj/ > [!Note] If you create a new tool, don't forget to also create the corresponding tool YAML. You can run below command under your tool project to auto generate your tool YAML. You may want to specify `-n` for `name` and `-d` for `description`, which would be displayed as the tool name and tooltip in prompt flow UI. ``` - python ..\scripts\tool\generate_package_tool_meta.py -m -o -n -d + python \tool\generate_package_tool_meta.py -m -o -n -d ``` For example: ``` - python ..\scripts\tool\generate_package_tool_meta.py -m hello_world.tools.hello_world_tool -o hello_world\yamls\hello_world_tool.yaml -n "Hello World Tool" -d "This is my hello world tool." + python D:\proj\github\promptflow\scripts\tool\generate_package_tool_meta.py -m hello_world.tools.hello_world_tool -o hello_world\yamls\hello_world_tool.yaml -n "Hello World Tool" -d "This is my hello world tool." ``` To populate your tool module, adhere to the pattern \.tools.\, which represents the folder path to your tool within the package. 6. **tests**: This directory contains all your tests, though they are not required for creating your custom tool package. When adding a new tool, you can also create corresponding tests and place them in this directory. Run below command under your tool project: diff --git a/examples/tools/tool-package-quickstart/my_tool_package/yamls/output.yaml b/examples/tools/tool-package-quickstart/my_tool_package/yamls/output.yaml deleted file mode 100644 index ad625c8d669..00000000000 --- a/examples/tools/tool-package-quickstart/my_tool_package/yamls/output.yaml +++ /dev/null @@ -1,12 +0,0 @@ -my_tool_package.tools.my_tool_1.my_tool: - function: my_tool - inputs: - connection: - type: - - CustomConnection - input_text: - type: - - string - module: my_tool_package.tools.my_tool_1 - name: my_tool - type: python