Skip to content

Commit

Permalink
Merge branch 'dev' into reinier/fix-forge-anthropic-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts authored Nov 25, 2024
2 parents 4e0dee0 + f00654c commit bcff799
Show file tree
Hide file tree
Showing 170 changed files with 1,305 additions and 4,383 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/platform-autogpt-infra-ci.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/platform-frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
run: |
cp ../supabase/docker/.env.example ../.env
- name: Copy backend .env
run: |
cp ../backend/.env.example ../backend/.env
- name: Run docker compose
run: |
docker compose -f ../docker-compose.yml up -d
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,31 @@ repos:
- id: isort
name: Lint (isort) - AutoGPT Platform - Backend
alias: isort-platform-backend
entry: poetry -C autogpt_platform/backend run isort
entry: poetry -C autogpt_platform/backend run isort -p backend
files: ^autogpt_platform/backend/
types: [file, python]
language: system

- id: isort
name: Lint (isort) - Classic - AutoGPT
alias: isort-classic-autogpt
entry: poetry -C classic/original_autogpt run isort
entry: poetry -C classic/original_autogpt run isort -p autogpt
files: ^classic/original_autogpt/
types: [file, python]
language: system

- id: isort
name: Lint (isort) - Classic - Forge
alias: isort-classic-forge
entry: poetry -C classic/forge run isort
entry: poetry -C classic/forge run isort -p forge
files: ^classic/forge/
types: [file, python]
language: system

- id: isort
name: Lint (isort) - Classic - Benchmark
alias: isort-classic-benchmark
entry: poetry -C classic/benchmark run isort
entry: poetry -C classic/benchmark run isort -p agbenchmark
files: ^classic/benchmark/
types: [file, python]
language: system
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The AutoGPT frontend is where users interact with our powerful AI automation pla

**Monitoring and Analytics:** Keep track of your agents' performance and gain insights to continually improve your automation processes.

