Skip to content

Commit 91d9881

Browse files
BandaruDheerajggailey777
authored andcommitted
Update functions-bindings-openai-embeddingsstore-output.md
1 parent 401eb37 commit 91d9881

File tree

1 file changed

+47
-58
lines changed

1 file changed

+47
-58
lines changed

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

Lines changed: 47 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Azure OpenAI embeddings store output binding for Azure Functions
2+
title: Azure OpenAI Embeddings Store Output Binding for Azure Functions
33
description: Learn how to use the Azure OpenAI embeddings store output binding to write searchable content to a semantic document store during function execution in Azure Functions.
44
ms.topic: reference
55
ms.date: 05/08/2024
66
zone_pivot_groups: programming-languages-set-functions
77
---
88
<!--- Question: It seems like this binding uses Azure AI Search and not Azure OpenAI. Do we need to rename the article to:
99
"Azure AI Search semantic output binding" or something like that?-->
10-
# Azure OpenAI embeddings store output binding for Azure Functions
10+
# Azure OpenAI Embeddings Store Output Binding for Azure Functions
1111

1212
[!INCLUDE [preview-support](../../includes/functions-openai-support-limitations.md)]
1313

@@ -34,24 +34,22 @@ A C# function can be created using one of the following C# modes:
3434

3535
This example writes an HTTP input stream to a semantic document store at the provided URL.
3636

37-
:::code language="csharp" source="~/functions-openai-extension/samples/rag-aisearch/csharp-ooproc/FilePrompt.cs" range="31-64":::
37+
:::code language="csharp" source="~/functions-openai-extension/samples/rag-aisearch/csharp-ooproc/FilePrompt.cs" range="29-61":::
3838

39-
### [In-process](#tab/in-process)
39+
<!-- ### [In-process](#tab/in-process)
4040
41-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
41+
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)] -->
4242

4343
---
4444

4545
::: zone-end
4646
::: zone pivot="programming-language-java"
47-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
48-
<!---uncomment when code example is available:
49-
{{This comes from the example code comment}}
5047

51-
:::code language="java" source="~/functions-openai-extension/samples/{{link to the correct sample.java}}" range="{{named is better than range}}":::
48+
This example writes an HTTP input stream to a semantic document store at the provided URL.
49+
50+
:::code language="java" source="~/functions-openai-extension/samples/rag-aisearch/java/src/main/java/com/azfs/FilePrompt.java" range="24-68":::
51+
5252

53-
{{Add more examples if available}}
54-
-->
5553
::: zone-end
5654
::: zone pivot="programming-language-javascript"
5755
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
@@ -64,40 +62,33 @@ This example writes an HTTP input stream to a semantic document store at the pro
6462
-->
6563
::: zone-end
6664
::: zone pivot="programming-language-typescript"
67-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
68-
<!---uncomment when code example is available:
69-
{{This comes from the example code comment}}
7065

71-
:::code language="typescript" source="~/functions-openai-extension/samples/{{link to the correct sample.ts}}" range="{{named is better than range}}":::
66+
This example writes an HTTP input stream to a semantic document store at the provided URL.
67+
68+
:::code language="typescript" source="~/functions-openai-extension/samples/rag-aisearch/nodejs/src/app.ts" range="7-38":::
69+
7270

73-
{{Add more examples if available}}
74-
-->
7571
::: zone-end
7672
::: zone pivot="programming-language-powershell"
77-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
78-
<!---uncomment when code example is available:
79-
{{This comes from the example code comment}}
8073

81-
Here's the _function.json_ file for {{example}}:
74+
This example writes an HTTP input stream to a semantic document store at the provided URL.
75+
76+
Here's the _function.json_ file for ingesting files:
8277

83-
:::code language="json" source="~/functions-openai-extension/samples/{{link to the correct function.json}}" :::
78+
:::code language="json" source="~/functions-openai-extension/samples/rag-aisearch/powershell/IngestFile/function.json" :::
8479

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

87-
{{This comes from the example code comment}}
82+
:::code language="powershell" source="~/functions-openai-extension/samples/rag-aisearch/powershell/IngestFile/run.ps1" :::
83+
8884

89-
:::code language="powershell" source="~/functions-openai-extension/samples/{{link to the correct sample.ps1}}" :::
90-
-->
9185
::: zone-end
9286
::: zone pivot="programming-language-python"
93-
[!INCLUDE [functions-examples-not-available-note](../../includes/functions-examples-not-available-note.md)]
94-
<!---uncomment when code example is available:
95-
{{This comes from the example code comment}}
9687

97-
:::code language="python" source="~/functions-openai-extension/samples/{{link to the correct sample.py}}" range="{{named is better than range}}":::
88+
This example writes an HTTP input stream to a semantic document store at the provided URL.
89+
90+
:::code language="python" source="~/functions-openai-extension/samples/rag-aisearch/python/function_app.py" range="8-25":::
9891

