This document describes the API for BitNet Virtual Co-worker Builder.
BitNet Virtual Co-worker Builder includes a RESTful API server that you can use to create and manage virtual co-workers and teams.
# Run the API server
python -m bitnet_vc_builder.api.server
The API documentation is available at http://localhost:8000/docs
.
Returns a welcome message.
Response:
{
"message": "Welcome to BitNet Virtual Co-worker Builder API"
}
Returns a list of all models.
Response:
{
"models": [
"BitNet-B1-58-Large",
"BitNet-B1-32-Medium",
"BitNet-B1-16-Small"
]
}
Creates a new model.
Request:
{
"name": "BitNet-B1-58-Large",
"model_path": "models/bitnet_b1_58_large",
"kernel_type": "i2_s",
"num_threads": 4,
"context_size": 2048,
"temperature": 0.7,
"top_p": 0.9,
"top_k": 40,
"repetition_penalty": 1.1
}
Response:
{
"message": "Model BitNet-B1-58-Large created successfully"
}
Returns information about a model.
Response:
{
"model_info": {
"model_path": "models/bitnet_b1_58_large",
"kernel_type": "i2_s",
"num_threads": 4,
"context_size": 2048,
"temperature": 0.7,
"top_p": 0.9,
"top_k": 40,
"repetition_penalty": 1.1,
"is_mock": false
}
}
Deletes a model.
Response:
{
"message": "Model BitNet-B1-58-Large deleted successfully"
}
Returns a list of all virtual co-workers.
Response:
{
"virtual_coworkers": [
"MathCoworker",
"ResearchCoworker",
"WriterCoworker"
]
}
Creates a new virtual co-worker.
Request:
{
"name": "MathCoworker",
"model_name": "BitNet-B1-58-Large",
"description": "A virtual co-worker that specializes in mathematics",
"system_prompt": "You are a mathematics expert. Help users with math problems.",
"tool_names": ["calculator"]
}
Response:
{
"message": "Virtual co-worker MathCoworker created successfully"
}
Returns information about a virtual co-worker.
Response:
{
"name": "MathCoworker",
"description": "A virtual co-worker that specializes in mathematics",
"model": {
"model_path": "models/bitnet_b1_58_large",
"kernel_type": "i2_s",
"num_threads": 4,
"context_size": 2048,
"temperature": 0.7,
"top_p": 0.9,
"top_k": 40,
"repetition_penalty": 1.1,
"is_mock": false
},
"tools": ["calculator"]
}
Deletes a virtual co-worker.
Response:
{
"message": "Virtual co-worker MathCoworker deleted successfully"
}
Runs a virtual co-worker on a task.
Request:
{
"task": "Calculate 2 + 2 * 3"
}
Response:
{
"task_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"result": null
}
Returns a list of all teams.
Response:
{
"teams": [
"ResearchTeam",
"DevelopmentTeam"
]
}
Creates a new team.
Request:
{
"name": "ResearchTeam",
"description": "A team that researches, analyzes, and reports on topics",
"virtual_coworker_names": ["ResearchCoworker", "AnalystCoworker", "WriterCoworker"],
"collaboration_mode": "SEQUENTIAL",
"max_parallel_tasks": 4,
"enable_conflict_resolution": true,
"enable_task_prioritization": true,
"enable_performance_tracking": true
}
Response:
{
"message": "Team ResearchTeam created successfully"
}
Returns information about a team.
Response:
{
"name": "ResearchTeam",
"description": "A team that researches, analyzes, and reports on topics",
"virtual_coworkers": ["ResearchCoworker", "AnalystCoworker", "WriterCoworker"],
"collaboration_mode": "SEQUENTIAL",
"max_parallel_tasks": 4,
"enable_conflict_resolution": true,
"enable_task_prioritization": true,
"enable_performance_tracking": true
}
Deletes a team.
Response:
{
"message": "Team ResearchTeam deleted successfully"
}
Runs a team on a task.
Request:
{
"task": "Research climate change, analyze the data, and write a report",
"coordinator_agent_name": "ResearchCoworker"
}
Response:
{
"task_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"result": null
}
Returns a list of all tasks.
Response:
{
"tasks": {
"123e4567-e89b-12d3-a456-426614174000": {
"task": "Calculate 2 + 2 * 3",
"status": "completed",
"result": "The result is 8.",
"created_at": 1626100000.0
},
"456e7890-e12d-34a5-b678-426614174000": {
"task": "Research climate change, analyze the data, and write a report",
"status": "in_progress",
"result": null,
"created_at": 1626100100.0
}
}
}
Returns information about a task.
Response:
{
"task_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "completed",
"result": "The result is 8."
}
Returns a list of all available tools.
Response:
{
"tools": [
{
"name": "calculator",
"description": "Calculate a mathematical expression",
"args_schema": {
"expression": {
"type": "string",
"description": "Mathematical expression to calculate"
}
}
},
{
"name": "search",
"description": "Search the web for information",
"args_schema": {
"query": {
"type": "string",
"description": "Search query"
}
}
}
]
}
Returns information about a tool.
Response:
{
"name": "calculator",
"description": "Calculate a mathematical expression",
"args_schema": {
"expression": {
"type": "string",
"description": "Mathematical expression to calculate"
}
}
}
Returns the current configuration.
Response:
{
"config": {
"server": {
"host": "0.0.0.0",
"port": 8000,
"debug": false,
"workers": 4
},
"model": {
"path": null,
"models_dir": "models",
"kernel_type": "i2_s",
"num_threads": 4,
"context_size": 2048,
"temperature": 0.7,
"top_p": 0.9,
"top_k": 40,
"repetition_penalty": 1.1
},
"memory": {
"max_items": 100,
"max_context_length": 2000,
"recency_bias": 0.7
},
"team": {
"default_collaboration_mode": "SEQUENTIAL",
"max_parallel_tasks": 4,
"enable_conflict_resolution": true,
"enable_task_prioritization": true,
"enable_performance_tracking": true
},
"logging": {
"level": "INFO",
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
"file": "logs/bitnet_vc_builder.log",
"max_size": 10485760,
"backup_count": 5
},
"ui": {
"theme": "light",
"max_history_items": 50,
"auto_refresh": true,
"refresh_interval": 5
}
}
}
Updates the configuration.
Request:
{
"server": {
"port": 8080
},
"model": {
"kernel_type": "i2_m"
}
}
Response:
{
"message": "Configuration updated successfully"
}
Returns the health status of the API server.
Response:
{
"status": "ok"
}