diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5956eca..f480521 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.16 + rev: v0.15.15 hooks: - id: ruff-check args: ["--fix", "--exit-non-zero-on-fix"] diff --git a/.vscode/settings.json b/.vscode/settings.json index 5a6898d..d5a5404 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,6 @@ "automerge", "buildx", "CLAHE", - "deepseek", "Denoise", "denoising", "docstrings", @@ -27,7 +26,6 @@ "killyoy", "levelname", "Licka", - "logfire", "Lördagsgodis", "lovibot", "Lovinator", @@ -59,4 +57,4 @@ "Waifu", "Zenless" ] -} \ No newline at end of file +} diff --git a/main.py b/main.py index 02e65cd..534ac2b 100644 --- a/main.py +++ b/main.py @@ -8,7 +8,6 @@ import os import re from collections import deque from dataclasses import dataclass -from logging import basicConfig from typing import TYPE_CHECKING from typing import Any from typing import Literal @@ -18,7 +17,6 @@ from typing import TypeVar import cv2 import discord import httpx -import logfire import numpy as np import ollama import openai @@ -60,10 +58,10 @@ sentry_sdk.init( send_default_pii=True, ) -logfire.configure() -basicConfig(handlers=[logfire.LogfireLoggingHandler()], level=logging.DEBUG) logger: logging.Logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) + discord_token: str = os.getenv("DISCORD_TOKEN", "") os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_TOKEN", "") @@ -523,11 +521,11 @@ async def chat( # noqa: PLR0913, PLR0917 ): if author_name != bot_name: message_history.append( - ModelRequest([UserPromptPart(content=message_content)]), + ModelRequest(parts=[UserPromptPart(content=message_content)]), ) else: message_history.append( - ModelResponse([TextPart(content=message_content)]), + ModelResponse(parts=[TextPart(content=message_content)]), ) # Compact history to avoid exceeding model context limits diff --git a/pyproject.toml b/pyproject.toml index 06e67e5..89bb4ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,6 @@ dependencies = [ "audioop-lts", "discord-py", "httpx", - "logfire[httpx]", "numpy", "ollama", "openai",