FME Form: 2024.1

AI Assist

Technology Preview

Note  This feature is under active development. Expect changes to the current behavior, and avoid using it in production environments.

Artificial Intelligence (AI) Assist helps you create SQL queries, regular expression search patterns, or Python code for FME Workbench parameters and dialogs.

Getting Started With AI Assist

AI Assist is available by default as an option under Tools > FME Options > AI Assist Options. If enabled, you can open AI Assist from any applicable dialog by clicking the AI Assist button: .

Specifying an AI Service Connection

By default, AI Assist authenticates with an Azure OpenAI service model using proprietary API keys of Safe Software, Inc. Authenticating to this service may result in connection problems. For this reason and others, you may wish to authenticate to your own OpenAI or Azure OpenAI account (multiple service models are supported). To do so, check Use My API Key (at bottom) and specify an OpenAI or Azure OpenAI web connection. For more information, see Using Web Connections.

Warning  If Use My API Key is checked, the cost of using an AI service is incurred on your account.

Using AI to Generate Python, RegEx, SQL

AI Assist is available in a number of FME Workbench dialogs that accept regular expressions (RegEx), SQL, and Python.

Pattern

Description

Example FME Workbench Locations

Python

In transformers that support Python code, AI Assist allows you to generate Python from a description, existing code, or a combination of both, and then refine, explain, or add comments to the generated Python code.

PythonCaller,

PythonCreator

[...]

RegEx

In parameters that support regular expressions, you can input a description in plain English, and AI Assist will generate a recommended expression to use, and a description of the results.

StringReplacer

[...]

SQL

In parameters that support SQL queries, you can input a description of a query in plain English, and AI Assist will generate a recommended SQL Query, and a description of the results.

InlineQuerier

[...]

 

Capabilities and Limitations

When working with AI Assist, keep in mind the following:

  • When AI Assist is open, you can still operate in the dialog from which it was launched. You can work freely between the launch dialog and AI Assist at all times.
  • AI Assist does not remember previous requests to generate code. Each request must be made independently of any previous request.

Generating Python

AI Assist is available in transformers that require Python code. You can Generate Python from a description (plus any existing code), and Refine, Explain, or Add Comments to the generated Python code.

Request

Select an Action from the drop-down list.

Action

Generate Code – Sends a request to generate code based on a combination of input request in the Python Description field and any existing code in the AI Results field.

Refine Code – Refines any existing Python Code. This action is most useful for code that is automatically copied from the Python editor when AI Assist is opened, or code that is manually written or edited directly in AI Assist.

Explain Code – Adds explanations of any existing Python Code to the Explanation section. This action is most useful for code that is automatically copied from the Python editor when AI Assist is opened, or code that is manually written or edited directly in AI Assist.

Add Comments – Adds comments to any existing Python Code.

Python Description

If Action is Generate Code, use this section to describe the requirement in plain English.

For best results:

  • Avoid using complex or technical language. AI prompts work best when they are simple and concise.
  • Provide as much FME-related context as possible, including the name of the application ("FME", "FME Workbench", or "FME Form") and the applicable transformer (for example, "PythonCaller").

Status

Displays the status of the AI Service.

AI Results

Generated results appear in this section.

Feedback Feedback helps us refine our features. To provide feedback on AI Assist, click the "thumb up" or the "thumb down" icon.

When the feedback panel opens, you can enter additional comments.

Explanation

The AI server generates an explanation of the Python code.

Generating RegEx

In parameters that support regular expressions, you can input a description in plain English, and AI Assist will generate a recommended expression to use, and a description of the results.

Regular Expression Description

Use this section to describe the requirement in plain English, and then click the Generate button.

Tip  Avoid using complex or technical language. AI prompts work best when they are simple and concise.

Status

Displays the status of the AI Service.

AI Results

Generated results appear in this section.

Feedback Feedback helps us refine our features. To provide feedback on AI Assist, click the "thumb up" or the "thumb down" icon.

When the feedback panel opens, you can enter additional comments.

Test String

AI Assist will generate strings to test the regular expression. You can also enter your own strings in this section.

Note  Test strings are not sent to the AI service.

Explanation

The AI server generates an explanation of the regular expression.

Generating SQL

In parameters that support SQL queries, AI Assist will generate a recommended SQL Query, and an explanation of the results.

Note  AI Assist is available for SQL queries only if the parameter is associated with a recognized database format in the workspace. For example, if the SQL Query editor is opened from the InlineQuerier parameters dialog, the AI Assist button is visible only when the InlineQuerier recognizes the database format that is queried.

SQL Query Description

Use this section to describe the requirement in plain English, and then click the Generate button.

Tip  Avoid using complex or technical language. AI prompts work best when they are simple and concise.
  • Send database schema to AI: If checked, the schema of the database you are querying is sent to the AI service along with the query description. Schema information includes relevant metadata about the database, such as table names, column names, and column data types. It does not include any actual data.

    Note  Send database schema to AI helps the AI service tailor the results to your database schema. However, depending on schema complexity, this option may add significant processing time to the request. If not checked, the SQL syntax that is returned may be correct, but will require you to substitute the relevant schema information in the results. For better results if not checked, specify the applicable database format in the SQL Query Description (for example, "Microsoft SQL Server Non-Spatial" or "MSSQL_ADO").

Status

Displays the status of the AI Service.

AI Results

Generated results appear in this section.

Feedback Feedback helps us refine our features. To provide feedback on AI Assist, click the "thumb up" or the "thumb down" icon.

When the feedback panel opens, you can enter additional comments.

Explanation

The AI server generates an explanation of the SQL query.