BindingApi Class

Interface to extend for using existing binding decorator functions.

Inheritance
BindingApi
BindingApi

Constructor

BindingApi(*args, **kwargs)

Methods

assistant_create_output

The assistantCreate output binding creates a new assistant with a specified system prompt.

parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_post_input

The assistantPost output binding sends a message to the assistant and saves the response in its internal state.

assistant to respond to. :param model: The OpenAI chat model to use. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_query_input

The assistantQuery input binding fetches the assistant history and passes it to the function.

history to fetch. The timestamp should be in ISO 8601 format - for example, 2023-08-01T00:00:00Z. :param id: The ID of the Assistant to query. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

blob_input

The blob_input decorator adds <xref:azure.functions.BlobInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining BlobInput in the function.json which enables function to write message(s) to the storage blobs. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-storage-blob

that specifies how to connect to Azure Blobs. :param data_type: Defines how Functions runtime should treat the

parameter value.

fields to include in the binding json.

blob_output

The blob_output decorator adds <xref:azure.functions.BlobOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining BlobOutput in the function.json which enables function to write message(s) to the storage blobs. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-storage-blob

fields to include in the binding json. :return: Decorator function.

cosmos_db_input

The cosmos_db_input decorator adds <xref:azure.functions.CosmosDBInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBInput in the function.json which

enables function to read from CosmosDB.

All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v4

DocumentList input object in function code :param connection: The name of an app setting or setting container that

specifies how to connect to the Azure Cosmos DB account being monitored containing your Azure Cosmos DB connection string

document :param partition_key: Specifies the partition key value for the lookup :param id: The ID of the document to retrieve :param sql_query: An Azure Cosmos DB SQL query used for retrieving multiple documents :param preferred_locations: (Optional) Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

cosmos_db_input_v3

The cosmos_db_input_v3 decorator adds <xref:azure.functions.CosmosDBInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 2.x or 3.x. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBInput in the function.json which enables function to read from CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v2

DocumentList input object in function code. :param database_name: The database containing the document. :param collection_name: The name of the collection that contains the document. :param connection_string_setting: The name of the app setting containing your Azure Cosmos DB connection string. :param id: The ID of the document to retrieve. :param sql_query: An Azure Cosmos DB SQL query used for retrieving multiple documents. :param partition_key: Specifies the partition key value for the lookup. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

cosmos_db_output

The cosmos_db_output decorator adds <xref:azure.functions.CosmosDBOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBOutput in the function.json which enables function to write to the CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v4

output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the Azure Cosmos DB account being monitored :param database_name: The name of the Azure Cosmos DB database with the collection being monitored :param container_name: The name of the container being monitored :param create_if_not_exists: A boolean value to indicate whether the collection is created when it doesn't exist :param partition_key: When CreateIfNotExists is true, it defines the partition key path for the created collection :param container_throughput: When createIfNotExists is true, it defines the throughput of the created container PreferredLocations, it can leverage multi-region writes in the Azure Cosmos DB service :param preferred_locations: Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

cosmos_db_output_v3

The cosmos_db_output_v3 decorator adds <xref:azure.functions.CosmosDBOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 2.x or 3.x. For additional details, please refer https://aka.ms/cosmosdb-v4-update.

This is equivalent to defining CosmosDBOutput

in the function.json which enables function to write to the CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v2

output object in function code. :param database_name: The name of the Azure Cosmos DB database with the collection being monitored. :param collection_name: The name of the collection being monitored. :param connection_string_setting: The name of an app setting or setting collection that specifies how to connect to the Azure Cosmos DB account being monitored. :param create_if_not_exists: A boolean value to indicate whether the collection is created when it doesn't exist. :param partition_key: When CreateIfNotExists is true, it defines the partition key path for the created collection. :param collection_throughput: When CreateIfNotExists is true, it defines the throughput of the created collection. :param use_multiple_write_locations: When set to true along with PreferredLocations, it can leverage multi-region writes in the Azure Cosmos DB service. :param preferred_locations: Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

dapr_binding_output

The dapr_binding_output decorator adds <xref:azure.functions.DaprBindingOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprBindingOutput in the function.json which enables function to send a value to a Dapr output binding. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-binding-output-binding

output object in function code. :param binding_name: The configured name of the binding. :param operation: The configured operation. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_invoke_output

The dapr_invoke_output decorator adds <xref:azure.functions.DaprInvokeOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprInvokeOutput in the function.json which enables function to invoke another Dapr App. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-invoke-output-binding

output object in function code. :param app_id: The dapr app name to invoke. :param method_name: The method name of the app to invoke. :param http_verb: The http verb of the app to invoke. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_publish_output

The dapr_publish_output decorator adds <xref:azure.functions.DaprPublishOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprPublishOutput in the function.json which enables function to publish topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-publish-output-binding

output object in function code. :param pub_sub_name: The pub/sub name to publish to. :param topic: The name of the topic to publish to. :param dapr_address: Dapr address, it is optional field, by default ßit will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_secret_input

The dapr_secret_input decorator adds <xref:azure.functions.DaprSecretInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprSecretInput in the function.json which enables function to read secret from underlying secret store component. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-secret-input-binding

input object in function code. :param secret_store_name: The name of the secret store to get the secret from. :param key: The key identifying the name of the secret to get. :param metadata: An array of metadata properties in the form "key1=value1&key2=value2". :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

dapr_state_input

The dapr_state_input decorator adds <xref:azure.functions.DaprStateInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprStateInput in the function.json which enables function to read state from underlying state store component. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-state-input-binding

input object in function code. :param state_store: State store containing the state. :param key: The name of the key. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

dapr_state_output

