Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoshioka0128 authored Jul 8, 2024
2 parents 3fe8ab4 + 5585d8d commit 6395c17
Show file tree
Hide file tree
Showing 105 changed files with 388 additions and 388 deletions.
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_async/node1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
async def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call async
# sleep for 250ms to simulate OpenAI call async
await asyncio.sleep(0.25)
return "completed"
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_async/node2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
async def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call async
# sleep for 250ms to simulate OpenAI call async
await asyncio.sleep(0.25)
return "completed"
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_async/node3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
async def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call async
# sleep for 250ms to simulate OpenAI call async
await asyncio.sleep(0.25)
return "completed"
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_sync/node1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call
# sleep for 250ms to simulate OpenAI call
time.sleep(0.25)
return "completed"
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_sync/node2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call
# sleep for 250ms to simulate OpenAI call
time.sleep(0.25)
return "completed"
2 changes: 1 addition & 1 deletion benchmark/promptflow-serve/pf_flows/static_sync/node3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@tool
def my_python_tool(chat_history: list, question: str) -> str:

# sleep for 250ms to simulate open ai call
# sleep for 250ms to simulate OpenAI call
time.sleep(0.25)
return "completed"
6 changes: 3 additions & 3 deletions docs/concepts/concept-connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Connections are for storing information about how to access external services li
- In your local development environment, the connections are persisted in your local machine with keys encrypted.
- In Azure AI, connections can be configured to be shared across the entire workspace. Secrets associated with connections are securely persisted in the corresponding Azure Key Vault, adhering to robust security and compliance standards.

Prompt flow provides a variety of pre-built connections, including Azure Open AI, Open AI, etc. These pre-built connections enable seamless integration with these resources within the built-in tools. Additionally, you have the flexibility to create custom connection types using key-value pairs, empowering them to tailor the connections to their specific requirements, particularly in Python tools.
Prompt flow provides a variety of pre-built connections, including Azure OpenAI, OpenAI, etc. These pre-built connections enable seamless integration with these resources within the built-in tools. Additionally, you have the flexibility to create custom connection types using key-value pairs, empowering them to tailor the connections to their specific requirements, particularly in Python tools.

