Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
The Azure OpenAI extension for Azure Functions is currently in preview.
The Azure OpenAI assistant create output binding allows you to create a new assistant chat bot from your function code execution.
For information on setup and configuration details of the Azure OpenAI extension, see Azure OpenAI extensions for Azure Functions. To learn more about Azure OpenAI assistants, see Azure OpenAI Assistants API.
Note
References and examples are only provided for the Node.js v4 model.
Note
References and examples are only provided for the Python v2 model.
Note
While both C# process models are supported, only isolated worker model examples are provided.
Example
Go support isn't currently available for this binding.
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.
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.
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.
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.
Here's the function.json file for Create Assistant:
For more information about function.json file properties, see the Configuration section.
{{This comes from the example code comment}}
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.
Attributes
Apply the CreateAssistant attribute to define an assistant create output binding, which supports these parameters:
| Parameter | Description |
|---|---|
| Id | The identifier of the assistant to create. |
| Instructions | Optional. The instructions that are provided to assistant to follow. |
| ChatStorageConnectionSetting | Optional. The configuration section name for the table settings for chat storage. The default value is AzureWebJobsStorage. |
| CollectionName | Optional. The table collection name for chat storage. The default value is ChatState. |
Annotations
The CreateAssistant annotation enables you to define an assistant create output binding, which supports these parameters:
| Element | Description |
|---|---|
| name | Gets or sets the name of the output binding. |
| id | The identifier of the assistant to create. |
| instructions | Optional. The instructions that are provided to assistant to follow. |
| chatStorageConnectionSetting | Optional. The configuration section name for the table settings for chat storage. The default value is AzureWebJobsStorage. |
| collectionName | Optional. The table collection name for chat storage. The default value is ChatState. |
Decorators
During the preview, define the output binding as a generic_output_binding binding of type createAssistant, which supports these parameters:
| Parameter | Description |
|---|---|
| arg_name | The name of the variable that represents the binding parameter. |
| id | The identifier of the assistant to create. |
| instructions | Optional. The instructions that are provided to assistant to follow. |
| chat_storage_connection_setting | Optional. The configuration section name for the table settings for chat storage. The default value is AzureWebJobsStorage. |
| collection_name | Optional. The table collection name for chat storage. The default value is ChatState. |
Configuration
The binding supports these configuration properties that you set in the function.json file.
| Property | Description |
|---|---|
| type | Must be CreateAssistant. |
| direction | Must be out. |
| name | The name of the output binding. |
| id | The identifier of the assistant to create. |
| instructions | Optional. The instructions that are provided to assistant to follow. |
| chatStorageConnectionSetting | Optional. The configuration section name for the table settings for chat storage. The default value is AzureWebJobsStorage. |
| collectionName | Optional. The table collection name for chat storage. The default value is ChatState. |
Configuration
The binding supports these properties, which are defined in your code:
| Property | Description |
|---|---|
| id | The identifier of the assistant to create. |
| instructions | Optional. The instructions that are provided to assistant to follow. |
| chatStorageConnectionSetting | Optional. The configuration section name for the table settings for chat storage. The default value is AzureWebJobsStorage. |
| collectionName | Optional. The table collection name for chat storage. The default value is ChatState. |
Usage
See the Example section for complete examples.