-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc to guide user on how to share flow examples within an organization scope #818
Changes from 9 commits
5f2e703
0ad7ae5
4ab3e64
c78bee4
89b66b7
dec3c19
65bf842
7828949
2689a90
4b6441c
09d99ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Flow Example Sharing in Organization | ||
|
||
:::{admonition} Experimental feature | ||
This is an experimental feature, and may change at any time. Learn [more](../../how-to-guides/faq.md#stable-vs-experimental). | ||
::: | ||
|
||
In this document, we will walk you through the steps to share your flow in an organization scope. This needs to register your flow as a model with some specific properties in an organization registry. Once completed, the model will be shown as a flow example in workspace portal. | ||
|
||
## Share flow as a model in an organization registry | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Registering flow in AzureML Registry |
||
|
||
### Prepare a `readme.md` file for the flow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
To make the flow easily understand, it is better to include an `readme.md` file for the flow in the flow folder. Here we'll use [this existing readme](https://github.com/microsoft/promptflow/blob/main/examples/flows/chat/chat-with-wikipedia/README.md) as an example, the readme file may include following sections: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make the flow easily understandable, include a README.md file in the flow folder explaining how to use it. The README may contain: See this example README with sections covering xxx. A good README improves discoverability and enables collaboration. |
||
- The purpose of the flow. | ||
- The tools utilized in the flow. | ||
- The prerequisites required to execute the flow. | ||
- What knowledge can be gained from this flow. | ||
- Any other information you wish to share about your flow. | ||
|
||
### Prepare a model yaml for the flow | ||
dorisjoy marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preparing flow metadata for gallery |
||
|
||
In this section, we will focus on the model properties related to the UI display of this flow. For details on other model fields, please refer to [model yaml schema](https://learn.microsoft.com/en-us/azure/machine-learning/reference-yaml-model?view=azureml-api-2). Below is a `model.yml` template for flow: | ||
|
||
```yaml | ||
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json | ||
name: <model_name> | ||
type: custom_model | ||
path: <the relative path from this model file to the flow folder> | ||
description: <model_description> | ||
version: <model_version> | ||
properties: | ||
is-promptflow: true | ||
azureml.promptflow.section: gallery | ||
azureml.promptflow.type: <flow_type> | ||
azureml.promptflow.name: <flow_name> | ||
azureml.promptflow.description: <flow_description> | ||
``` | ||
|
||
Properties released to UI display of this flow: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flow properties displayed in the UI: |
||
1. `is-promptflow`: value should always be `true`. This property distinguishes it from other models, enabling promptflow service to filter it out. | ||
2. `azureml.promptflow.section`: value should always be `gallery`. This property indicates UI that this flow needs to be shown in the Flow Gallery. | ||
3. `azureml.promptflow.type`: value can be `chat`, `standard` or `evaluate`. This property identifies the type of your flow, and the UI will display different types of flows under different tabs accordingly. | ||
dorisjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
4. `azureml.promptflow.name`: the name of the flow which will be shown as the flow name in the Flow Gallery. | ||
5. `azureml.promptflow.description`: the description of the flow which will be shown as flow description in the Flow Gallery. | ||
|
||
Take [this existing flow](https://github.com/microsoft/promptflow/tree/main/examples/flows/chat/chat-with-wikipedia) as an example, the `model.yml` for it will look like below: | ||
```yaml | ||
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json | ||
name: chat-with-wikipedia-in-org | ||
type: custom_model | ||
path: chat_with_wikipedia | ||
description: promptflow flow registered as a custom model | ||
version: 1 | ||
properties: | ||
is-promptflow: true | ||
azureml.promptflow.section: gallery | ||
azureml.promptflow.type: chat | ||
azureml.promptflow.name: Chat with Wikipedia in Org | ||
azureml.promptflow.description: ChatGPT-based chatbot that leverages Wikipedia data to ground the responses. | ||
``` | ||
|
||
### Register the model in an organization registry | ||
dorisjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Run the command below to register the flow as a model to an organization registry: | ||
``` | ||
az ml model create -f model.yml --registry-name <organization-registry-name> | ||
``` | ||
|
||
> [!Note] More details about [registry creation](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-registries?view=azureml-api-2&tabs=studio#create-a-registry) and [model creation](https://learn.microsoft.com/en-us/cli/azure/ml/model?view=azure-cli-latest#az-ml-model-create) | ||
dorisjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Locate the flow in the Flow Gallery | ||
|
||
- Open a workspace in a region supported by the organization registry. | ||
- Click the `Create` button to open the Flow Gallery, and you can find the flow registered before: | ||
|
||
![organization examples in flow gallery](../../media/cloud/azureml/org_examples_in_flow_gallery.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can customer identity whether the flow is from system registry or org registry? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Customer cannot identity whether the flow is from system registry or org registry since there is no any UI indicator for this. |
||
|
||
1. `azureml.promptflow.type`: flows with `evaluate` value will be displayed under the 'Evaluation' tab, while flows with other values will appear under the 'Flow' tab. | ||
2. `azureml.promptflow.name`: shown as flow name in the flow card. | ||
3. `azureml.promptflow.description`: shown as flow description in the flow card. | ||
4. `readme.md`: click the `View detail` button will show the content in the `readme.md`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this: # Sharing Your Flows in Prompt Flow Gallery