[Read this guide](https://docs.agpt.co/server/new_blocks/) to learn how to build your own custom blocks.
[Read this guide](https://docs.agpt.co/platform/new_blocks/) to learn how to build your own custom blocks.

### 💽 AutoGPT Server

Expand Down
9 changes: 7 additions & 2 deletions autogpt_platform/autogpt_libs/autogpt_libs/auth/depends.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fastapi

from .middleware import auth_middleware
from .models import User
from .models import User, DEFAULT_USER_ID, DEFAULT_EMAIL
from .config import Settings


def requires_user(payload: dict = fastapi.Depends(auth_middleware)) -> User:
Expand All @@ -16,8 +17,12 @@ def requires_admin_user(

def verify_user(payload: dict | None, admin_only: bool) -> User:
if not payload:
if Settings.ENABLE_AUTH:
raise fastapi.HTTPException(
status_code=401, detail="Authorization header is missing"
)
# This handles the case when authentication is disabled
payload = {"sub": "3e53486c-cf57-477e-ba2a-cb02dc828e1a", "role": "admin"}
payload = {"sub": DEFAULT_USER_ID, "role": "admin"}

user_id = payload.get("sub")

Expand Down
3 changes: 3 additions & 0 deletions autogpt_platform/autogpt_libs/autogpt_libs/auth/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from dataclasses import dataclass

DEFAULT_USER_ID = "3e53486c-cf57-477e-ba2a-cb02dc828e1a"
DEFAULT_EMAIL = "[email protected]"


# Using dataclass here to avoid adding dependency on pydantic
@dataclass(frozen=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,20 @@
title="Use Credits for Jina",
expires_at=None,
)
unreal_credentials = APIKeyCredentials(#
unreal_credentials = APIKeyCredentials(
id="66f20754-1b81-48e4-91d0-f4f0dd82145f",
provider="unreal",
api_key=SecretStr(settings.secrets.unreal_speech_api_key),
title="Use Credits for Unreal",
expires_at=None,
)
open_router_credentials = APIKeyCredentials(
id="b5a0e27d-0c98-4df3-a4b9-10193e1f3c40",
provider="open_router",
api_key=SecretStr(settings.secrets.open_router_api_key),
title="Use Credits for Open Router",
expires_at=None,
)


DEFAULT_CREDENTIALS = [
Expand All @@ -98,6 +105,7 @@
did_credentials,
jina_credentials,
unreal_credentials,
open_router_credentials,
]


Expand Down Expand Up @@ -145,6 +153,8 @@ def get_all_creds(self, user_id: str) -> list[Credentials]:
all_credentials.append(jina_credentials)
if settings.secrets.unreal_speech_api_key:
all_credentials.append(unreal_credentials)
if settings.secrets.open_router_api_key:
all_credentials.append(open_router_credentials)
return all_credentials

def get_creds_by_id(self, user_id: str, credentials_id: str) -> Credentials | None:
Expand Down
48 changes: 24 additions & 24 deletions autogpt_platform/autogpt_libs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions autogpt_platform/autogpt_libs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ expiringdict = "^1.2.2"
google-cloud-logging = "^3.11.3"
pydantic = "^2.9.2"
pydantic-settings = "^2.6.1"
pyjwt = "^2.8.0"
pyjwt = "^2.10.0"
python = ">=3.10,<4.0"
python-dotenv = "^1.0.1"
supabase = "^2.10.0"

[tool.poetry.group.dev.dependencies]
redis = "^5.2.0"
ruff = "^0.7.3"
ruff = "^0.7.4"

[build-system]
requires = ["poetry-core"]
Expand Down
1 change: 1 addition & 0 deletions autogpt_platform/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ GOOGLE_CLIENT_SECRET=
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GROQ_API_KEY=
OPEN_ROUTER_API_KEY=

# Reddit
REDDIT_CLIENT_ID=
Expand Down
12 changes: 6 additions & 6 deletions autogpt_platform/backend/backend/blocks/ai_music_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Input(BlockSchema):
placeholder="e.g., 'An upbeat electronic dance track with heavy bass'",
title="Prompt",
)
model_version: MusicGenModelVersion = SchemaField(
music_gen_model_version: MusicGenModelVersion = SchemaField(
description="Model to use for generation",
default=MusicGenModelVersion.STEREO_LARGE,
title="Model Version",
Expand Down Expand Up @@ -118,7 +118,7 @@ def __init__(self):
test_input={
"credentials": TEST_CREDENTIALS_INPUT,
"prompt": "An upbeat electronic dance track with heavy bass",
"model_version": MusicGenModelVersion.STEREO_LARGE,
"music_gen_model_version": MusicGenModelVersion.STEREO_LARGE,
"duration": 8,
"temperature": 1.0,
"top_k": 250,
Expand All @@ -134,7 +134,7 @@ def __init__(self):
),
],
test_mock={
"run_model": lambda api_key, model_version, prompt, duration, temperature, top_k, top_p, classifier_free_guidance, output_format, normalization_strategy: "https://replicate.com/output/generated-audio-url.wav",
"run_model": lambda api_key, music_gen_model_version, prompt, duration, temperature, top_k, top_p, classifier_free_guidance, output_format, normalization_strategy: "https://replicate.com/output/generated-audio-url.wav",
},
test_credentials=TEST_CREDENTIALS,
)
Expand All @@ -153,7 +153,7 @@ def run(
)
result = self.run_model(
api_key=credentials.api_key,
model_version=input_data.model_version,
music_gen_model_version=input_data.music_gen_model_version,
prompt=input_data.prompt,
duration=input_data.duration,
temperature=input_data.temperature,
Expand Down Expand Up @@ -182,7 +182,7 @@ def run(
def run_model(
self,
api_key: SecretStr,
model_version: MusicGenModelVersion,
music_gen_model_version: MusicGenModelVersion,
prompt: str,
duration: int,
temperature: float,
Expand All @@ -200,7 +200,7 @@ def run_model(
"meta/musicgen:671ac645ce5e552cc63a54a2bbff63fcf798043055d2dac5fc9e36a837eedcfb",
input={
"prompt": prompt,
"model_version": model_version,
"music_gen_model_version": music_gen_model_version,
"duration": duration,
"temperature": temperature,
"top_k": top_k,
Expand Down
Loading

0 comments on commit bcff799

Please sign in to comment.