99-
{{Add more examples if available}}
100-
-->
10192
::: zone-end
10293
<!--- End code examples section -->
10394
::: zone pivot="programming-language-csharp"
@@ -107,14 +98,13 @@ Apply the `EmbeddingsStoreOutput` attribute to define an embeddings store output
10798

10899
| Parameter | Description |
109100
| --------- | ----------- |
101+
| **Input** | The input string for which to generate embeddings. |
102+
| **Model** | _Optional_. The ID of the model to use, which defaults to `text-embedding-ada-002`. You shouldn't change the model for an existing database. For more information, see [Usage](#usage). |
103+
| **MaxChunkLength** | _Optional_. The maximum number of characters used for chunking the input. For more information, see [Usage](#usage).|
104+
| **MaxOverlap** | _Optional_. Gets or sets the maximum number of characters to overlap between chunks.|
105+
| **InputType** | _Optional_. Gets the type of the input. |
110106
| **ConnectionName** | The name of an app setting or environment variable that contains the connection string value. This property supports binding expressions. |
111107
| **Collection** | The name of the collection or table or index to search. This property supports binding expressions.|
112-
| **Query** | Gets or sets the semantic query text to use for searching. This property is only used for the semantic search input binding. This property supports binding expressions.|
113-
| **EmbeddingsModel** | Gets or sets the ID of the model to use for embeddings. The default value is `text-embedding-3-small`. This property supports binding expressions.|
114-
| **ChatModel** | Gets or sets the name of the Large Language Model to invoke for chat responses. The default value is `gpt-3.5-turbo`. This property supports binding expressions.|
115-
| **SystemPrompt** | _Optional_. Gets or sets the system prompt to use for prompting the large language model. The system prompt is appended with knowledge that is fetched as a result of the `Query`. The combined prompt is then sent to the OpenAI Chat API. This property supports binding expressions.|
116-
| **MaxKnowledgeCount** | _Optional_. Gets or sets the number of knowledge items to inject into the `SystemPrompt`.|
117-
118108

119109
::: zone-end
120110
::: zone pivot="programming-language-java"
@@ -125,14 +115,13 @@ The `EmbeddingsStoreOutput` annotation enables you to define a embeddings store
125115
| Element | Description |
126116
| ------- | ----------- |
127117
| **name** | Gets or sets the name of the output binding. |
118+
| **input** | The input string for which to generate embeddings. |
119+
| **model** | _Optional_. The ID of the model to use, which defaults to `text-embedding-ada-002`. You shouldn't change the model for an existing database. For more information, see [Usage](#usage). |
120+
| **maxChunkLength** | _Optional_. The maximum number of characters used for chunking the input. For more information, see [Usage](#usage).|
121+
| **maxOverlap** | _Optional_. Gets or sets the maximum number of characters to overlap between chunks.|
122+
| **inputType** | _Optional_. Gets the type of the input. |
128123
| **connectionName** | The name of an app setting or environment variable that contains the connection string value. This property supports binding expressions. |
129124
| **collection** | The name of the collection or table or index to search. This property supports binding expressions.|
130-
| **query** | Gets or sets the semantic query text to use for searching. This property is only used for the semantic search input binding. This property supports binding expressions.|
131-
| **embeddingsModel** | Gets or sets the ID of the model to use for embeddings. The default value is `text-embedding-3-small`. This property supports binding expressions.|
132-
| **chatModel** | Gets or sets the name of the Large Language Model to invoke for chat responses. The default value is `gpt-3.5-turbo`. This property supports binding expressions.|
133-
| **systemPrompt** | _Optional_. Gets or sets the system prompt to use for prompting the large language model. The system prompt is appended with knowledge that is fetched as a result of the `Query`. The combined prompt is then sent to the OpenAI Chat API. This property supports binding expressions.|
134-
| **maxKnowledgeCount** | _Optional_. Gets or sets the number of knowledge items to inject into the `SystemPrompt`.|
135-
136125

137126
::: zone-end
138127
::: zone pivot="programming-language-python"
@@ -143,13 +132,13 @@ During the preview, define the output binding as a `generic_output_binding` bind
143132
|Parameter | Description |
144133
|---------|-------------|
145134
| **arg_name** | The name of the variable that represents the binding parameter. |
135+
| **input** | The input string for which to generate embeddings. |
136+
| **model** | _Optional_. The ID of the model to use, which defaults to `text-embedding-ada-002`. You shouldn't change the model for an existing database. For more information, see [Usage](#usage). |
137+
| **maxChunkLength** | _Optional_. The maximum number of characters used for chunking the input. For more information, see [Usage](#usage).|
138+
| **max_overlap** | _Optional_. Gets or sets the maximum number of characters to overlap between chunks.|
139+
| **input_type** | Gets the type of the input. |
146140
| **connection_name** | The name of an app setting or environment variable that contains the connection string value. This property supports binding expressions. |
147141
| **collection** | The name of the collection or table or index to search. This property supports binding expressions.|
148-
| **query** | Gets or sets the semantic query text to use for searching. This property is only used for the semantic search input binding. This property supports binding expressions.|
149-
| **embeddings_model** | Gets or sets the ID of the model to use for embeddings. The default value is `text-embedding-3-small`. This property supports binding expressions.|
150-
| **chat_model** | Gets or sets the name of the Large Language Model to invoke for chat responses. The default value is `gpt-3.5-turbo`. This property supports binding expressions.|
151-
| **system_prompt** | _Optional_. Gets or sets the system prompt to use for prompting the large language model. The system prompt is appended with knowledge that is fetched as a result of the `Query`. The combined prompt is then sent to the OpenAI Chat API. This property supports binding expressions.|
152-
| **max_knowledge_count** | _Optional_. Gets or sets the number of knowledge items to inject into the `SystemPrompt`.|
153142

154143
::: zone-end
155144
::: zone pivot="programming-language-powershell"
@@ -162,13 +151,13 @@ The binding supports these configuration properties that you set in the function
162151
| **type** | Must be `embeddingsStore`. |
163152
| **direction** | Must be `out`. |
164153
| **name** | The name of the output binding. |
154+
| **input** | The input string for which to generate embeddings. |
155+
| **model** | _Optional_. The ID of the model to use, which defaults to `text-embedding-ada-002`. You shouldn't change the model for an existing database. For more information, see [Usage](#usage). |
156+
| **maxChunkLength** | _Optional_. The maximum number of characters used for chunking the input. For more information, see [Usage](#usage).|
157+
| **maxOverlap** | _Optional_. Gets or sets the maximum number of characters to overlap between chunks.|
158+
| **inputType** | _Optional_. Gets the type of the input. |
165159
| **connectionName** | The name of an app setting or environment variable that contains the connection string value. This property supports binding expressions. |
166160
| **collection** | The name of the collection or table or index to search. This property supports binding expressions.|
167-
| **query** | Gets or sets the semantic query text to use for searching. This property is only used for the semantic search input binding. This property supports binding expressions.|
168-
| **embeddingsModel** | Gets or sets the ID of the model to use for embeddings. The default value is `text-embedding-3-small`. This property supports binding expressions.|
169-
| **chatModel** | Gets or sets the name of the Large Language Model to invoke for chat responses. The default value is `gpt-3.5-turbo`. This property supports binding expressions.|
170-
| **systemPrompt** | _Optional_. Gets or sets the system prompt to use for prompting the large language model. The system prompt is appended with knowledge that is fetched as a result of the `Query`. The combined prompt is then sent to the OpenAI Chat API. This property supports binding expressions.|
171-
| **maxKnowledgeCount** | _Optional_. Gets or sets the number of knowledge items to inject into the `SystemPrompt`.|
172161

173162
::: zone-end
174163
::: zone pivot="programming-language-javascript,programming-language-typescript"
@@ -178,13 +167,13 @@ The binding supports these properties, which are defined in your code:
178167

179168
|Property | Description |
180169
|-----------------------|-------------|
170+
| **input** | The input string for which to generate embeddings. |
171+
| **model** | _Optional_. The ID of the model to use, which defaults to `text-embedding-ada-002`. You shouldn't change the model for an existing database. For more information, see [Usage](#usage). |
172+
| **maxChunkLength** | _Optional_. The maximum number of characters used for chunking the input. For more information, see [Usage](#usage).|
173+
| **maxOverlap** | _Optional_. Gets or sets the maximum number of characters to overlap between chunks.|
174+
| **inputType** | _Optional_. Gets the type of the input. |
181175
| **connectionName** | The name of an app setting or environment variable that contains the connection string value. This property supports binding expressions. |
182176
| **collection** | The name of the collection or table or index to search. This property supports binding expressions.|
183-
| **query** | Gets or sets the semantic query text to use for searching. This property is only used for the semantic search input binding. This property supports binding expressions.|
184-
| **embeddingsModel** | Gets or sets the ID of the model to use for embeddings. The default value is `text-embedding-3-small`. This property supports binding expressions.|
185-
| **chatModel** | Gets or sets the name of the Large Language Model to invoke for chat responses. The default value is `gpt-3.5-turbo`. This property supports binding expressions.|
186-
| **systemPrompt** | _Optional_. Gets or sets the system prompt to use for prompting the large language model. The system prompt is appended with knowledge that is fetched as a result of the `Query`. The combined prompt is then sent to the OpenAI Chat API. This property supports binding expressions.|
187-
| **maxKnowledgeCount** | _Optional_. Gets or sets the number of knowledge items to inject into the `SystemPrompt`.|
188177

189178
::: zone-end
190179

0 commit comments

Comments
 (0)