-
Notifications
You must be signed in to change notification settings - Fork 149
Telegram bot
- Tools server
- Embeddings server (if search_source tool is used)
You can program from your phone with llama-vscode and Telegram. Part of the agent functionality of llama-vscode could be used from Telegram (i.e. from phone) via a Telegram Bot. The user creates a Telegram Bot and sets it's token in setting telegram_api_token. After that all messages to this bot are forwarded to the agent in llama-vscode. The AI agent answers are sent to the user in Telegram. For security reasons, only users from a white list (setting telegram_bot_users) are allowed to use the bot. The bot answers, for example to /help command, are provided in the language, which is set in setting "Language". The user could also confirm permission requests for terminal commands, changing and deleting files from Telegram.
- Create a Telegram Bot. Creating a bot in Telegram is simple - open bot @BotFather, click Start and execute the command /newbot. There you will see the bot API token.
- Set the bot API token in setting telegram_api_token
- Find your user id in Telegram (in Telegram bot @userinofobot send "/start") and add it to setting telegram_bot_users
- Enable the bot in setting telegram_bot_enabled
Every message to your Telegram bot (from 1.) will be forwarded to the agent in llama-vscode and the bot will send back the answer.
Here are the commands (messages, which start with "/"), which the bot can execute (if the message doesn't start with "/", it is sent to the agent) :
- /env - shows the current tools model and agent
- /models - shows the available models
- /agents - shows the available agents
- /setmodel n - sets the model to the n-th model. (models numbers are available from command /models)
- /setagent n - sets the agent to the n-th agent. (agents numbers are available from command /agents)
- /tools - lists all tools with a check for the active ones
- /addtools x,y,z - sets the active tools (x,y,z are the numbers of the tools from /tools command)
- /removetools x,y,z - removes the tools (x,y,z are the numbers of the tools from /tools command)
- /stop - stops the agent
- /status - shows the current status of the agent
- /chat n - gets the last n characters of the current chat. If n is not specified, the last 1000 characters are returned
- /newchat, /new - stops the current chat and starts a new chat
- /setlang xx - sets the language, which is used by the bot: bg - Bulgarian (Български), cn - Chinese (中文), en - English, fr - French (Français), de - German (Deutsch), ru - Russian (Русский), es - Spanish (Español)
- / - shows available telegram bot commands
- // - shows the available agent commands
- /help - shows help information for using the bot
- telegram_api_token - Telegram Bot token
- telegram_bot_users - List of users, which are allowed to use the bot.
- telegram_bot_enabled - Enable/disable the bot.
- telegram_chunk_size - The size of the chunks (in chars), which are sent as AI response to Telegram. Each chunk is a separate message.
- language - The language, on which the bot provides help and other bot specific answers.
- tools_permission_timeout - The timeout (in seconds) for giving tool execution permission. If not answered within this timeout, the agent will assume a silent answer with No. Default 600 seconds.