This guide will walk you through setting up a Python environment, installing dependencies, and launching an agent server in the TangramCollaborativeAI project.
To ensure a clean workspace, it's best to create a Python virtual environment.
-
Open a terminal and navigate to the agent's directory:
cd models/[agent_directory]Replace
[agent_directory]with the actual agent's folder name. -
Create a virtual environment inside the agent's directory:
python -m venv venv
-
Activate the virtual environment:
- On macOS/Linux:
source venv/bin/activate - On Windows (CMD):
venv\Scripts\activate
- On Windows (PowerShell):
venv\Scripts\Activate.ps1
- On macOS/Linux:
Each agent has its own dependencies listed in a requirements.txt file inside its directory. Once the virtual environment is activated, install them with:
pip install -r requirements.txtTo verify the installation, run:
pip listThe current implemented agents simpleGPTAgent and relationalAgentGPT expect an "OPENAI_API_KEY" Environment Variable to exist in the system, and to contain contain a valid openAI key.
To start the agent server, you must run the command from the TangramCollaborativeAI directory (one level above models).
-
Navigate to the project root:
cd ../../ # Go to TangramCollaborativeAI
-
Run the agent server using the following command structure:
python -m models.[agent_directory].[agent_main_file]
Replace:
[agent_directory]with the agent's folder name.[agent_main_file]with the main script name (without.py).
There are currently 3 Agents available to use, our most complex agent that utilizes spacial descriptions relationalAgent, our self reflective agent simpleGPTAgent and a random playing agent corresponding to the default template behaviour
To launch the RelationalAgent, use:
python -m models.relationalAgent.relationalAgentGPTTo launch the SimpleGPTAgent, use:
python -m models.simpleAgent.simpleGPTAgentTo launch the class default random behaviour, use:
python -m models.templates.agentTemplateNow your agent server should be up and running!