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
294 changes: 0 additions & 294 deletions bot/agent.py

This file was deleted.

2 changes: 1 addition & 1 deletion bot/app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import asyncio
import logging

from agent_core import OpenAIAgent
from agents import enable_verbose_stdout_logging

from .agent import OpenAIAgent
from .config import Configuration
from .config import env_flag
from .slack import SlackMCPBot
Expand Down
18 changes: 3 additions & 15 deletions bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@
import os
from typing import Any

from agent_core.env import env_flag
from dotenv import find_dotenv
from dotenv import load_dotenv

logger = logging.getLogger(__name__)

_FALSY_ENV_VALUES = frozenset({"", "0", "false", "no", "off"})

__all__ = ["Configuration", "env_flag"]

def env_flag(name: str) -> bool:
"""Return True if env var ``name`` is set to a truthy value.

Common falsy spellings (empty, "0", "false", "no", "off") are treated as
disabled so that ``FOO=0`` behaves as users intuitively expect rather than
as Python's default "non-empty string is truthy" rule.
"""
raw = os.getenv(name)
if raw is None:
return False
return raw.strip().lower() not in _FALSY_ENV_VALUES
logger = logging.getLogger(__name__)


class Configuration:
Expand Down
2 changes: 1 addition & 1 deletion bot/slack.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import asyncio
import logging

from agent_core import OpenAIAgent
from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler
from slack_bolt.async_app import AsyncApp
from slack_sdk.web.async_client import AsyncWebClient

from .agent import OpenAIAgent
from .formatting import markdown_to_slack_mrkdwn


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"agent-core @ git+https://github.com/John-Lin/agent-core.git",
"aiohttp>=3.11.0",
"openai-agents>=0.13.0",
"python-dotenv>=1.1.0",
Expand Down Expand Up @@ -60,5 +61,8 @@ log_file_level = "INFO"
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["bot"]
Loading
Loading