Insert Embedding
Sends input data to an embedding model and inserts the returned vector representation into a field or variable.
See also
Options
-
Account Name is a text expression of the AI account for this script step to use. In the current file, use the Configure AI Account script step to set up the account and assign it this name any time before this script step runs.
-
Embedding Model is the name of the model to generate embedding vectors. Specify the model name as a text expression, which is available from the model provider.
-
Input is any expression that returns text or container data to send to the model for conversion to embedding vectors.
-
Target specifies the field or variable to insert the returned embedding vectors into. If the variable doesn't exist, this script step creates it (see Using variables). If you specify a text field or a variable, the returned data is stored as text. If you specify a container field, then the returned data is stored as binary data, which can be smaller than when stored as text and can improve performance in any further processing with the embedding vectors.
Compatibility
Product | Supported |
FileMaker Pro | Yes |
FileMaker Go | Yes |
FileMaker WebDirect | Yes |
FileMaker Server | Yes |
FileMaker Cloud | Yes |
FileMaker Data API | Yes |
Custom Web Publishing | Yes |
Originated in version
21.0
Description
You must specify a target variable or field. If Target is not specified, this script step returns an error code that can be captured with the Get(LastError) function.
One example of how you might use embedding vectors is with the Perform Semantic Find script step, which can query the vector data produced by this script step or the Insert Embedding in Found Set script step.
For image as well as text embedding vectors, you can use the models supported by the open source model server provided separately with FileMaker Pro or installed with FileMaker Server. See the Claris Engineering Blog.
Example 1
Configures an AI account, goes to the Meeting Details layout, then uses the model to get embedding vectors for the text in the Meetings::Note field in the current record and stores it as binary data in the Meetings::Note_Embedding container field.
Configure AI Account [ Account Name: "my-account" ; Model Provider: OpenAI ; API key: "sk-RZCtpWT..." ]
Go to Layout [ "Meeting Details" (Meetings) ; Animation: None ]
Insert Embedding [ Account Name: "my-account" ; Embedding Model: "text-embedding-3-small" ; Input: Meetings::Note ; Target: Meetings::Note_Embedding ]