ServiceTemplate so users can configure the system prompt when they add it to their room.
To learn more about project vs room services and understand when to use each see intro to services and containers.
Example
Let’s create a simple chatbot that allows users to give it a system prompt when deploying. To deploy this we’ll create three files:- main.py: A MeshAgent-native chatbot service using ServiceHost
 - Dockerfile: Packages the service as a container
 - meshagent.yaml: A ServiceTemplateSpec that collects a system prompt variable from users when they add the service to their room
 
main.py
Dockerfile
Dockerfile
meshagent.yaml
yaml
Build and Push the Container
Build and push your container to a registry:bash
Note: We recommend docker buildx because it supports cross-platform builds, pushes directly to your registry in one step, and enables optional layer caching for much faster CI builds.
Deploy the Room Specific Service
From the terminal in the directory with your yaml file run:bash
Use the Service
- Open your room in MeshAgent Studio
 - You’ll be prompted to provide a system prompt for the chatbot
 - Once provided the service will start and the chatbot will appear in the participants tab
 
Verify the Service is Running
From the Developer Console at the bottom half of the room UI- Check the Containers tab, you’ll see your container with MeshAgent as the starter
 - Check the Logs tab for startup messages from your service
 
Related Topics
Containers run on demand, and will not automatically restart the next time you go into the room. If you want a container with your configuration to save and start automatically the next time the room starts, you will need to deploy a project wide service to manage the containers. Otherwise you can start containers as needed through the CLI/API. For more information on room and project services see:- Introduction to Services & Containers: Understand when to use project services, room services, and the Containers API.
 - Packaging Services: Learn how to package services for deployment
 - Deploying Services: Learn how to deploy services using the MeshAgent CLI or MeshAgent Studio UI
 - Project Service Example: Create and deploy a chatbot as a project service available in all rooms.
 - Containers API: Run containers on-demand without saving them as services