Azure OpenAI Function Generator

Overview

You can use this Snap to generate a function definition that can be used for tool calling in the chat completions endpoint. This Snap enables seamless integration by passing the results from tool executions in a structured format for downstream chat operations.


Azure OpenAI Function Generator Snap

Prerequisites

None.

Limitations and known issues

None.

Breaking change

With the main29029 GA release, ARRAY and OBJECT options have been removed from the Type dropdown list. If your existing pipelines use these options, the following errors are displayed:
  • Invalid property value found (ARRAY), must be one of: INTEGER, NUMBER, STRING, BOOLEAN
  • Invalid property value found (OBJECT), must be one of: INTEGER, NUMBER, STRING, BOOLEAN
Workaround: Replace ARRAY and OBJECT options with supported types (INTEGER, NUMBER, STRING, or BOOLEAN).

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has one document input view.
Output This Snap has one document output view. The output contains the function specification created with the properties to be used by Azure OpenAI.
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Note:
  • Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
  • Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
  • Add icon (Plus Icon): Indicates that you can add fields in the field set.
  • Remove icon (Minus Icon): Indicates that you can remove fields from the field set.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Azure OpenAI Function Generator

Example: Generate financial analysis

Name String/Expression Required. Specify the name for the function specification to be passed to Azure OpenAI. This will be the name of the function being created.

Default value: N/A

Example: generateSummary

Description String/Expression Specify the description for the function, explaining the function’s purpose and what it analyzes.

Default value: N/A

Example: Summarize text content
Strict Mode Checkbox Select this checkbox to ensure that the Snap validates the input parameters strictly according to the defined schema or constraints. When enabled, the model will follow the exact schema defined in the Parameters field.

Default status: Deselected

Note: The Snap supports only a subset of JSON Schema when this checkbox is selected. A list of unsupported JSON schema can be found here. If the checkbox is selected, all fields much be required. Otherwise, Azure OpenAI will respond with an error,
Parameters Use this field set to define the input parameters required for the Azure OpenAI function. You can specify the property name, description, type, and whether the parameter is required.
Property name String/Expression Required. Specify the name of the parameter required for the function. This name will be used within the function.

Default value: N/A

Example: Location
Property Description String/Expression Specify the description for the parameter to explain its purpose in the function.

Default value: N/A

Example: Get the current weather in a given location

Type Dropdown list Choose the type of input expected for the parameter. The options available include:
  • STRING
  • NUMBER
  • BOOLEAN
  • INTEGER
  • ARRAY
  • OBJECT
CAUTION: With the main29029 GA release, ARRAY and OBJECT options have been removed from the Type dropdown list. If your existing pipelines use these options, the following errors are displayed:
  • Invalid property value found (ARRAY), must be one of: INTEGER, NUMBER, STRING, BOOLEAN
  • Invalid property value found (OBJECT), must be one of: INTEGER, NUMBER, STRING, BOOLEAN

Workaround: Replace ARRAY and OBJECT options with supported types (INTEGER, NUMBER, STRING, or BOOLEAN).

Default value: STRING

Example: NUMBER

Enum String/Expression Specify the value from the user-defined list and serves to restrict the possible values of this attribute.

Default value: N/A

Example: STRING

Required Checkbox Select this checkbox if this parameter is mandatory for the function's specification.

Default status: Deselected

Snap execution Dropdown list
Select one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only