# External\_data\_tool

Khi tạo ứng dụng AI, các nhà phát triển có thể sử dụng các phần mở rộng API để tích hợp dữ liệu bổ sung từ các công cụ bên ngoài vào các lời nhắc như thông tin bổ sung cho các mô hình ngôn ngữ lớn (LLM).

Vui lòng đọc [Phần Mở rộng Dựa trên API](/ii-tinh-nang-co-ban/extension-tien-ich/mo-rong-dua-tren-api.md) để hoàn thành việc phát triển và tích hợp các khả năng dịch vụ API cơ bản.

## Extension Point <a href="#extension-point" id="extension-point"></a>

`app.external_data_tool.query`: Áp dụng các công cụ dữ liệu bên ngoài để điểm mở rộng truy vấn.

Điểm mở rộng này lấy nội dung biến ứng dụng được truyền vào bởi người dùng cuối và nội dung đầu vào (các tham số cố định cho ứng dụng hội thoại) như là các tham số cho API. Các nhà phát triển cần triển khai logic truy vấn cho công cụ tương ứng và trả kết quả truy vấn dưới dạng chuỗi.

#### **Request Body**

```
{
    "point": "app.external_data_tool.query", 
    "params": {
        "app_id": string,  
        "tool_variable": string,  
        "inputs": {  
            "var_1": "value_1",
            "var_2": "value_2",
            ...
        },
        "query": string | null  
    }
}
```

* Ví dụ

```
{
    "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?"
    }
}
```

#### Phản hồi API

```
{
    "result": string
}
```

* Ví dụ

```
{
    "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"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.chatx.vn/ii-tinh-nang-co-ban/extension-tien-ich/mo-rong-dua-tren-api/external_data_tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
