Skip to content

Commit

Permalink
general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed Dec 23, 2024
1 parent 3221154 commit 349e744
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pipenv install --dev

#### Setup Environment Variables

You can use the provided `.env.example` file to setup the environment variables.
You can use the provided `.env.dev` file to setup the environment variables.

```
cp .env.dev .env
Expand All @@ -112,6 +112,12 @@ docker run -p 6333:6333 -p 6334:6334 \

Run the agent:

```bash
make run
```

Alternatively, you can run the agent manually:

```bash
pipenv run python -m src.main
```
6 changes: 3 additions & 3 deletions src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self):
#: Initialize Planning Module with persistent Q-table
self.planning_module = PlanningModule(
actions=[
"check_signal", # Check if there are new signals
"analyze_signal", # Check if there are new signals
"research_news", # Analyze news and post to Twitter
"idle", # Do nothing (resting state)
],
Expand All @@ -48,7 +48,7 @@ def __init__(self):

def _update_state(self, last_action: str):
"""Updates the agent's state based on the last action."""
if last_action == "check_signal":
if last_action == "analyze_signal":
self.state = "waiting_for_signal"
elif last_action == "research_news":
self.state = "just_analyzed_news"
Expand Down Expand Up @@ -79,7 +79,7 @@ async def _perform_planned_action(self, action_name: str) -> Optional[str]:
logger.info("Agent is idling.")
outcome = "idle"

elif action_name == "check_signal":
elif action_name == "analyze_signal":
news = await analyze_signal()
if news:
logger.info("News perceived.")
Expand Down
9 changes: 1 addition & 8 deletions src/core/config.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
from enum import Enum
from typing import List

from pydantic import field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict


class Environment(Enum):
"""The environment of the application."""

PRODUCTION = "production"
DEVELOPMENT = "development"
CI = "ci"
from src.core.defs import Environment


class Settings(BaseSettings):
Expand Down
10 changes: 9 additions & 1 deletion src/core/defs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""Here will be all the definitions of the core components of the system"""

pass
from enum import Enum


class Environment(Enum):
"""The environment of the application."""

PRODUCTION = "production"
DEVELOPMENT = "development"
CI = "ci"

0 comments on commit 349e744

Please sign in to comment.