> For the complete documentation index, see [llms.txt](https://doc.nextbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.nextbot.ru/functional/functions/sending-result/python-v.2/instrukciya-dlya-ai-assistenta.md).

# Инструкция для AI-ассистента

**Файл-инструкция** — это полный справочник по написанию Python-скриптов для ИИ-агента платформы NEXTBOT. Передайте этот файл вашему внешнему AI-ассистенту (например, Cursor, ChatGPT, Claude) — и он сможет писать готовые к вставке скрипты без необходимости вручную объяснять структуру платформы.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FJSxG2I38Kom65sUkxyqF%2Fimage.png?alt=media&amp;token=28bc1b81-4ce3-454f-b442-3597793aedde" alt=""><figcaption></figcaption></figure>

### Как скачать файл

1. Откройте любую функцию в NEXTBOT, добавьте Действия -> **Python Script**.
2. В правом верхнем углу редактора нажмите кнопку **«Инструкция для AI»**.
3. В открывшемся окне нажмите **«Скачать файл»**.

***

### Как использовать файл

После скачивания передайте файл AI-ассистенту одним из трёх способов:

**1. Cursor и подобные редакторы**

Добавьте файл в папку `.cursor/rules/` вашего проекта — Cursor будет автоматически учитывать его при генерации кода.

**2. Добавить в проект вручную**

Положите файл в корень проекта и добавляйте его в контекст запроса к AI вручную при необходимости.

**3. Вложение в чат с нейросетью**

Если чат поддерживает загрузку файлов (ChatGPT, Claude и др.) — приложите файл к диалогу. Модель использует его как справочник при написании скрипта.

***

### Аргументы текущего контекста

В том же окне находится блок **«Аргументы текущего контекста»** — это описание параметров конкретной функции, которую вы редактируете прямо сейчас: название, описание, входные аргументы и их типы, т.е это динамический блок.

Скопируйте этот текст и передайте нейросети **вместе с файлом-инструкцией** — это позволит AI точнее понять задачу и сгенерировать подходящий скрипт.

{% hint style="info" %}
Файл-инструкция описывает платформу в целом, а аргументы контекста — вашу конкретную функцию. Лучший результат достигается при использовании обоих.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.nextbot.ru/functional/functions/sending-result/python-v.2/instrukciya-dlya-ai-assistenta.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
