import asyncio
import os
from definable.agent import Agent
from definable.agent.interface import DiscordInterface
from definable.memory import Memory, SQLiteStore
from definable.tool.decorator import tool
@tool
def search_docs(query: str) -> str:
"""Search documentation for an answer."""
return f"Found results for: {query}"
agent = Agent(
model="gpt-4o",
instructions="You are a helpful Discord bot.",
tools=[search_docs],
memory=Memory(store=SQLiteStore("./discord_memory.db")),
)
discord = DiscordInterface(
agent=agent,
bot_token=os.environ["DISCORD_BOT_TOKEN"],
)
asyncio.run(discord.serve_forever())