Skip to content

AI Gateway

In Flow 2, AI Gateway provides AI capabilities support for applications. The currently planned features are as follows.

Column Header Recognition

The application sends a JSON containing column headers to the interface, with the following structure.

json
["id", "english", "chinese", "french", "german", "spanish", "role"]

AI Gateway will return a JSON containing the inferred recognition results of the column headers, with the following structure.

json
[
 {
    "column": "id",
    "inference": ["key"]
 },
 {
    "column": "english",
    "inference": ["source", "en-US"]
 },
 {
    "column": "chinese",
    "inference": ["target", "zh-CN"]
 },
 {
    "column": "french",
    "inference": ["target", "fr-FR"]
 },
 {
    "column": "role",
    "inference": ["reference"]
 }
]

Inference is the AI's prediction of the column header, returned as an array representing a multi-level structure, for example:

json
"inference": ["target", "fr-FR"]

This indicates that this column is a target language, and it is French.

Tag Rules Automatic Detection and Generation

The application sends a piece of text to the interface, as follows:

<html>
    <body>
        <h1>Hello, World!</h1>
        <p>This is a {{test}}.</p>
    </body>
</html>

AI Gateway will infer which parts might be a type of tag and return the tags and their corresponding regular expressions.

json
[
    {
        "recognized": "html tag",
        "regex": "<.*>"
    },
    {
        "recognized": "double curly braces",
        "regex": "{{.*}}"
    }
]