Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Run tests
run: make test
env:
ENV: CI
AWE_ENV: CI

format-fix:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
if: steps.version.outputs.skipped != 'true'
run: make test
env:
ENV: CI
AWE_ENV: CI

- name: Run linting
if: steps.version.outputs.skipped != 'true'
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,28 @@ uv run ruff check --select I
Copy `.env.example` to `.env` and adjust the values:

```env
ENV=DEV
LOG_LEVEL=INFO
# Environment setting (DEV, STAGING, PROD, CI)
AWE_ENV=DEV

# Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
AWE_LOG_LEVEL=INFO

# Optional: LLM Provider configuration
# Options: openai, togetherai, deepseek
AWE_LLM_PROVIDER=openai

# Optional: LLM Model to use
# Example: gpt-4, gpt-3.5-turbo, etc.
AWE_LLM_MODEL=gpt-4
```

### Configuration Options

- **`AWE_ENV`**: Application environment (default: `DEV`)
- **`AWE_LOG_LEVEL`**: Logging verbosity level (default: `INFO`)
- **`AWE_LLM_PROVIDER`**: Optional LLM provider selection. If not set, must be specified when creating agents
- **`AWE_LLM_MODEL`**: Optional default model to use. If not set, must be specified when creating agents

## New Features

To develop a new feature:
Expand Down
6 changes: 4 additions & 2 deletions src/aiwebexplorer/agent_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from aiwebexplorer.interfaces import IAgent

from .config import config

T = TypeVar("T")

ModelProvider = Literal[
Expand Down Expand Up @@ -81,9 +83,9 @@ def get_agent(
name: str,
instructions: list[str],
*,
model_id: str | None = None,
model_id: str | None = config.AWE_LLM_MODEL,
api_key: str | None = None,
provider: ModelProvider | None = None,
provider: ModelProvider | None = config.AWE_LLM_PROVIDER,
model_id_map: ModelIdMap | None = None,
**kwargs: Any,
) -> IAgent[Any]:
Expand Down
2 changes: 1 addition & 1 deletion src/aiwebexplorer/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AgentsIds: ...
model_id_map = {
"togetherai": "openai/gpt-oss-20b",
"deepseek": "chat",
"openai": "gpt4o",
"openai": "gpt-4",
}

evaluate_request_agent = get_agent_dep()(
Expand Down
7 changes: 5 additions & 2 deletions src/aiwebexplorer/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import StrEnum
from typing import Literal

from pydantic_settings import BaseSettings, SettingsConfigDict

Expand All @@ -15,8 +16,10 @@ class Environment(StrEnum):
class Config(BaseSettings):
"""Application settings."""

ENV: Environment = Environment.DEV
LOG_LEVEL: str = "INFO" # Allowed: DEBUG, INFO, WARNING, ERROR, CRITICAL
AWE_ENV: Environment = Environment.DEV
AWE_LOG_LEVEL: str = "INFO" # Allowed: DEBUG, INFO, WARNING, ERROR, CRITICAL
AWE_LLM_PROVIDER: Literal["openai", "togetherai", "deepseek"] | None = None
AWE_LLM_MODEL: str | None = None

model_config = SettingsConfigDict(env_file=".env", env_prefix="", extra="ignore")

Expand Down
2 changes: 1 addition & 1 deletion src/aiwebexplorer/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_agent_dep() -> Callable[..., IAgent[Any]]:
Returns:
Callable that returns either a real agent or a mock agent based on environment.
"""
if config.ENV == Environment.CI:
if config.AWE_ENV == Environment.CI:
# Return a function that creates a mock agent for CI environment
def mock_agent_factory(*args: Any, **kwargs: Any) -> IAgent[Any]:
mock_agent = Mock(spec=IAgent[Any])
Expand Down