Skip to content

Commit

Permalink
remove promptflow-sdk references (microsoft#161)
Browse files Browse the repository at this point in the history
With `promptflow` package decoupled from previous `promptflow-sdk`
entirely, need to remove all references of previous package.
  • Loading branch information
chjinche authored Aug 29, 2023
1 parent 1345b75 commit f39166e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/tools_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,13 @@ jobs:
echo "No changes detected in src/promptflow-tools/"
echo "run_tests=false" >> $GITHUB_OUTPUT
fi
# Eventually only pip install promptflow and uninstall promptflow-sdk
# Install local build promptflow package to ensure some cross-package changes are working
- name: Setup
if: steps.check_changes.outputs.run_tests == 'true'
run: |
python -m pip install --upgrade pip
pip install promptflow-sdk --extra-index-url https://azuremlsdktestpypi.azureedge.net/promptflow/
echo "Local build and install promptflow"
cd src/promptflow
python ./setup.py bdist_wheel
pip install './dist/promptflow-0.0.1-py3-none-any.whl'
pip install pytest
pip install pytest_mock
pip install azure-identity
pip install azure-keyvault-secrets
pip install promptflow
pip install pytest pytest_mock
pip install azure-identity azure-keyvault-secrets
- name: Generate configs
if: steps.check_changes.outputs.run_tests == 'true'
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ cython_debug/
connection.json
.env
.azureml
# dummy custom tool package example
hello-world-proj/**
# secrets
**/connections.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ Your tool package should be a python package. To try it quickly, just use [my-to
### Prerequisites
Create a new conda environment using python 3.9 or 3.10. Run below command to install PromptFlow dependencies:
```
# eventually only need to install promptflow
pip install promptflow-sdk promptflow --extra-index-url https://azuremlsdktestpypi.azureedge.net/promptflow/
pip install promptflow
```
Install Pytest packages for running tests:
```
pip install pytest
pip install pytest-mock
pip install pytest pytest-mock
```
Clone the PromptFlow repository from GitHub using the following command:
```
Expand Down Expand Up @@ -57,7 +55,7 @@ hello-world-proj/
```The points outlined below explain the purpose of each folder/file in the package. If your aim is to develop multiple tools within your package, please make sure to closely examine point 2 and 5.```

1. **hello-world-proj**: This is the source directory. All of your project's source code should be placed in this directory.
2. **hello-world/tools**: This directory contains the individual tools for your project. You tool package can contain either one tool or many tools. When adding a new tool, you should create another *_tool.py under the `tools` folder.
2. **hello-world/tools**: This directory contains the individual tools for your project. Your tool package can contain either one tool or many tools. When adding a new tool, you should create another *_tool.py under the `tools` folder.
3. **hello-world/tools/hello_world_tool.py**: Develop your tool within the def function. Use the `@tool` decorator to identify the function as a tool.
> [!Note] There are two ways to write a tool. The default and recommended way is the function implemented way. You can also use the class implementation way, referring to [my_tool_2.py](https://github.com/microsoft/promptflow/blob/main/examples/tools/tool-package-quickstart/my_tool_package/tools/my_tool_2.py) as an example.
4. **hello-world/tools/utils.py**: This file implements the tool list method, which collects all the tools defined. It is required to have this tool list method, as it allows the User Interface (UI) to retrieve your tools and display them within the UI.
Expand Down

0 comments on commit f39166e

Please sign in to comment.