Introduction
Meshagent CLI
Agents
Documents
Webhooks
Flutter SDK
Examples
Chatbot
If you want to create a chatbot service that will run in every room:
Copy
Ask AI
meshagent service create --name "chatbot" --image docker.io/meshagent/sample-chatbot:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=chatbot"
If you want to test the chatbot with a single room:
Copy
Ask AI
meshagent service test --room my-room --name "chatbot" --image docker.io/meshagent/sample-chatbot:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=chatbot"
Here is the chatbot service code if you want to create your own app:
Copy
Ask AI
from meshagent.api import RequiredToolkit
from meshagent.agents.chat import ChatBot
from meshagent.openai import OpenAIResponsesAdapter
from meshagent.api.services import ServiceHost
import asyncio
import os
service = ServiceHost()
@service.path("/agent")
class SimpleChatbot(ChatBot):
def __init__(self):
super().__init__(
name="meshagent.chatbot",
title="chatbot",
description="an simple chatbot",
rules=[
],
llm_adapter = OpenAIResponsesAdapter(),
requires=[
RequiredToolkit(
name="meshagent.markitdown",
tools=[ "markitdown_from_user", "markitdown_from_file" ]
),
]
)
asyncio.run(service.run())
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.