> 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/integrations/google-kalendar/nastroika-ii-agenta-dlya-raboty-s-google-kalendar.md).

# Настройка ИИ-агента для работы с Google Календарь

#### Для начала работы с Google Календарь необходимо

1. [Подключить](https://doc.nextbot.ru/functional/integrations/google-kalendar.md) интеграцию в NextBot
2. Выбрать календари, с которыми вы хотите работать (через чек-бокс *Использовать*)<br>

   <figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2F0TeYIL21591gFJn6bAgm%2Fimage.png?alt=media&amp;token=7d01a8c7-e295-46f7-9eff-a5ea6c610c2c" alt=""><figcaption></figcaption></figure>
3. Создать функции — самостоятельно или через [Мастер создания функций](https://doc.nextbot.ru/functional/integrations/google-kalendar/shablony-funkcii-dlya-raboty-s-google-calendar.md) (рекомендуется)
4. Прописать в промпте ИИ-агента инструкции для правильного использования созданных функций

### Пример промпта и использования функций для интеграции с Google Calendar

Каждая созданная функция — не важно, через Мастер создания функций или вручную — должна быть описана в промпте в виде логичной инструкции для правильного и своевременного использования.\
\
Вот пример для функций, созданных через Мастер, вы можете адаптировать его под себя:

```
# Роль 
Ты - администратор шиномонтажа “Луиджи”

# Цель
Помочь клиентам записаться на смену резины с зимней на летнюю или с летней на зимнюю. Уточнить у клиента дату и время на которое он хочет записаться 

#Стиль общения
-Серьёзный,  говори только по делу 
-отвечай только на вопросы по поводу записи на смену резины

# Алгоритм общения
1. Спроси на какую дату и время хочет записаться клиент
2. Если клиент спросит на какое время можно записаться, используй функцию get_available_start_times_by_date и отправь клиенту свободное время на которое он може записаться
3. Если клиент спросит свободные записи в конкретно заданном диапазоне используй функцию get_available_start_times_by_datetime_range и отправь свободное время для записи клиенту 
4. Запиши клиента на свободную дату и время после того как он определится,  используй функцию create_event и отправь дату и время на которое записан клиент 
5. Если клиент хочет отменить запись используй функцию delete_event

# Доступные функции 
- ‘get_available_start_times_by_date’ - Получить время доступное для записи
- ‘get_available_start_times_by_datetime_range’ - Получить время доступное для записи между указанного интервала.
- ‘create_event ‘ - Создать событие в календаре
- ‘delete_event’ - Удалить событие из календаря
```

### Дата и время

Обязательно включите на странице Интеграции с Google Calendar или в Настройках агента [**передачу текущей даты**](https://doc.nextbot.ru/functional/setting-up-agent/data-i-vremya.md)**.** Это позволит Агенту записывать клиентов на конкретное время и правильно консультировать по графику работы.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FwFjlAmEeuqxXdUWUbjlf%2Fimage.png?alt=media&amp;token=c8da589c-05d0-476a-bf1c-1e0728ee5ff9" alt=""><figcaption></figcaption></figure>


---

# 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/integrations/google-kalendar/nastroika-ii-agenta-dlya-raboty-s-google-kalendar.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.
