Skip to content

Commit b8e56c6

Browse files
authored
Merge branch 'main' into release/promptflow/1.15.0.post1
2 parents 18d49d1 + 3cde352 commit b8e56c6

File tree

138 files changed

+1505041
-2064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1505041
-2064
lines changed

.cspell.json

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -54,65 +54,67 @@
5454
"benchmark/promptflow-serve/result-archive/**"
5555
],
5656
"words": [
57-
"aoai",
5857
"amlignore",
59-
"mldesigner",
60-
"faiss",
61-
"serp",
58+
"aoai",
59+
"Apim",
60+
"astext",
61+
"attribited",
62+
"azureai",
63+
"azurecr",
6264
"azureml",
63-
"mlflow",
64-
"vnet",
65-
"openai",
66-
"pfazure",
65+
"azuremlsdktestpypi",
66+
"Bhavik",
67+
"centralus",
68+
"chatml",
69+
"cref",
70+
"e2etest",
71+
"e2etests",
6772
"eastus",
68-
"azureai",
69-
"vectordb",
70-
"Qdrant",
71-
"Weaviate",
73+
"Entra",
7274
"env",
73-
"e2etests",
74-
"e2etest",
75-
"tablefmt",
76-
"logprobs",
77-
"logit",
75+
"faiss",
76+
"geval",
7877
"hnsw",
79-
"chatml",
80-
"UNLCK",
78+
"junit",
8179
"KHTML",
80+
"Likert",
81+
"llmlingua",
82+
"logit",
83+
"logprobs",
84+
"meid",
85+
"mgmt",
86+
"MistralAI",
87+
"mldesigner",
88+
"mlflow",
89+
"msal",
90+
"msrest",
91+
"myconn",
8292
"numlines",
83-
"azurecr",
84-
"centralus",
93+
"nunit",
94+
"openai",
95+
"pfazure",
96+
"pfbytes",
97+
"pfcli",
98+
"pfutil",
8599
"Policheck",
86-
"azuremlsdktestpypi",
87-
"rediraffe",
88100
"pydata",
89-
"ROBOCOPY",
90-
"undoc",
101+
"Qdrant",
102+
"rediraffe",
91103
"retriable",
92-
"pfcli",
93-
"pfutil",
94-
"mgmt",
95-
"wsid",
96-
"westus",
97-
"msrest",
98-
"cref",
99-
"msal",
100-
"pfbytes",
101-
"Apim",
102-
"junit",
103-
"nunit",
104-
"astext",
105-
"Likert",
106-
"geval",
104+
"ROBOCOPY",
105+
"serp",
107106
"Summ",
108-
"Bhavik",
109-
"meid",
110-
"Entra",
107+
"tablefmt",
108+
"undoc",
109+
"UNLCK",
110+
"upia",
111111
"uvicorn",
112-
"attribited",
113-
"MistralAI",
114-
"llmlingua",
115-
"myconn"
112+
"vectordb",
113+
"vnet",
114+
"Weaviate",
115+
"westus",
116+
"wsid",
117+
"Xpia"
116118
],
117119
"ignoreWords": [
118120
"openmpi",
@@ -242,10 +244,20 @@
242244
"azureopenaimodelconfiguration",
243245
"openaimodelconfiguration",
244246
"usecwd",
247+
"upia",
248+
"xpia",
245249
"locustio",
246250
"euap",
251+
"Rerank",
252+
"rerank",
253+
"reranker",
247254
"rcfile",
248-
"pylintrc"
255+
"pylintrc",
256+
"gleu",
257+
"Gleu",
258+
"GLEU",
259+
"fmeasure",
260+
"punkt"
249261
],
250262
"flagWords": [
251263
"Prompt Flow"

docs/cloud/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ In prompt flow, You can develop your flow locally and then seamlessly transition
2727

2828
For more resources on Azure AI, visit the cloud documentation site: [Build AI solutions with prompt flow](https://learn.microsoft.com/en-us/azure/machine-learning/prompt-flow/get-started-prompt-flow?view=azureml-api-2).
2929

30-
```{toctree}
31-
:caption: Tracing
32-
:maxdepth: 2
33-
azureai/tracing/index
34-
```
35-
3630
```{toctree}
3731
:caption: Flow
3832
:maxdepth: 2

docs/concepts/concept-connections.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Prompt flow provides a variety of pre-built connections, including Azure OpenAI,
1111

1212
| Connection type | Built-in tools |
1313
| ------------------------------------------------------------ | ------------------------------- |
14-
| [Azure OpenAI](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service) | LLM or Python |
14+
| [Azure OpenAI](https://azure.microsoft.com/products/cognitive-services/openai-service) | LLM or Python |
1515
| [OpenAI](https://openai.com/) | LLM or Python |
16-
| [Cognitive Search](https://azure.microsoft.com/en-us/products/search) | Vector DB Lookup or Python |
16+
| [Cognitive Search](https://azure.microsoft.com/products/search) | Vector DB Lookup or Python |
1717
| [Serp](https://serpapi.com/) | Serp API or Python |
18-
| [Serverless](https://learn.microsoft.com/en-us/azure/ai-studio/concepts/deployments-overview#deploy-models-with-model-as-a-service-maas) | LLM or Python |
18+
| [Serverless](https://learn.microsoft.com/azure/ai-studio/concepts/deployments-overview#deploy-models-as-serverless-apis) | LLM or Python |
1919
| Custom | Python |
2020

2121
By leveraging connections in prompt flow, you can easily establish and manage connections to external APIs and data sources, facilitating efficient data exchange and interaction within their AI applications.

docs/reference/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ tools-reference/open_model_llm_tool
6666
tools-reference/openai-gpt-4v-tool
6767
tools-reference/contentsafety_text_tool
6868
tools-reference/aoai-gpt4-turbo-vision
69+
tools-reference/rerank-tool
6970
```
7071

7172
```{toctree}

docs/reference/pf-command-reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# pf
22

3-
:::{admonition} Experimental feature
4-
This is an experimental feature, and may change at any time. Learn [more](../how-to-guides/faq.md#stable-vs-experimental).
5-
:::
6-
73
Manage prompt flow resources with the prompt flow CLI.
84

95
| Command | Description |

docs/reference/tools-reference/llm-tool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Create OpenAI resources, Azure OpenAI resources or MaaS deployment with the LLM
2525

2626
- **MaaS deployment**
2727

28-
Create MaaS deployment for models in Azure AI Studio model catalog with [instruction](https://learn.microsoft.com/en-us/azure/ai-studio/concepts/deployments-overview#deploy-models-with-model-as-a-service-maas)
28+
Create MaaS deployment for models in Azure AI Studio model catalog with [instruction](https://learn.microsoft.com/azure/ai-studio/concepts/deployments-overview#deploy-models-as-serverless-apis)
2929

3030
You can create serverless connection to use this MaaS deployment.
3131

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Rerank
2+
3+
## Introduction
4+
Rerank is a semantic search tool that improves search quality with a semantic-based reranking system which can contextualize the meaning of a user's query beyond keyword relevance. This tool works best with look up tool as a ranker after the initial retrieval. The list of current supported ranking method is as follows.
5+
6+
| Name | Description |
7+
| --- | --- |
8+
| BM25 | BM25 is an open source ranking algorithm to measure the relevance of documents to a given query |
9+
| Scaled Score Fusion | Scaled Score Fusion calculates a scaled relevance score. |
10+
| Cohere Rerank | Cohere Rerank is the market’s leading reranking model used for semantic search and retrieval-augmented generation (RAG). |
11+
12+
## Requirements
13+
- For AzureML users, the tool is installed in default image, you can use the tool without extra installation.
14+
- For local users,
15+
16+
`pip install promptflow-vectordb`
17+
18+
## Prerequisites
19+
20+
BM25 and Scaled Score Fusion are included as default reranking methods. To use cohere rerank model, you should create serverless deployment to the model, and establish connection between the tool and the resource as follows.
21+
22+
- Add Serverless Model connection. Fill "API base" and "API key" field to your serverless deployment.
23+
24+
25+
## Inputs
26+
27+
| Name | Type | Description | Required |
28+
|------------------------|-------------|-----------------------------------------------------------------------|----------|
29+
| query | string | the question relevant to your input documents | Yes |
30+
| ranker_parameters | string | the type of ranking methods to use | Yes |
31+
| result_groups | object | the list of document chunks to rerank. Normally this is output from lookup | Yes |
32+
| top_k | int | the maximum number of relevant documents to return | No |
33+
34+
35+
36+
## Outputs
37+
38+
| Return Type | Description |
39+
|-------------|------------------------------------------|
40+
| text | text of the entity |
41+
| metadata | metadata like file path and url |
42+
| additional_fields | metadata and rerank score |
43+
44+
<details>
45+
<summary>Output</summary>
46+
47+
```json
48+
[
49+
{
50+
"text": "sample text",
51+
"metadata":
52+
{
53+
"filepath": "sample_file_path",
54+
"metadata_json_string": "meta_json_string"
55+
"title": "",
56+
"url": ""
57+
},
58+
"additional_fields":
59+
{
60+
"filepath": "sample_file_path",
61+
"metadata_json_string": "meta_json_string"
62+
"title": "",
63+
"url": "",
64+
"@promptflow_vectordb.reranker_score": 0.013795365
65+
}
66+
}
67+
]
68+
```
69+
</details>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Continuous Monitoring Pipeline
2+
3+
This tutorial describes an advanced use case of [running flows in Azure ML Pipelines](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/run-flow-with-pipeline/pipeline.ipynb).
4+
The detailed explanations of the prerequisites and principles can be found in the aforementioned article.
5+
Continuous monitoring is necessary to maintain the quality, performance and efficiency of Generative AI applications.
6+
These factors directly impact the user experience and operational costs.
7+
8+
We will run evaluations on a basic chatbot flow, then aggregate the results to export and visualize the metrics.
9+
The flows used in this pipeline are described below:
10+
- [Basic Chat](https://github.com/microsoft/promptflow/tree/main/examples/flows/chat/chat-basic)
11+
- [Q&A Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-qna-rag-metrics)
12+
- [Perceived Intelligence Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-perceived-intelligence)
13+
- [Summarization Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-summarization)
14+
15+
Connections used in this flow:
16+
- `azure_open_ai_connection` connection (Azure OpenAI).
17+
18+
## Prerequisites
19+
20+
### Prompt flow SDK:
21+
- Azure cloud setup:
22+
- An Azure account with an active subscription - [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
23+
- Create an Azure ML resource from Azure portal - [Create a Azure ML workspace](https://ms.portal.azure.com/#view/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/searchQuery/machine%20learning)
24+
- Connect to your workspace then setup a basic computer cluster - [Configure workspace](https://github.com/microsoft/promptflow/blob/main/examples/configuration.ipynb)
25+
- Local environment setup:
26+
- A python environment
27+
- Installed Azure Machine Learning Python SDK v2 - [install instructions](https://github.com/microsoft/promptflow/blob/main/examples/README.md) - check the getting started section and make sure version of 'azure-ai-ml' is higher than `1.12.0`
28+
29+
Note: when using the Prompt flow SDK, it may be useful to also install the [`Prompt flow for VS Code`](https://marketplace.visualstudio.com/items?itemName=prompt-flow.prompt-flow) extension (if using VS Code).
30+
31+
### Azure AI/ML Studio:
32+
Start a compute session.
33+
The follow the installation steps described in the notebook.
34+
35+
## Setup connections
36+
Ensure that you have a connection to Azure OpenAI with the following deployments:
37+
- `gpt-35-turbo`
38+
- `gpt-4`
39+
40+
## Run pipeline
41+
42+
Run the notebook's steps until `3.2.2 Submit the job` to start the pipeline in Azure ML Studio.
43+
44+
## Pipeline description
45+
The first node reads the evaluation dataset.
46+
The second node is the main flow that will be monitored, it takes the output of the evaluation dataset as a `data` input.
47+
After the main flow's node has completed, its output will go to 3 nodes:
48+
- Q&A Evaluation
49+
- Perceived Intelligence Evaluation
50+
- Simple Summarization
51+
52+
The Simple Summarization and the main nodes' outputs will become the Summarization Evaluation node's input.
53+
54+
Finally, all the evaluation metrics will be aggregated and displayed in Azure ML Pipeline's interface.
55+
56+
![continuous_monitoring_pipeline.png](./monitoring/media/continuous_monitoring_pipeline.png)
57+
58+
## Metrics visualization
59+
In the node `Convert evaluation results to parquet` Metrics tab, the aggregated metrics will be displayed.
60+
61+
![metrics_tab.png](./monitoring/media/metrics_tab.png)
62+
63+
The evolution of the metrics can be monitored by comparing multiple pipeline runs:
64+
65+
![compare_button.png](./monitoring/media/compare_button.png)
66+
67+
![compare_metrics.png](./monitoring/media/compare_metrics.png)
68+
## Contact
69+
Please reach out to Lou Bigard (<[email protected]>) with any issues.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
2+
environment:
3+
python_requirements_txt: requirements.txt
4+
inputs:
5+
answer:
6+
type: string
7+
outputs:
8+
summary:
9+
type: string
10+
reference: ${summarize_text_content.output}
11+
nodes:
12+
- name: summarize_text_content
13+
use_variants: true
14+
node_variants:
15+
summarize_text_content:
16+
default_variant_id: variant_0
17+
variants:
18+
variant_0:
19+
node:
20+
type: llm
21+
source:
22+
type: code
23+
path: summarize_text_content.jinja2
24+
inputs:
25+
deployment_name: gpt-35-turbo
26+
model: gpt-3.5-turbo
27+
max_tokens: 128
28+
temperature: 0.2
29+
text: ${inputs.answer}
30+
connection: open_ai_connection
31+
api: chat
32+
variant_1:
33+
node:
34+
type: llm
35+
source:
36+
type: code
37+
path: summarize_text_content__variant_1.jinja2
38+
inputs:
39+
deployment_name: gpt-35-turbo
40+
model: gpt-3.5-turbo
41+
max_tokens: 256
42+
temperature: 0.3
43+
text: ${inputs.answer}
44+
connection: open_ai_connection
45+
api: chat
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
promptflow[azure]>=1.7.0
2+
promptflow-tools

0 commit comments

Comments
 (0)