The dapr_state_output decorator adds <xref:azure.functions.DaprStateOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprStateOutput in the function.json which enables function to write to the dapr state store. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-state-output-binding

output object in function code. :param state_store: State store containing the state for keys. :param key: The name of the key. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

durable_client_input

Register a Durable-client Function.

embeddings_input

The embeddings input decorator creates embeddings which will be used to measure the relatedness of text strings.

Ref: https://platform.openai.com/docs/guides/embeddings

embeddings for. :param input_type: The type of the input. :param model: The ID of the model to use. :param max_chunk_length: The maximum number of characters to chunk the input into. Default value: 8 * 1024 :param max_overlap: The maximum number of characters to overlap between chunks. Default value: 128 :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

embeddings_store_output

Supported list of embeddings store is extensible, and more can be added by authoring a specially crafted NuGet package. Visit the currently supported vector specific folder for specific usage information:

  • Azure AI Search

  • Azure Data Explorer

  • Azure Cosmos DB using MongoDB

variable which contains a connection string value :param collection: The collection or table to search. :param model: The ID of the model to use. :param max_chunk_length: The maximum number of characters to chunk the input into. :param max_overlap: The maximum number of characters to overlap between chunks. :param data_type: Optional. Defines how Functions runtime should treat the parameter value. Default value: None :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

event_grid_output

The event_grid_output decorator adds <xref:azure.functions.EventGridOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining output binding in the function.json which enables function to write events to a custom topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/eventgridtrigger

represents the event. :param data_type: Defines how Functions runtime should treat the parameter value. :param topic_endpoint_uri: The name of an app setting that contains the URI for the custom topic. :param topic_key_setting: The name of an app setting that contains an access key for the custom topic. :param connection: The value of the common prefix for the setting that contains the topic endpoint URI. :return: Decorator function.

event_hub_output

The event_hub_output decorator adds <xref:azure.functions.EventHubOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining EventHubOutput in the function.json which enables function to write message(s) to the event hub. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-event-hubs

output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Event Hub. :param event_hub_name: The name of the event hub. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

function_name

Optional: Sets name of the Function object. If not set, it will default to the name of the method name.

additional setting fields :return: Decorator function.

generic_input_binding

The generic_input_binding decorator adds <xref:azure.functions.GenericInputBinding> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining a generic input binding in the function.json which enables function to read data from a custom defined input source. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-custom

fields to include in the binding json.

generic_output_binding

The generic_output_binding decorator adds <xref:azure.functions.GenericOutputBinding> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining a generic output binding in the function.json which enables function to write data from a custom defined output source. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-custom

fields to include in the binding json.

http_type

Set http type of the Function object.

kafka_output

The kafka_output decorator adds <xref:azure.functions.KafkaOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining output binding in the function.json which enables function to write events to a kafka topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/kafkaoutput

represents the event. :param topic: The topic monitored by the trigger. :param broker_list: The list of Kafka brokers monitored by the trigger. :param avro_schema: This should be used only if a generic record should be generated. :param username: SASL username for use with the PLAIN and SASL-SCRAM-..

mechanisms. Default is empty string. This is equivalent to

'sasl.username' in librdkafka. :param password: SASL password for use with the PLAIN and SASL-SCRAM-..

mechanisms. Default is empty string. This is equivalent to

'sasl.password' in librdkafka. :param ssl_key_location: Path to client's private key (PEM) used for

authentication. Default is empty string. This is equivalent to

'ssl.key.location' in librdkafka. :param ssl_ca_location: Path to CA certificate file for verifying the broker's certificate. This is equivalent to 'ssl.ca.location' in librdkafka. :param ssl_certificate_location: Path to client's certificate. This is equivalent to 'ssl.certificate.location' in librdkafka. :param ssl_key_password: Password for client's certificate. This is equivalent to 'ssl.key.password' in librdkafka. :param schema_registry_url: URL for the Avro Schema Registry. :param schema_registry_username: Username for the Avro Schema Registry. :param schema_registry_password: Password for the Avro Schema Registry. :param o_auth_bearer_method: Either 'default' or 'oidc'. sasl.oauthbearer in librdkafka. :param o_auth_bearer_client_id: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.client.id in librdkafka. :param o_auth_bearer_client_secret: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.client.secret in librdkafka. :param o_auth_bearer_scope: Specify only when o_auth_bearer_method is 'oidc'. Client use this to specify the scope of the access request to the broker. sasl.oauthbearer.scope in librdkafka. :param o_auth_bearer_token_endpoint_url: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.token.endpoint.url in librdkafka. :param o_auth_bearer_extensions: Allow additional information to be provided to the broker. Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea". sasl.oauthbearer.extensions in librdkafka :param max_message_bytes: Maximum transmit message size. Default is 1MB :param batch_size: Maximum number of messages batched in one MessageSet Default is 10000. :param enable_idempotence: When set to true, the producer will ensure

that messages are successfully produced exactly once and in the original produce order. Default is false.

enforced locally and limits the time a produced message waits for successful delivery. A time of 0 is infinite. This is the maximum time

used to deliver a message (including retries). Delivery error occurs

when either the retry count or the message timeout are exceeded. Default is 300000. :param request_timeout_ms: The ack timeout of the producer request in milliseconds. Default is 5000. :param max_retries: How many times to retry sending a failing Message. Default is 2147483647. Retrying may cause reordering unless 'EnableIdempotence' is set to 'True'. :param authentication_mode: SASL mechanism to use for authentication. Allowed values: Gssapi, Plain, ScramSha256, ScramSha512. Default is Plain. This is equivalent to 'sasl.mechanism' in librdkafka. :param protocol: Gets or sets the security protocol used to communicate

