fischer-agentkit/src/agentkit/cli/templates.py

144 lines
2.9 KiB
Python

"""Template files for agentkit init"""
AGENTKIT_YAML = """\
# AgentKit Configuration
# See https://github.com/fischer/agentkit for documentation
server:
host: "0.0.0.0"
port: 8001
workers: 1
api_key: null # Set to enable API key authentication
rate_limit: 60 # Requests per minute
llm:
providers:
bailian-coding:
type: openai
api_key: "${DASHSCOPE_API_KEY}"
base_url: "https://coding.dashscope.aliyuncs.com/v1"
models:
qwen3.7-plus:
alias: default
qwen3-coder-plus:
alias: coding
qwen3-max-2026-01-23:
alias: powerful
qwen-turbo:
alias: fast
model_aliases:
default: bailian-coding/qwen3.7-plus
coding: bailian-coding/qwen3-coder-plus
powerful: bailian-coding/qwen3-max-2026-01-23
fast: bailian-coding/qwen-turbo
session:
backend: memory
bus:
backend: memory
task_store:
backend: memory
skills:
auto_discover: true
paths:
- "./configs/skills"
logging:
level: "INFO"
format: "text" # "text" or "json"
router:
classifier: heuristic
auction_enabled: false
"""
ENV_EXAMPLE = """\
# AgentKit Environment Variables
# Copy this file to .env and fill in your values
# LLM API Keys (at least one required)
DASHSCOPE_API_KEY=sk-your-dashscope-key
# Optional: additional providers
# DEEPSEEK_API_KEY=sk-your-deepseek-key
# OPENAI_API_KEY=sk-your-openai-key
# ANTHROPIC_API_KEY=sk-your-anthropic-key
# Server (optional)
# AGENTKIT_API_KEY= # Set to enable API key authentication
"""
DOCKER_COMPOSE = """\
version: "3.8"
services:
agentkit:
build: .
command: serve --host 0.0.0.0 --port 8001
ports:
- "8001:8001"
env_file: .env
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/api/v1/health')"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: pgvector/pgvector:pg16
ports:
- "5432:5432"
environment:
POSTGRES_DB: agentkit
POSTGRES_USER: agentkit
POSTGRES_PASSWORD: agentkit
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U agentkit"]
interval: 10s
timeout: 5s
retries: 5
volumes:
pgdata:
"""
EXAMPLE_SKILL = """\
# Example Skill Configuration
name: example_skill
description: "An example skill for demonstration"
agent_type: assistant
mode: llm_generate
version: "1.0"
prompt: |
You are a helpful assistant. Respond to the user's request clearly and concisely.
tools: []
quality_gate:
enabled: false
evolution:
enabled: false
"""