Skip to content

Commit 253f043

Browse files
Merge pull request #275781 from ggailey777/openai-bindings
[Functions][Build 2024][OpenAI] Updates to binding references + more example links
2 parents cb70d46 + 28279fd commit 253f043

12 files changed

+194
-308
lines changed

articles/azure-functions/TOC.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -807,37 +807,39 @@
807807
- name: Output
808808
href: functions-bindings-azure-data-explorer-output.md
809809
displayName: Azure Data Explorer
810-
- name: Azure OpenAPI
810+
- name: Azure OpenAI
811811
items:
812812
- name: Overview
813813
href: functions-bindings-openai.md
814-
displayName: OpenAPI
814+
displayName: OpenAI
815815
- name: Assistants
816816
items:
817817
- name: Trigger
818818
href: functions-bindings-openai-assistant-trigger.md
819-
displayName: Assistants
819+
displayName: assistants, OpenAI
820820
- name: Query input
821821
href: functions-bindings-openai-assistantquery-input.md
822-
displayName: Assistants
822+
displayName: assistants, OpenAI
823823
- name: Create output
824824
href: functions-bindings-openai-assistantcreate-output.md
825-
displayName: Assistants
825+
displayName: assistants, OpenAI
826826
- name: Post input
827827
href: functions-bindings-openai-assistantpost-input.md
828-
displayName: Assistants
828+
displayName: assistants, OpenAI
829829
- name: Embeddings
830830
items:
831831
- name: Input
832832
href: functions-bindings-openai-embeddings-input.md
833-
displayName: embeddings
833+
displayName: embeddings, OpenAI
834834
- name: Store output
835835
href: functions-bindings-openai-embeddingsstore-output.md
836-
displayName: embeddings
836+
displayName: embeddings, OpenAI
837837
- name: Semantic search input
838-
href: functions-bindings-openai-semanticsearch-input.md
838+
href: functions-bindings-openai-semanticsearch-input.md
839+
displayName: OpenAI
839840
- name: Text Completion input
840841
href: functions-bindings-openai-textcompletion-input.md
842+
displayName: OpenAI
841843
- name: Azure SQL
842844
items:
843845
- name: Overview

articles/azure-functions/functions-bindings-openai-assistant-trigger.md

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use the Azure OpenAI assistant trigger to execute code
44
ms.topic: reference
55
ms.custom:
66
- build-2024
7-
ms.date: 05/07/2024
7+
ms.date: 05/24/2024
88
zone_pivot_groups: programming-languages-set-functions
99
---
1010

@@ -15,44 +15,24 @@ zone_pivot_groups: programming-languages-set-functions
1515
The Azure OpenAI assistant trigger lets you run your code based on custom chat bot or skill request made to an assistant.
1616