with brokers. Default is plain text. This is equivalent to

'security.protocol' in librdkafka. :param linger_ms: Linger.MS property provides the time between batches of messages being sent to cluster. Larger value allows more batching results in high throughput. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

queue_output

The queue_output decorator adds <xref:azure.functions.QueueOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining QueueOutput in the function.json which enables function to write message(s) to the storage queue. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-queue

queue output object in function code. :param queue_name: The name of the queue to poll. :param connection: The name of an app setting or setting collection that specifies how to connect to Azure Queues. :param data_type: Defines how Functions runtime should treat the

parameter value.

fields to include in the binding json.

semantic_search_input

The semantic search feature allows you to import documents into a vector database using an output binding and query the documents in that database using an input binding. For example, you can have a function that imports documents into a vector database and another function that issues queries to OpenAI using content stored in the vector database as

context (also known as the Retrieval Augmented Generation, or RAG technique).

Ref: https://platform.openai.com/docs/guides/embeddings

contains a connection string value. :param collection: The name of the collection or table to search or store. :param query: The semantic query text to use for searching. :param embeddings_model: The ID of the model to use for embeddings. The default value is "text-embedding-ada-002". :param chat_model: The name of the Large Language Model to invoke for chat responses. The default value is "gpt-3.5-turbo". :param system_prompt: Optional. The system prompt to use for prompting the large language model. :param max_knowledge_count: Optional. The number of knowledge items to inject into the SystemPrompt. Default value: 1 :param data_type: Optional. Defines how Functions runtime should treat the parameter value. Default value: None :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

service_bus_queue_output

The service_bus_queue_output decorator adds <xref:azure.functions.ServiceBusQueueOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining ServiceBusQueueOutput in the function.json which enables function to write message(s) to the service bus queue. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-service-bus

bus queue output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Service Bus. :param queue_name: Name of the queue to monitor. :param data_type: Defines how Functions runtime should treat the parameter value. :param access_rights: Access rights for the connection string. :return: Decorator function.

service_bus_topic_output

The service_bus_topic_output decorator adds <xref:azure.functions.ServiceBusTopicOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining ServiceBusTopicOutput in the function.json which enables function to write message(s) to the service bus topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-service-bus

bus topic output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Service Bus. :param topic_name: Name of the topic to monitor. :param subscription_name: Name of the subscription to monitor. :param data_type: Defines how Functions runtime should treat the parameter value, defaults to DataType.UNDEFINED. :param access_rights: Access rights for the connection string. :return: Decorator function.

sql_input

The sql_input decorator adds <xref:azure.functions.SqlInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. This is equivalent to defining SqlInput in the function.json which enables the function to read from a Sql database. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/sqlbindings

SqlRowList input object in function code :param command_text: The Transact-SQL query command or name of the stored procedure executed by the binding :param connection_string_setting: The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed :param command_type: A CommandType value, which is Text for a query and StoredProcedure for a stored procedure :param parameters: Zero or more parameter values passed to the command during execution as a single string. Must follow the format @param1=param1,@param2=param2 :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

sql_output

The sql_output decorator adds <xref:azure.functions.SqlOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. This is equivalent to defining SqlOutput in the function.json which enables the function to write to a Sql database. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/sqlbindings

Sql output object in function code :param command_text: The Transact-SQL query command or name of the stored procedure executed by the binding :param connection_string_setting: The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

table_input

The table_input decorator adds <xref:azure.functions.TableInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining TableInput in the function.json which enables function to read a table in an Azure Storage or Cosmos DB account All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/tablesbindings

the table or entity in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the table service. :param table_name: The Name of the table :param row_key: The row key of the table entity to read. :param partition_key: The partition key of the table entity to read. :param take: The maximum number of entities to return :param filter: An OData filter expression for the entities to return

from the table.

table_output

The table_output decorator adds <xref:azure.functions.TableOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining TableOutput in the function.json which enables function to write entities to a table in an Azure Storage All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/tablesbindings

the table or entity in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the table service. :param table_name: The Name of the table :param row_key: The row key of the table entity to read. :param partition_key: The partition key of the table entity to read. :param data_type: Defines how Functions runtime should treat the

parameter value.

text_completion_input

The textCompletion input binding can be used to invoke the OpenAI Chat Completions API and return the results to the function.

Ref: https://platform.openai.com/docs/guides/text-generation/chat-completions-vs-completions # NoQA

The examples below define "who is" HTTP-triggered functions with a hardcoded "who is {name}?" prompt, where {name} is the substituted with the value in the HTTP request path. The OpenAI input binding invokes the OpenAI GPT endpoint to surface the answer to the prompt to the function, which then returns the result text as the response content.

string. :param model: the ID of the model to use. :param temperature: The sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. :param top_p: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. It's generally recommend to use this or temperature :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_create_output

The assistantCreate output binding creates a new assistant with a specified system prompt.

parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_create_output(arg_name: str, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

assistant_post_input

The assistantPost output binding sends a message to the assistant and saves the response in its internal state.

assistant to respond to. :param model: The OpenAI chat model to use. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_post_input(arg_name: str, id: str, user_message: str, model: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
id
Required
user_message
Required
model
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

assistant_query_input

The assistantQuery input binding fetches the assistant history and passes it to the function.

history to fetch. The timestamp should be in ISO 8601 format - for example, 2023-08-01T00:00:00Z. :param id: The ID of the Assistant to query. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

assistant_query_input(arg_name: str, id: str, timestamp_utc: str, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
id
Required
timestamp_utc
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

blob_input

The blob_input decorator adds <xref:azure.functions.BlobInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining BlobInput in the function.json which enables function to write message(s) to the storage blobs. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-storage-blob

that specifies how to connect to Azure Blobs. :param data_type: Defines how Functions runtime should treat the

parameter value.

fields to include in the binding json.

blob_input(arg_name: str, path: str, connection: str, data_type: DataType | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
path
Required
connection
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

blob_output

The blob_output decorator adds <xref:azure.functions.BlobOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining BlobOutput in the function.json which enables function to write message(s) to the storage blobs. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-storage-blob

fields to include in the binding json. :return: Decorator function.

blob_output(arg_name: str, path: str, connection: str, data_type: DataType | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required

The name of the variable that represents the blob in function code.

path
Required

The path to the blob.

connection
Required

The name of an app setting or setting collection that specifies how to connect to Azure Blobs.

data_type
Required

Defines how Functions runtime should treat the parameter value.

Default value: None
kwargs
Required

Keyword arguments for specifying additional binding

cosmos_db_input

The cosmos_db_input decorator adds <xref:azure.functions.CosmosDBInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBInput in the function.json which

enables function to read from CosmosDB.

All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v4

DocumentList input object in function code :param connection: The name of an app setting or setting container that

specifies how to connect to the Azure Cosmos DB account being monitored containing your Azure Cosmos DB connection string

document :param partition_key: Specifies the partition key value for the lookup :param id: The ID of the document to retrieve :param sql_query: An Azure Cosmos DB SQL query used for retrieving multiple documents :param preferred_locations: (Optional) Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

cosmos_db_input(arg_name: str, connection: str, database_name: str, container_name: str, partition_key: str | None = None, id: str | None = None, sql_query: str | None = None, preferred_locations: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
connection
Required
database_name
Required
container_name
Required
partition_key
Required
Default value: None
id
Required
Default value: None
sql_query
Required
Default value: None
preferred_locations
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

cosmos_db_input_v3

The cosmos_db_input_v3 decorator adds <xref:azure.functions.CosmosDBInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 2.x or 3.x. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBInput in the function.json which enables function to read from CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v2

DocumentList input object in function code. :param database_name: The database containing the document. :param collection_name: The name of the collection that contains the document. :param connection_string_setting: The name of the app setting containing your Azure Cosmos DB connection string. :param id: The ID of the document to retrieve. :param sql_query: An Azure Cosmos DB SQL query used for retrieving multiple documents. :param partition_key: Specifies the partition key value for the lookup. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

cosmos_db_input_v3(arg_name: str, database_name: str, collection_name: str, connection_string_setting: str, id: str | None = None, sql_query: str | None = None, partition_key: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
database_name
Required
collection_name
Required
connection_string_setting
Required
id
Required
Default value: None
sql_query
Required
Default value: None
partition_key
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

cosmos_db_output

The cosmos_db_output decorator adds <xref:azure.functions.CosmosDBOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. For additional details, please refer https://aka.ms/cosmosdb-v4-update. This is equivalent to defining CosmosDBOutput in the function.json which enables function to write to the CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v4

output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the Azure Cosmos DB account being monitored :param database_name: The name of the Azure Cosmos DB database with the collection being monitored :param container_name: The name of the container being monitored :param create_if_not_exists: A boolean value to indicate whether the collection is created when it doesn't exist :param partition_key: When CreateIfNotExists is true, it defines the partition key path for the created collection :param container_throughput: When createIfNotExists is true, it defines the throughput of the created container PreferredLocations, it can leverage multi-region writes in the Azure Cosmos DB service :param preferred_locations: Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

cosmos_db_output(arg_name: str, connection: str, database_name: str, container_name: str, create_if_not_exists: bool | None = None, partition_key: str | None = None, container_throughput: int | None = None, preferred_locations: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
connection
Required
database_name
Required
container_name
Required
create_if_not_exists
Required
Default value: None
partition_key
Required
Default value: None
container_throughput
Required
Default value: None
preferred_locations
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

cosmos_db_output_v3

The cosmos_db_output_v3 decorator adds <xref:azure.functions.CosmosDBOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 2.x or 3.x. For additional details, please refer https://aka.ms/cosmosdb-v4-update.

This is equivalent to defining CosmosDBOutput

in the function.json which enables function to write to the CosmosDB. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-cosmosdb-v2

output object in function code. :param database_name: The name of the Azure Cosmos DB database with the collection being monitored. :param collection_name: The name of the collection being monitored. :param connection_string_setting: The name of an app setting or setting collection that specifies how to connect to the Azure Cosmos DB account being monitored. :param create_if_not_exists: A boolean value to indicate whether the collection is created when it doesn't exist. :param partition_key: When CreateIfNotExists is true, it defines the partition key path for the created collection. :param collection_throughput: When CreateIfNotExists is true, it defines the throughput of the created collection. :param use_multiple_write_locations: When set to true along with PreferredLocations, it can leverage multi-region writes in the Azure Cosmos DB service. :param preferred_locations: Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

cosmos_db_output_v3(arg_name: str, database_name: str, collection_name: str, connection_string_setting: str, create_if_not_exists: bool | None = None, partition_key: str | None = None, collection_throughput: int | None = None, use_multiple_write_locations: bool | None = None, preferred_locations: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
database_name
Required
collection_name
Required
connection_string_setting
Required
create_if_not_exists
Required
Default value: None
partition_key
Required
Default value: None
collection_throughput
Required
Default value: None
use_multiple_write_locations
Required
Default value: None
preferred_locations
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_binding_output

The dapr_binding_output decorator adds <xref:azure.functions.DaprBindingOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprBindingOutput in the function.json which enables function to send a value to a Dapr output binding. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-binding-output-binding

output object in function code. :param binding_name: The configured name of the binding. :param operation: The configured operation. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_binding_output(arg_name: str, binding_name: str, operation: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
binding_name
Required
operation
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_invoke_output

The dapr_invoke_output decorator adds <xref:azure.functions.DaprInvokeOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprInvokeOutput in the function.json which enables function to invoke another Dapr App. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-invoke-output-binding

output object in function code. :param app_id: The dapr app name to invoke. :param method_name: The method name of the app to invoke. :param http_verb: The http verb of the app to invoke. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_invoke_output(arg_name: str, app_id: str, method_name: str, http_verb: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
app_id
Required
method_name
Required
http_verb
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_publish_output

The dapr_publish_output decorator adds <xref:azure.functions.DaprPublishOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprPublishOutput in the function.json which enables function to publish topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-publish-output-binding

output object in function code. :param pub_sub_name: The pub/sub name to publish to. :param topic: The name of the topic to publish to. :param dapr_address: Dapr address, it is optional field, by default ßit will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_publish_output(arg_name: str, pub_sub_name: str, topic: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
pub_sub_name
Required
topic
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_secret_input

The dapr_secret_input decorator adds <xref:azure.functions.DaprSecretInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprSecretInput in the function.json which enables function to read secret from underlying secret store component. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-secret-input-binding

input object in function code. :param secret_store_name: The name of the secret store to get the secret from. :param key: The key identifying the name of the secret to get. :param metadata: An array of metadata properties in the form "key1=value1&key2=value2". :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

dapr_secret_input(arg_name: str, secret_store_name: str, key: str, metadata: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
secret_store_name
Required
key
Required
metadata
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_state_input

The dapr_state_input decorator adds <xref:azure.functions.DaprStateInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprStateInput in the function.json which enables function to read state from underlying state store component. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-state-input-binding

input object in function code. :param state_store: State store containing the state. :param key: The name of the key. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

dapr_state_input(arg_name: str, state_store: str, key: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
state_store
Required
key
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

dapr_state_output

The dapr_state_output decorator adds <xref:azure.functions.DaprStateOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining DaprStateOutput in the function.json which enables function to write to the dapr state store. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-dapr-state-output-binding

output object in function code. :param state_store: State store containing the state for keys. :param key: The name of the key. :param dapr_address: Dapr address, it is optional field, by default it will be set to http://localhost:{daprHttpPort}. :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

dapr_state_output(arg_name: str, state_store: str, key: str, dapr_address: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
state_store
Required
key
Required
dapr_address
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

durable_client_input

Register a Durable-client Function.

durable_client_input(client_name: str, task_hub: str | None = None, connection_name: str | None = None)

Parameters

Name Description
client_name
Required
str

Parameter name of durable client.

task_hub
Required
<xref:Optional>[str]

Used in scenarios where multiple function apps share the same storage account but need to be isolated from each other. If not specified, the default value from host.json is used. This value must match the value used by the target orchestrator functions.

Default value: None
connection_name
Required
<xref:Optional>[str]

The name of an app setting that contains a storage account connection string. The storage account represented by this connection string must be the same one used by the target orchestrator functions. If not specified, the default storage account connection string for the function app is used.

Default value: None

embeddings_input

The embeddings input decorator creates embeddings which will be used to measure the relatedness of text strings.

Ref: https://platform.openai.com/docs/guides/embeddings

embeddings for. :param input_type: The type of the input. :param model: The ID of the model to use. :param max_chunk_length: The maximum number of characters to chunk the input into. Default value: 8 * 1024 :param max_overlap: The maximum number of characters to overlap between chunks. Default value: 128 :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

embeddings_input(arg_name: str, input: str, input_type: InputType, model: str | None = None, max_chunk_length: int | None = 8192, max_overlap: int | None = 128, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
input
Required
input_type
Required
model
Required
Default value: None
max_chunk_length
Required
Default value: 8192
max_overlap
Required
Default value: 128
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

embeddings_store_output

Supported list of embeddings store is extensible, and more can be added by authoring a specially crafted NuGet package. Visit the currently supported vector specific folder for specific usage information:

  • Azure AI Search

  • Azure Data Explorer

  • Azure Cosmos DB using MongoDB

variable which contains a connection string value :param collection: The collection or table to search. :param model: The ID of the model to use. :param max_chunk_length: The maximum number of characters to chunk the input into. :param max_overlap: The maximum number of characters to overlap between chunks. :param data_type: Optional. Defines how Functions runtime should treat the parameter value. Default value: None :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

embeddings_store_output(arg_name: str, input: str, input_type: InputType, connection_name: str, collection: str, model: OpenAIModels | None = OpenAIModels.DefaultEmbeddingsModel, max_chunk_length: int | None = 8192, max_overlap: int | None = 128, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
input
Required
input_type
Required
connection_name
Required
collection
Required
model
Required
Default value: DefaultEmbeddingsModel
max_chunk_length
Required
Default value: 8192
max_overlap
Required
Default value: 128
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

event_grid_output

The event_grid_output decorator adds <xref:azure.functions.EventGridOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining output binding in the function.json which enables function to write events to a custom topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/eventgridtrigger

represents the event. :param data_type: Defines how Functions runtime should treat the parameter value. :param topic_endpoint_uri: The name of an app setting that contains the URI for the custom topic. :param topic_key_setting: The name of an app setting that contains an access key for the custom topic. :param connection: The value of the common prefix for the setting that contains the topic endpoint URI. :return: Decorator function.

event_grid_output(arg_name: str, topic_endpoint_uri: str | None = None, topic_key_setting: str | None = None, connection: str | None = None, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required

The variable name used in function code that

topic_endpoint_uri
Required
Default value: None
topic_key_setting
Required
Default value: None
connection
Required
Default value: None
data_type
Required
Default value: None

event_hub_output

The event_hub_output decorator adds <xref:azure.functions.EventHubOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining EventHubOutput in the function.json which enables function to write message(s) to the event hub. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-event-hubs

output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Event Hub. :param event_hub_name: The name of the event hub. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json.

event_hub_output(arg_name: str, connection: str, event_hub_name: str, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
connection
Required
event_hub_name
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

function_name

Optional: Sets name of the Function object. If not set, it will default to the name of the method name.

additional setting fields :return: Decorator function.

function_name(name: str, setting_extra_fields: Dict[str, Any] | None = None) -> Callable[[...], Any]

Parameters

Name Description
name
Required

Name of the function.

setting_extra_fields
Required

Keyword arguments for specifying

Default value: None

generic_input_binding

The generic_input_binding decorator adds <xref:azure.functions.GenericInputBinding> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining a generic input binding in the function.json which enables function to read data from a custom defined input source. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-custom

fields to include in the binding json.

generic_input_binding(arg_name: str, type: str, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
type
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

generic_output_binding

The generic_output_binding decorator adds <xref:azure.functions.GenericOutputBinding> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining a generic output binding in the function.json which enables function to write data from a custom defined output source. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-custom

fields to include in the binding json.

generic_output_binding(arg_name: str, type: str, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
type
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

http_type

Set http type of the Function object.

http_type(http_type: str) -> Callable[[...], Any]

Parameters

Name Description
http_type
Required

Http type of the function.

Returns

Type Description

Decorator function.

kafka_output

The kafka_output decorator adds <xref:azure.functions.KafkaOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining output binding in the function.json which enables function to write events to a kafka topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/kafkaoutput

represents the event. :param topic: The topic monitored by the trigger. :param broker_list: The list of Kafka brokers monitored by the trigger. :param avro_schema: This should be used only if a generic record should be generated. :param username: SASL username for use with the PLAIN and SASL-SCRAM-..

mechanisms. Default is empty string. This is equivalent to

'sasl.username' in librdkafka. :param password: SASL password for use with the PLAIN and SASL-SCRAM-..

mechanisms. Default is empty string. This is equivalent to

'sasl.password' in librdkafka. :param ssl_key_location: Path to client's private key (PEM) used for

authentication. Default is empty string. This is equivalent to

'ssl.key.location' in librdkafka. :param ssl_ca_location: Path to CA certificate file for verifying the broker's certificate. This is equivalent to 'ssl.ca.location' in librdkafka. :param ssl_certificate_location: Path to client's certificate. This is equivalent to 'ssl.certificate.location' in librdkafka. :param ssl_key_password: Password for client's certificate. This is equivalent to 'ssl.key.password' in librdkafka. :param schema_registry_url: URL for the Avro Schema Registry. :param schema_registry_username: Username for the Avro Schema Registry. :param schema_registry_password: Password for the Avro Schema Registry. :param o_auth_bearer_method: Either 'default' or 'oidc'. sasl.oauthbearer in librdkafka. :param o_auth_bearer_client_id: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.client.id in librdkafka. :param o_auth_bearer_client_secret: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.client.secret in librdkafka. :param o_auth_bearer_scope: Specify only when o_auth_bearer_method is 'oidc'. Client use this to specify the scope of the access request to the broker. sasl.oauthbearer.scope in librdkafka. :param o_auth_bearer_token_endpoint_url: Specify only when o_auth_bearer_method is 'oidc'. sasl.oauthbearer.token.endpoint.url in librdkafka. :param o_auth_bearer_extensions: Allow additional information to be provided to the broker. Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea". sasl.oauthbearer.extensions in librdkafka :param max_message_bytes: Maximum transmit message size. Default is 1MB :param batch_size: Maximum number of messages batched in one MessageSet Default is 10000. :param enable_idempotence: When set to true, the producer will ensure

that messages are successfully produced exactly once and in the original produce order. Default is false.

enforced locally and limits the time a produced message waits for successful delivery. A time of 0 is infinite. This is the maximum time

used to deliver a message (including retries). Delivery error occurs

when either the retry count or the message timeout are exceeded. Default is 300000. :param request_timeout_ms: The ack timeout of the producer request in milliseconds. Default is 5000. :param max_retries: How many times to retry sending a failing Message. Default is 2147483647. Retrying may cause reordering unless 'EnableIdempotence' is set to 'True'. :param authentication_mode: SASL mechanism to use for authentication. Allowed values: Gssapi, Plain, ScramSha256, ScramSha512. Default is Plain. This is equivalent to 'sasl.mechanism' in librdkafka. :param protocol: Gets or sets the security protocol used to communicate

with brokers. Default is plain text. This is equivalent to

'security.protocol' in librdkafka. :param linger_ms: Linger.MS property provides the time between batches of messages being sent to cluster. Larger value allows more batching results in high throughput. :param data_type: Defines how Functions runtime should treat the parameter value. :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

kafka_output(arg_name: str, topic: str, broker_list: str, avro_schema: str | None = None, username: str | None = None, password: str | None = None, ssl_key_location: str | None = None, ssl_ca_location: str | None = None, ssl_certificate_location: str | None = None, ssl_key_password: str | None = None, schema_registry_url: str | None = None, schema_registry_username: str | None = None, schema_registry_password: str | None = None, o_auth_bearer_method: OAuthBearerMethod | str | None = None, o_auth_bearer_client_id: str | None = None, o_auth_bearer_client_secret: str | None = None, o_auth_bearer_scope: str | None = None, o_auth_bearer_token_endpoint_url: str | None = None, o_auth_bearer_extensions: str | None = None, max_message_bytes: int = 1000000, batch_size: int = 10000, enable_idempotence: bool = False, message_timeout_ms: int = 300000, request_timeout_ms: int = 5000, max_retries: int = 2147483647, authentication_mode: BrokerAuthenticationMode | str | None = 'NOTSET', protocol: BrokerProtocol | str | None = 'NOTSET', linger_ms: int = 5, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
topic
Required
broker_list
Required
avro_schema
Required
Default value: None
username
Required
Default value: None
password
Required
Default value: None
ssl_key_location
Required
Default value: None
ssl_ca_location
Required
Default value: None
ssl_certificate_location
Required
Default value: None
ssl_key_password
Required
Default value: None
schema_registry_url
Required
Default value: None
schema_registry_username
Required
Default value: None
schema_registry_password
Required
Default value: None
o_auth_bearer_method
Required
Default value: None
o_auth_bearer_client_id
Required
Default value: None
o_auth_bearer_client_secret
Required
Default value: None
o_auth_bearer_scope
Required
Default value: None
o_auth_bearer_token_endpoint_url
Required
Default value: None
o_auth_bearer_extensions
Required
Default value: None
max_message_bytes
Required
Default value: 1000000
batch_size
Required
Default value: 10000
enable_idempotence
Required
Default value: False
message_timeout_ms
Required
Default value: 300000
request_timeout_ms
Required
Default value: 5000
max_retries
Required
Default value: 2147483647
authentication_mode
Required
Default value: NOTSET
protocol
Required
Default value: NOTSET
linger_ms
Required
Default value: 5
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

queue_output

The queue_output decorator adds <xref:azure.functions.QueueOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining QueueOutput in the function.json which enables function to write message(s) to the storage queue. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-queue

queue output object in function code. :param queue_name: The name of the queue to poll. :param connection: The name of an app setting or setting collection that specifies how to connect to Azure Queues. :param data_type: Defines how Functions runtime should treat the

parameter value.

fields to include in the binding json.

queue_output(arg_name: str, queue_name: str, connection: str, data_type: DataType | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
queue_name
Required
connection
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

semantic_search_input

The semantic search feature allows you to import documents into a vector database using an output binding and query the documents in that database using an input binding. For example, you can have a function that imports documents into a vector database and another function that issues queries to OpenAI using content stored in the vector database as

context (also known as the Retrieval Augmented Generation, or RAG technique).

Ref: https://platform.openai.com/docs/guides/embeddings

contains a connection string value. :param collection: The name of the collection or table to search or store. :param query: The semantic query text to use for searching. :param embeddings_model: The ID of the model to use for embeddings. The default value is "text-embedding-ada-002". :param chat_model: The name of the Large Language Model to invoke for chat responses. The default value is "gpt-3.5-turbo". :param system_prompt: Optional. The system prompt to use for prompting the large language model. :param max_knowledge_count: Optional. The number of knowledge items to inject into the SystemPrompt. Default value: 1 :param data_type: Optional. Defines how Functions runtime should treat the parameter value. Default value: None :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

semantic_search_input(arg_name: str, connection_name: str, collection: str, query: str | None = None, embeddings_model: OpenAIModels | None = OpenAIModels.DefaultEmbeddingsModel, chat_model: OpenAIModels | None = OpenAIModels.DefaultChatModel, system_prompt: str | None = 'You are a helpful assistant. You are responding to requests\n    from a user about internal emails and documents. You can and\n    should refer to the internal documents to help respond to\n    requests. If a user makes a request that\'s not covered by the\n    internal emails and documents, explain that you don\'t know the\n    answer or that you don\'t have access to the information.\n\n    The following is a list of documents that you can refer to when\n    answering questions. The documents are in the format\n    [filename]: [text] and are separated by newlines. If you answer\n    a question by referencing any of the documents, please cite the\n    document in your answer. For example, if you answer a question\n    by referencing info.txt, you should add "Reference: info.txt"\n    to the end of your answer on a separate line.', max_knowledge_count: int | None = 1, data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
connection_name
Required
collection
Required
query
Required
Default value: None
embeddings_model
Required
Default value: DefaultEmbeddingsModel
chat_model
Required
Default value: DefaultChatModel
system_prompt
Required
Default value: You are a helpful assistant. You are responding to requests from a user about internal emails and documents. You can and should refer to the internal documents to help respond to requests. If a user makes a request that's not covered by the internal emails and documents, explain that you don't know the answer or that you don't have access to the information. The following is a list of documents that you can refer to when answering questions. The documents are in the format [filename]: [text] and are separated by newlines. If you answer a question by referencing any of the documents, please cite the document in your answer. For example, if you answer a question by referencing info.txt, you should add "Reference: info.txt" to the end of your answer on a separate line.
max_knowledge_count
Required
Default value: 1
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

service_bus_queue_output

The service_bus_queue_output decorator adds <xref:azure.functions.ServiceBusQueueOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining ServiceBusQueueOutput in the function.json which enables function to write message(s) to the service bus queue. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-service-bus

bus queue output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Service Bus. :param queue_name: Name of the queue to monitor. :param data_type: Defines how Functions runtime should treat the parameter value. :param access_rights: Access rights for the connection string. :return: Decorator function.

service_bus_queue_output(arg_name: str, connection: str, queue_name: str, data_type: DataType | str | None = None, access_rights: AccessRights | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required

The name of the variable that represents service

connection
Required
queue_name
Required
data_type
Required
Default value: None
access_rights
Required
Default value: None

service_bus_topic_output

The service_bus_topic_output decorator adds <xref:azure.functions.ServiceBusTopicOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining ServiceBusTopicOutput in the function.json which enables function to write message(s) to the service bus topic. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/azure-function-binding-service-bus

bus topic output object in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to Service Bus. :param topic_name: Name of the topic to monitor. :param subscription_name: Name of the subscription to monitor. :param data_type: Defines how Functions runtime should treat the parameter value, defaults to DataType.UNDEFINED. :param access_rights: Access rights for the connection string. :return: Decorator function.

service_bus_topic_output(arg_name: str, connection: str, topic_name: str, subscription_name: str | None = None, data_type: DataType | str | None = None, access_rights: AccessRights | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required

The name of the variable that represents service

connection
Required
topic_name
Required
subscription_name
Required
Default value: None
data_type
Required
Default value: None
access_rights
Required
Default value: None

sql_input

The sql_input decorator adds <xref:azure.functions.SqlInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. This is equivalent to defining SqlInput in the function.json which enables the function to read from a Sql database. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/sqlbindings

SqlRowList input object in function code :param command_text: The Transact-SQL query command or name of the stored procedure executed by the binding :param connection_string_setting: The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed :param command_type: A CommandType value, which is Text for a query and StoredProcedure for a stored procedure :param parameters: Zero or more parameter values passed to the command during execution as a single string. Must follow the format @param1=param1,@param2=param2 :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

sql_input(arg_name: str, command_text: str, connection_string_setting: str, command_type: str | None = 'Text', parameters: str | None = None, data_type: DataType | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
command_text
Required
connection_string_setting
Required
command_type
Required
Default value: Text
parameters
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

sql_output

The sql_output decorator adds <xref:azure.functions.SqlOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This decorator will work only with extension bundle 4.x and above. This is equivalent to defining SqlOutput in the function.json which enables the function to write to a Sql database. All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/sqlbindings

Sql output object in function code :param command_text: The Transact-SQL query command or name of the stored procedure executed by the binding :param connection_string_setting: The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

sql_output(arg_name: str, command_text: str, connection_string_setting: str, data_type: DataType | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
command_text
Required
connection_string_setting
Required
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

table_input

The table_input decorator adds <xref:azure.functions.TableInput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining TableInput in the function.json which enables function to read a table in an Azure Storage or Cosmos DB account All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/tablesbindings

the table or entity in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the table service. :param table_name: The Name of the table :param row_key: The row key of the table entity to read. :param partition_key: The partition key of the table entity to read. :param take: The maximum number of entities to return :param filter: An OData filter expression for the entities to return

from the table.

table_input(arg_name: str, connection: str, table_name: str, row_key: str | None = None, partition_key: str | None = None, take: int | None = None, filter: str | None = None, data_type: DataType | str | None = None) -> Callable[[...], Any]

Parameters

Name Description
data_type

Defines how Functions runtime should treat the parameter value.

Default value: None
arg_name
Required
Default value: None
connection
Required
Default value: None
table_name
Required
Default value: None
row_key
Default value: None
partition_key
Default value: None
take
Default value: None
filter
Default value: None

Returns

Type Description

Decorator function.

table_output

The table_output decorator adds <xref:azure.functions.TableOutput> to the <xref:azure.functions.FunctionBuilder> object for building Function object used in worker function indexing model. This is equivalent to defining TableOutput in the function.json which enables function to write entities to a table in an Azure Storage All optional fields will be given default value by function host when they are parsed by function host.

Ref: https://aka.ms/tablesbindings

the table or entity in function code. :param connection: The name of an app setting or setting collection that specifies how to connect to the table service. :param table_name: The Name of the table :param row_key: The row key of the table entity to read. :param partition_key: The partition key of the table entity to read. :param data_type: Defines how Functions runtime should treat the

parameter value.

table_output(arg_name: str, connection: str, table_name: str, row_key: str | None = None, partition_key: str | None = None, data_type: DataType | str | None = None) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
connection
Required
table_name
Required
row_key
Required
Default value: None
partition_key
Required
Default value: None
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

text_completion_input

The textCompletion input binding can be used to invoke the OpenAI Chat Completions API and return the results to the function.

Ref: https://platform.openai.com/docs/guides/text-generation/chat-completions-vs-completions # NoQA

The examples below define "who is" HTTP-triggered functions with a hardcoded "who is {name}?" prompt, where {name} is the substituted with the value in the HTTP request path. The OpenAI input binding invokes the OpenAI GPT endpoint to surface the answer to the prompt to the function, which then returns the result text as the response content.

string. :param model: the ID of the model to use. :param temperature: The sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. :param top_p: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. It's generally recommend to use this or temperature :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). :param data_type: Defines how Functions runtime should treat the parameter value :param kwargs: Keyword arguments for specifying additional binding fields to include in the binding json

text_completion_input(arg_name: str, prompt: str, model: OpenAIModels | None = OpenAIModels.DefaultChatModel, temperature: str | None = '0.5', top_p: str | None = None, max_tokens: str | None = '100', data_type: DataType | str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
arg_name
Required
prompt
Required
model
Required
Default value: DefaultChatModel
temperature
Required
Default value: 0.5
top_p
Required
Default value: None
max_tokens
Required
Default value: 100
data_type
Required
Default value: None

Returns

Type Description

Decorator function.

Attributes

app_script_file

Name of function app script file in which all the functions are defined.

Script file defined here is for placeholder purpose, please refer to worker defined script file path as the single point of truth.

Returns

Type Description

Script file name.