some fixes

This commit is contained in:
shinrei
2025-07-01 19:52:11 +00:00
parent 81875620ff
commit cec6df9464
2 changed files with 3 additions and 5 deletions

View File

@@ -1,5 +1,4 @@
import io
import json
from google import genai
from google.genai import types
from pydub import AudioSegment
@@ -23,8 +22,6 @@ class TTSAgent:
frame_rate=24000,
channels=1
)
# Экспортируем как .ogg с кодеком opus
ogg_io = io.BytesIO()
audio.export(ogg_io, format="ogg", codec="libopus")
ogg_bytes = ogg_io.getvalue()

View File

@@ -2,15 +2,16 @@ import json
from google import genai
from .structures import InputMessage, OutputMessage
from dataclasses import asdict
from .content_config import CONTENT_CONFIG
from .content_configs import MAIN_CONTENT_CONFIG
class SolarisClient:
def __init__(self, api_key: str) -> None:
client = genai.Client(api_key=api_key).aio
self.chat = client.chats.create(
model="gemini-2.5-flash",
config=CONTENT_CONFIG
config=MAIN_CONTENT_CONFIG
)
#self.tts
async def send_messages(self, messages: list[InputMessage]) -> list[OutputMessage]:
data = json.dumps(
[msg.model_dump() for msg in messages],