mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-13 00:05:02 -05:00
fix(classic): fix CI failures - install Playwright and auto-detect model
- Add 'playwright install chromium' step to Forge CI workflow - Auto-detect default model from available API keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, GROQ_API_KEY) in direct_benchmark harness - Prefer Claude > OpenAI > Groq, fallback to OpenAI if no keys found
This commit is contained in:
10
.claude/settings.json
Normal file
10
.claude/settings.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allowedTools": [
|
||||
"Read", "Grep", "Glob",
|
||||
"Bash(ls:*)", "Bash(cat:*)", "Bash(grep:*)", "Bash(find:*)",
|
||||
"Bash(git status:*)", "Bash(git diff:*)", "Bash(git log:*)", "Bash(git worktree:*)",
|
||||
"Bash(tmux:*)", "Bash(sleep:*)", "Bash(branchlet:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
.github/workflows/classic-forge-ci.yml
vendored
3
.github/workflows/classic-forge-ci.yml
vendored
@@ -55,6 +55,9 @@ jobs:
|
||||
- name: Install Python dependencies
|
||||
run: poetry install
|
||||
|
||||
- name: Install Playwright browsers
|
||||
run: poetry run playwright install chromium
|
||||
|
||||
- name: Run pytest with coverage
|
||||
run: |
|
||||
poetry run pytest -vv \
|
||||
|
||||
4
classic/benchmark/.env.example
Normal file
4
classic/benchmark/.env.example
Normal file
@@ -0,0 +1,4 @@
|
||||
AGENT_NAME=mini-agi
|
||||
REPORTS_FOLDER="reports/mini-agi"
|
||||
OPENAI_API_KEY="sk-" # for LLM eval
|
||||
BUILD_SKILL_TREE=false # set to true to build the skill tree.
|
||||
14
classic/benchmark/frontend/.env.example
Normal file
14
classic/benchmark/frontend/.env.example
Normal file
@@ -0,0 +1,14 @@
|
||||
# Since the ".env" file is gitignored, you can use the ".env.example" file to
|
||||
# build a new ".env" file when you clone the repo. Keep this file up-to-date
|
||||
# when you add new variables to `.env`.
|
||||
|
||||
# This file will be committed to version control, so make sure not to have any
|
||||
# secrets in it. If you are cloning this repo, create a copy of this file named
|
||||
# ".env" and populate it with your secrets.
|
||||
|
||||
# When adding additional environment variables, the schema in "/src/env.mjs"
|
||||
# should be updated accordingly.
|
||||
|
||||
# Prisma
|
||||
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
|
||||
DATABASE_URL="file:./db.sqlite"
|
||||
@@ -19,6 +19,22 @@ from .models import (
|
||||
from .ui import console
|
||||
|
||||
|
||||
def get_default_model() -> str:
|
||||
"""Get the default model based on available API keys.
|
||||
|
||||
Returns the model preset name for the first available API key,
|
||||
preferring Claude > OpenAI > Groq.
|
||||
"""
|
||||
if os.environ.get("ANTHROPIC_API_KEY"):
|
||||
return "claude"
|
||||
elif os.environ.get("OPENAI_API_KEY"):
|
||||
return "openai"
|
||||
elif os.environ.get("GROQ_API_KEY"):
|
||||
return "groq"
|
||||
# Fallback to openai (most commonly available in CI)
|
||||
return "openai"
|
||||
|
||||
|
||||
@click.group()
|
||||
@click.version_option(version="0.1.0")
|
||||
def cli():
|
||||
@@ -40,8 +56,8 @@ def cli():
|
||||
@click.option(
|
||||
"--models",
|
||||
"-m",
|
||||
default="claude",
|
||||
help=f"Comma-separated model presets. Available: {', '.join(MODEL_PRESETS.keys())}",
|
||||
default=None,
|
||||
help=f"Comma-separated model presets. Auto-detects from API keys if not specified. Available: {', '.join(MODEL_PRESETS.keys())}",
|
||||
)
|
||||
@click.option(
|
||||
"--categories",
|
||||
@@ -232,7 +248,7 @@ def cli():
|
||||
)
|
||||
def run(
|
||||
strategies: str,
|
||||
models: str,
|
||||
models: Optional[str],
|
||||
categories: Optional[str],
|
||||
skip_categories: Optional[str],
|
||||
tests: Optional[str],
|
||||
@@ -280,7 +296,11 @@ def run(
|
||||
console.print(f"Available: {STRATEGIES}")
|
||||
sys.exit(1)
|
||||
|
||||
# Parse models
|
||||
# Parse models (auto-detect from API keys if not specified)
|
||||
if models is None:
|
||||
models = get_default_model()
|
||||
console.print(f"[dim]Auto-detected model: {models}[/dim]")
|
||||
|
||||
model_list = [m.strip() for m in models.split(",")]
|
||||
invalid_models = [m for m in model_list if m not in MODEL_PRESETS]
|
||||
if invalid_models:
|
||||
|
||||
Reference in New Issue
Block a user