| Connection type | Built-in tools |
| ------------------------------------------------------------ | ------------------------------- |
| [Azure Open AI](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service) | LLM or Python |
| [Open AI](https://openai.com/) | LLM or Python |
| [Azure OpenAI](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service) | LLM or Python |
| [OpenAI](https://openai.com/) | LLM or Python |
| [Cognitive Search](https://azure.microsoft.com/en-us/products/search) | Vector DB Lookup or Python |
| [Serp](https://serpapi.com/) | Serp API or Python |
| [Serverless](https://learn.microsoft.com/en-us/azure/ai-studio/concepts/deployments-overview#deploy-models-with-model-as-a-service-maas) | LLM or Python |
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/develop-a-dag-flow/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ We need to set up the connection if we haven't added it before. Once created, th

Firstly we need a connection yaml file `connection.yaml`:

If you are using Azure Open AI, prepare your resource follow with this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
If you are using Azure OpenAI, prepare your resource follow with this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
```yaml
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json
name: open_ai_connection
Expand Down
4 changes: 2 additions & 2 deletions docs/how-to-guides/manage-connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ On the VS Code primary sidebar > prompt flow pane. You can find the connections
:sync: CLI
The commands below show how to update existing connections with new values:
```bash
# Update an azure open ai connection with a new api base
# Update an azure OpenAI connection with a new api base
pf connection update -n my_azure_open_ai_connection --set api_base='new_value'
# Update a custom connection
pf connection update -n my_custom_connection --set configs.other_config='new_value'
Expand All @@ -120,7 +120,7 @@ pf connection update -n my_custom_connection --set configs.other_config='new_val
:sync: SDK
The code snippet below shows how to update existing connections with new values:
```python
# Update an azure open ai connection with a new api base
# Update an azure OpenAI connection with a new api base
connection = pf.connections.get(name="my_azure_open_ai_connection")
connection.api_base = "new_value"
connection.api_key = "<original-key>" # secrets are required when updating connection using sdk
Expand Down
2 changes: 1 addition & 1 deletion examples/connections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pf connection show --name custom_connection
- To update a connection that in workspace, execute following command. Currently only a few fields(description, display_name) support update:
```bash
# Update an existing connection with --set to override values
# Update an azure open ai connection with a new api base
# Update an azure OpenAI connection with a new api base
pf connection update -n open_ai_connection --set api_base='<your_api_base>'
# Update a custom connection
pf connection update -n custom_connection --set configs.key1='<your_new_key>' secrets.key2='<your_another_key>'
Expand Down
4 changes: 2 additions & 2 deletions examples/flex-flows/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ pip install -r requirements.txt

## Run flow

- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

- Setup environment variables

Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).
Ensure you have put your azure OpenAI endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).

```bash
cat ../.env
Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/chat-async-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See <a href="https://platform.openai.com/docs/api-reference/chat/create#chat/cre
## Run flow
- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Setup connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"\n",
"Above prompty uses connection `open_ai_connection` inside, we need to set up the connection if we haven't added it before. After created, it's stored in local db and can be used in any flow.\n",
"\n",
"Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
"Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
]
},
{
Expand All @@ -99,7 +99,7 @@
" conn = pf.connections.get(name=conn_name)\n",
" print(\"using existing connection\")\n",
"except:\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure Open AI resource.\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure OpenAI resource.\n",
" connection = AzureOpenAIConnection(\n",
" name=conn_name,\n",
" api_key=\"<your_AOAI_key>\",\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/chat-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See <a href="https://platform.openai.com/docs/api-reference/chat/create#chat/cre
## Run flow
- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Setup connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"\n",
"Above prompty uses connection `open_ai_connection` inside, we need to set up the connection if we haven't added it before. After created, it's stored in local db and can be used in any flow.\n",
"\n",
"Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
"Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
]
},
{
Expand All @@ -79,7 +79,7 @@
" conn = pf.connections.get(name=conn_name)\n",
" print(\"using existing connection\")\n",
"except:\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure Open AI resource.\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure OpenAI resource.\n",
" connection = AzureOpenAIConnection(\n",
" name=conn_name,\n",
" api_key=\"<your_AOAI_key>\",\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/flex-flows/chat-minimal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ See <a href="https://platform.openai.com/docs/api-reference/chat/create#chat/cre

## Run flow

- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

- Setup environment variables

Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).
Ensure you have put your azure OpenAI endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).

```bash
cat ../.env
Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/chat-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See <a href="https://platform.openai.com/docs/api-reference/chat/create#chat/cre
## Run flow
- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Setup connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"\n",
"Above prompty uses connection `open_ai_connection` inside, we need to set up the connection if we haven't added it before. After created, it's stored in local db and can be used in any flow.\n",
"\n",
"Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
"Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one."
]
},
{
Expand All @@ -99,7 +99,7 @@
" conn = pf.connections.get(name=conn_name)\n",
" print(\"using existing connection\")\n",
"except:\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure Open AI resource.\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure OpenAI resource.\n",
" connection = AzureOpenAIConnection(\n",
" name=conn_name,\n",
" api_key=\"<your_AOAI_key>\",\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/flex-flows/chat-with-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ pip install -r requirements.txt
## Getting started

### 1 prepare api_key env
- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

- Setup environment variables

Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).
Ensure you have put your azure OpenAI endpoint key in [.env](../.env) file. You can create one refer to this [example file](../.env.example).

### 2 understand how chat model choose function
```shell
Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/eval-checklist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pip install -r requirements.txt

## Run flow

- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

- Setup connection

Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/eval-code-quality/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pip install -r requirements.txt

## Run flow

- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

- Setup connection

Expand Down
2 changes: 1 addition & 1 deletion examples/flex-flows/eval-criteria-with-langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pip install -r requirements.txt

## Run flow

- Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
- Or prepare your Anthropic resource follow this [instruction](https://python.langchain.com/docs/integrations/platforms/anthropic/) and get your `api_key` if you don't have one.

- Setup connection
Expand Down
2 changes: 1 addition & 1 deletion examples/flows/chat/chat-with-pdf/chat-with-pdf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
" conn = pf.connections.get(name=conn_name)\n",
" print(\"using existing connection\")\n",
"except:\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure Open AI resource.\n",
" # Follow https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal to create an Azure OpenAI resource.\n",
" connection = AzureOpenAIConnection(\n",
" name=conn_name,\n",
" api_key=\"<user-input>\",\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In this flow, you will learn

### 0. Setup connection

Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

```bash
# Override keys with --set to avoid yaml file changes
Expand Down
2 changes: 1 addition & 1 deletion examples/flows/evaluation/eval-groundedness/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tools used in this flow:

### 0. Setup connection

Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

```bash
# Override keys with --set to avoid yaml file changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This evaluation flow allows you to assess and evaluate your model with the LLM-a


## 0. Setup connection
Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

```bash
# Override keys with --set to avoid yaml file changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Tools used in this flow:

### 0. Setup connection

Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

```bash
# Override keys with --set to avoid yaml file changes
Expand Down
2 changes: 1 addition & 1 deletion examples/flows/evaluation/eval-qna-non-rag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The f1-score evaluation flow allows you to determine the f1-score metric using n
- `Embedding` tool

## 0. Setup connection
Prepare your Azure Open AI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.
Prepare your Azure OpenAI resource follow this [instruction](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal) and get your `api_key` if you don't have one.

```bash
# Override keys with --set to avoid yaml file changes
Expand Down
Loading

0 comments on commit 6395c17

Please sign in to comment.