1717
For information on setup and configuration details of the Azure OpenAI extension, see [Azure OpenAI extensions for Azure Functions](./functions-bindings-openai.md). To learn more about Azure OpenAI assistants, see [Azure OpenAI Assistants API](../ai-services/openai/concepts/assistants.md).
18-
::: zone pivot="programming-language-javascript,programming-language-typescript"
19-
> [!NOTE]
20-
> References and examples are only provided for the [Node.js v4 model](./functions-reference-node.md?pivots=nodejs-model-v4).
21-
::: zone-end
22-
::: zone pivot="programming-language-python"
23-
> [!NOTE]
24-
> References and examples are only provided for the [Python v2 model](functions-reference-python.md?pivots=python-mode-decorators#development-options).
25-
::: zone-end
18+
19+
[!INCLUDE [functions-support-notes-samples-openai](../../includes/functions-support-notes-samples-openai.md)]
2620

2721
## Example
2822

2923
::: zone pivot="programming-language-csharp"
30-
A C# function can be created using one of the following C# modes:
31-
32-
[!INCLUDE [dotnet-execution](../../includes/functions-dotnet-execution-model.md)]
33-
34-
### [Isolated process](#tab/isolated-process)
35-
3624
This example demonstrates how to create an assistant that adds a new todo task to a database. The trigger has a static description of `Create a new todo task` used by the model. The function itself takes a string, which represents a new task to add. When executed, the function adds the task as a new todo item in a custom item store and returns a response from the store.
3725

3826
:::code language="csharp" source="~/functions-openai-extension/samples/assistant/csharp-ooproc/AssistantSkills.cs" range="31-43" :::
3927

40-
### [In-process](#tab/in-process)
41-
42-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
43-
44-
---
45-
4628
::: zone-end
4729
::: zone pivot="programming-language-java"
48-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
49-
<!---uncomment when code example is available:
50-
{{This comes from the example code comment}}
5130

52-
:::code language="java" source="~/functions-openai-extension/samples/{{link to the correct sample.java}}" range="{{named is better than range}}":::
31+
This example demonstrates how to create an assistant that adds a new todo task to a database. The trigger has a static description of `Create a new todo task` used by the model. The function itself takes a string, which represents a new task to add. When executed, the function adds the task as a new todo item in a custom item store and returns a response from the store.
32+
33+
34+
:::code language="java" source="~/functions-openai-extension/samples/assistant/java/src/main/java/com/azfs/AssistantSkills.java" range="27-43":::
5335

54-
{{Add more examples if available}}
55-
-->
5636
::: zone-end
5737
::: zone pivot="programming-language-javascript"
5838
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
@@ -72,20 +52,19 @@ This example demonstrates how to create an assistant that adds a new todo task t
7252

7353
::: zone-end
7454
::: zone pivot="programming-language-powershell"
75-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
76-
<!---uncomment when code example is available:
77-
{{This comes from the example code comment}}
7855

79-
Here's the _function.json_ file for {{example}}:
56+
This example demonstrates how to create an assistant that adds a new todo task to a database. The trigger has a static description of `Create a new todo task` used by the model. The function itself takes a string, which represents a new task to add. When executed, the function adds the task as a new todo item in a custom item store and returns a response from the store.
57+
58+
Here's the _function.json_ file for Add Todo:
8059

81-
:::code language="json" source="~/functions-openai-extension/samples/{{link to the correct function.json}}" :::
60+
:::code language="json" source="~/functions-openai-extension/samples/assistant/powershell/AddTodo/function.json" :::
8261

8362
For more information about *function.json* file properties, see the [Configuration](#configuration) section.
8463

85-
{{This comes from the example code comment}}
8664

87-
:::code language="powershell" source="~/functions-openai-extension/samples/{{link to the correct sample.ps1}}" :::
88-
-->
65+
:::code language="powershell" source="~/functions-openai-extension/samples/assistant/powershell/AddTodo/run.ps1" :::
66+
67+
8968
::: zone-end
9069
::: zone pivot="programming-language-python"
9170

@@ -177,6 +156,6 @@ When `parameterDescriptionJson` JSON value isn't provided, it's autogenerated. F
177156

178157
+ [Assistant samples](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/assistant)
179158
+ [Azure OpenAI extension](functions-bindings-openai.md)
180-
+ [Azure OpenAI assistant query input binding ](functions-bindings-openai-assistantcreate-output.md)
181-
+ [Azure OpenAI assistant create output binding ](functions-bindings-openai-assistantcreate-output.md)
182-
+ [Azure OpenAI assistant post input binding ](functions-bindings-openai-assistantpost-input.md)
159+
+ [Azure OpenAI assistant query input binding](functions-bindings-openai-assistantquery-input.md)
160+
+ [Azure OpenAI assistant create output binding](functions-bindings-openai-assistantcreate-output.md)
161+
+ [Azure OpenAI assistant post input binding](functions-bindings-openai-assistantpost-input.md)

articles/azure-functions/functions-bindings-openai-assistantcreate-output.md

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use the Azure OpenAI assistant create output binding t
44
ms.topic: reference
55
ms.custom:
66
- build-2024
7-
ms.date: 05/07/2024
7+
ms.date: 05/20/2024
88
zone_pivot_groups: programming-languages-set-functions
99
---
1010

@@ -15,44 +15,23 @@ zone_pivot_groups: programming-languages-set-functions
1515
The Azure OpenAI assistant create output binding allows you to create a new assistant chat bot from your function code execution.
1616

1717
For information on setup and configuration details of the Azure OpenAI extension, see [Azure OpenAI extensions for Azure Functions](./functions-bindings-openai.md). To learn more about Azure OpenAI assistants, see [Azure OpenAI Assistants API](../ai-services/openai/concepts/assistants.md).
18-
::: zone pivot="programming-language-javascript,programming-language-typescript"
19-
> [!NOTE]
20-
> References and examples are only provided for the [Node.js v4 model](./functions-reference-node.md?pivots=nodejs-model-v4).
21-
::: zone-end
22-
::: zone pivot="programming-language-python"
23-
> [!NOTE]
24-
> References and examples are only provided for the [Python v2 model](functions-reference-python.md?pivots=python-mode-decorators#development-options).
25-
::: zone-end
18+
19+
[!INCLUDE [functions-support-notes-samples-openai](../../includes/functions-support-notes-samples-openai.md)]
2620

2721
## Example
2822

2923
::: zone pivot="programming-language-csharp"
30-
A C# function can be created using one of the following C# modes:
31-
32-
[!INCLUDE [dotnet-execution](../../includes/functions-dotnet-execution-model.md)]
33-
34-
### [Isolated process](#tab/isolated-process)
35-
3624
This example demonstrates the creation process, where the HTTP PUT function that creates a new assistant chat bot with the specified ID. The response to the prompt is returned in the HTTP response.
3725

3826
:::code language="csharp" source="~/functions-openai-extension/samples/assistant/csharp-ooproc/AssistantApis.cs" range="20-45":::
3927

40-
### [In-process](#tab/in-process)
41-
42-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
43-
44-
---
45-
4628
::: zone-end
4729
::: zone pivot="programming-language-java"
48-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
49-
<!---uncomment when code example is available:
50-
{{This comes from the example code comment}}
30+
This example demonstrates the creation process, where the HTTP PUT function that creates a new assistant chat bot with the specified ID. The response to the prompt is returned in the HTTP response.
31+
32+
:::code language="java" source="~/functions-openai-extension/samples/assistant/java/src/main/java/com/azfs/AssistantApis.java" range="33-58":::
5133

52-
:::code language="java" source="~/functions-openai-extension/samples/{{link to the correct sample.java}}" range="{{named is better than range}}":::
5334

54-
{{Add more examples if available}}
55-
-->
5635
::: zone-end
5736
::: zone pivot="programming-language-javascript"
5837
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
@@ -73,19 +52,17 @@ This example demonstrates the creation process, where the HTTP PUT function that
7352

7453
::: zone-end
7554
::: zone pivot="programming-language-powershell"
76-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
77-
<!---uncomment when code example is available:
78-
{{This comes from the example code comment}}
55+
This example demonstrates the creation process, where the HTTP PUT function that creates a new assistant chat bot with the specified ID. The response to the prompt is returned in the HTTP response.
7956

80-
Here's the _function.json_ file for {{example}}:
57+
Here's the _function.json_ file for Create Assistant:
8158

82-
:::code language="json" source="~/functions-openai-extension/samples/{{link to the correct function.json}}" :::
59+
:::code language="json" source="~/functions-openai-extension/samples/assistant/powershell/CreateAssistant/function.json" :::
8360

8461
For more information about *function.json* file properties, see the [Configuration](#configuration) section.
8562

8663
{{This comes from the example code comment}}
87-
:::code language="powershell" source="~/functions-openai-extension/samples/{{link to the correct sample.ps1}}" :::
88-
-->
64+
:::code language="powershell" source="~/functions-openai-extension/samples/assistant/powershell/CreateAssistant/run.ps1" :::
65+
8966
::: zone-end
9067
::: zone pivot="programming-language-python"
9168
This example demonstrates the creation process, where the HTTP PUT function that creates a new assistant chat bot with the specified ID. The response to the prompt is returned in the HTTP response.
@@ -163,5 +140,5 @@ See the [Example section](#example) for complete examples.
163140
+ [Assistant samples](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/assistant)
164141
+ [Azure OpenAI extension](functions-bindings-openai.md)
165142
+ [Azure OpenAI assistant trigger](functions-bindings-openai-assistant-trigger.md)
166-
+ [Azure OpenAI assistant query input binding ](functions-bindings-openai-assistantcreate-output.md)
167-
+ [Azure OpenAI assistant post input binding ](functions-bindings-openai-assistantpost-input.md)
143+
+ [Azure OpenAI assistant query input binding](functions-bindings-openai-assistantcreate-output.md)
144+
+ [Azure OpenAI assistant post input binding](functions-bindings-openai-assistantpost-input.md)

articles/azure-functions/functions-bindings-openai-assistantpost-input.md

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use the Azure OpenAI assistant post input binding to q
44
ms.topic: reference
55
ms.custom:
66
- build-2024
7-
ms.date: 05/07/2024
7+
ms.date: 05/20/2024
88
zone_pivot_groups: programming-languages-set-functions
99
---
1010

@@ -14,45 +14,24 @@ zone_pivot_groups: programming-languages-set-functions
1414

1515
The Azure OpenAI assistant post input binding lets you send prompts to assistant chat bots.
1616

17-
For information on setup and configuration details of the Azure OpenAI extension, see [Azure OpenAI extensions for Azure Functions](./functions-bindings-openai.md). To learn more about Azure OpenAI assistants, see [Azure OpenAI Assistants API](../ai-services/openai/concepts/assistants.md).
18-
::: zone pivot="programming-language-javascript,programming-language-typescript"
19-
> [!NOTE]
20-
> References and examples are only provided for the [Node.js v4 model](./functions-reference-node.md?pivots=nodejs-model-v4).
21-
::: zone-end
22-
::: zone pivot="programming-language-python"
23-
> [!NOTE]
24-
> References and examples are only provided for the [Python v2 model](functions-reference-python.md?pivots=python-mode-decorators#development-options).
25-
::: zone-end
17+
For information on setup and configuration details of the Azure OpenAI extension, see [Azure OpenAI extensions for Azure Functions](./functions-bindings-openai.md). To learn more about Azure OpenAI assistants, see [Azure OpenAI Assistants API](../ai-services/openai/
18+
19+
[!INCLUDE [functions-support-notes-samples-openai](../../includes/functions-support-notes-samples-openai.md)]
2620

2721
## Example
2822

2923
::: zone pivot="programming-language-csharp"
30-
A C# function can be created using one of the following C# modes:
31-
32-
[!INCLUDE [dotnet-execution](../../includes/functions-dotnet-execution-model.md)]
33-
34-
### [Isolated process](#tab/isolated-process)
35-
3624
This example demonstrates the creation process, where the HTTP POST function that sends user prompts to the assistant chat bot. The response to the prompt is returned in the HTTP response.
3725

3826
:::code language="csharp" source="~/functions-openai-extension/samples/assistant/csharp-ooproc/AssistantApis.cs" range="58-78":::
3927

40-
### [In-process](#tab/in-process)
41-
42-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
43-
44-
---
45-
4628
::: zone-end
4729
::: zone pivot="programming-language-java"
48-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
49-
<!---uncomment when code example is available:
50-
{{This comes from the example code comment}}
5130

52-
:::code language="java" source="~/functions-openai-extension/samples/{{link to the correct sample.java}}" range="{{named is better than range}}":::
31+
This example demonstrates the creation process, where the HTTP POST function that sends user prompts to the assistant chat bot. The response to the prompt is returned in the HTTP response.
32+
33+
:::code language="java" source="~/functions-openai-extension/samples/assistant/java/src/main/java/com/azfs/AssistantApis.java" range="83-103":::
5334

54-
{{Add more examples if available}}
55-
-->
5635
::: zone-end
5736
::: zone pivot="programming-language-javascript"
5837
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
@@ -72,20 +51,17 @@ This example demonstrates the creation process, where the HTTP POST function tha
7251

7352
::: zone-end
7453
::: zone pivot="programming-language-powershell"
75-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
76-
<!---uncomment when code example is available:
77-
{{This comes from the example code comment}}
7854

79-
Here's the _function.json_ file for {{example}}:
55+
This example demonstrates the creation process, where the HTTP POST function that sends user prompts to the assistant chat bot. The response to the prompt is returned in the HTTP response.
56+
57+
Here's the _function.json_ file for post user query:
8058

81-
:::code language="json" source="~/functions-openai-extension/samples/{{link to the correct function.json}}" :::
59+
:::code language="json" source="~/functions-openai-extension/samples/assistant/powershell/PostUserQuery/function.json" :::
8260

8361
For more information about *function.json* file properties, see the [Configuration](#configuration) section.
8462

85-
{{This comes from the example code comment}}
63+
:::code language="powershell" source="~/functions-openai-extension/samples/assistant/powershell/PostUserQuery/run.ps1" :::
8664

87-
:::code language="powershell" source="~/functions-openai-extension/samples/{{link to the correct sample.ps1}}" :::
88-
-->
8965
::: zone-end
9066
::: zone pivot="programming-language-python"
9167
This example demonstrates the creation process, where the HTTP POST function that sends user prompts to the assistant chat bot. The response to the prompt is returned in the HTTP response.
@@ -164,5 +140,5 @@ See the [Example section](#example) for complete examples.
164140
+ [Assistant samples](https://github.com/Azure/azure-functions-openai-extension/tree/main/samples/assistant)
165141
+ [Azure OpenAI extension](functions-bindings-openai.md)
166142
+ [Azure OpenAI assistant trigger](functions-bindings-openai-assistant-trigger.md)
167-
+ [Azure OpenAI assistant query input binding ](functions-bindings-openai-assistantcreate-output.md)
168-
+ [Azure OpenAI assistant create output binding ](functions-bindings-openai-assistantcreate-output.md)
143+
+ [Azure OpenAI assistant query input binding](functions-bindings-openai-assistantcreate-output.md)
144+
+ [Azure OpenAI assistant create output binding](functions-bindings-openai-assistantcreate-output.md)

0 commit comments

Comments
 (0)