FME Form: 2024.1
AI Assist
Technology Preview
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.
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 |
---|---|---|
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 [...] |
|
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 [...] |
|
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").
Pattern |
Description |
Results |
---|---|---|
Python |
Create a new attribute called 'timestamp' that gives me the timestamp of each feature's entry into PythonCaller in FME.
|
Click the Apply button to copy the results to the Python code editor. |
Status
Displays the status of the AI Service.
AI Results
Generated results appear in this section.
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.
Pattern |
Description |
Results |
---|---|---|
RegEx |
Create a regular expression to match all mailing addresses on FRONT ST.
Click the Generate button to send the request. |
Click Apply to copy the results to the RegEx parameter. |
Status
Displays the status of the AI Service.
AI Results
Generated results appear in this section.
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.
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.
SQL Query Description
Use this section to describe the requirement in plain English, and then click the Generate button.
-
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").
Pattern |
Description |
Results |
---|---|---|
SQL |
Find all postal codes that contain 981.
Click the Generate button to send the request. |
Click the Apply button to copy the results to the SQL Query editor:
|
Status
Displays the status of the AI Service.
AI Results
Generated results appear in this section.
When the feedback panel opens, you can enter additional comments.
Explanation
The AI server generates an explanation of the SQL query.