Skip to main content
When creating AI applications, you can use external tools to obtain additional data through API Extensions and assemble it into the prompt as additional information for the LLM.

Extension Point

app.external_data_tool.query: Application external data tool query extension point. This extension point passes the application variable content input by the end user and the conversation input content (fixed parameter for conversational applications) to the API as parameters. You need to implement the corresponding tool query logic and return query results as string type.

Request Body

{
    "point": "app.external_data_tool.query", // Extension point type, fixed as app.external_data_tool.query
    "params": {
        "app_id": string,  // Application ID
        "tool_variable": string,  // External data tool variable name, indicating the source of the corresponding variable tool call
        "inputs": {  // Variable values passed by end user, key is variable name, value is variable value
            "var_1": "value_1",
            "var_2": "value_2",
            ...
        },
        "query": string | null  // Current conversation input content from end user, fixed parameter for conversational applications.
    }
}
Example:
{
    "point": "app.external_data_tool.query",
    "params": {
        "app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
        "tool_variable": "weather_retrieve",
        "inputs": {
            "location": "London"
        },
        "query": "How's the weather today?"
    }
}

API Response

{
    "result": string
}
Example:
{
    "result": "City: London\nTemperature: 10°C\nRealFeel®: 8°C\nAir Quality: Poor\nWind Direction: ENE\nWind Speed: 8 km/h\nWind Gusts: 14 km/h\nPrecipitation: Light rain"
}