TelegramClient
: Handles Telegram message
input/outputToolCallingAgent
: Base agent class for handling tool-based
interactionsLiteLLMModel
: Integration with language models via LiteLLMconvert_action
).env
file in your project directory with the following variables:
agent.py
and add the following code:
character_agent.py
and add the following code:
tools.py
and add the following code:
agent.json
and add the following code:
agent.py
file:
LiteLLMModel
: Used for accessing and managing the OpenAI
GPT-4o model.TelegramClient
: Handles communication with the
Telegram bot, sending and receiving messages.ToolCallingAgent
: The agent implementation that processes user
messages and generates responses.convert_action
: Converts Composio actions into
Galadriel tools.CharacterAgent
class extends the ToolCallingAgent
to simulate Elon Musk’s persona.TELEGRAM_SYSTEM_PROMPT
template defines the system prompt for the bot, incorporating information from the agent.json
file.execute
method handles incoming messages, formats the prompt, and generates a response using the OpenAI GPT-4o model.Composio
and Time
tool and used to enhance agent capabilities.agent.json
file to change the agent’s name, system prompt, bio, lore, topics, and style.TELEGRAM_SYSTEM_PROMPT
in character_agent.py
to reference the new attributes in agent.json
.character_json_path
variable in the CharacterAgent
class to point to the new agent.json
file.agent.py
.
tools
list in the CharacterAgent
class.
inputs
and outputs
lists in the AgentRuntime
class to use a different client.