feat(solaris): changed agents logic; made content_configs dynamic and maybe smth else..
This commit is contained in:
20
src/bot/modules/solaris/agents/respond.py
Normal file
20
src/bot/modules/solaris/agents/respond.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import json
|
||||
from dataclasses import asdict
|
||||
|
||||
from google import genai
|
||||
|
||||
from ..content_configs import generate_respond_config
|
||||
from ..structures import InputMessage, OutputMessage
|
||||
|
||||
|
||||
class RespondAgent:
|
||||
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=generate_respond_config(prompt="im gay")
|
||||
)
|
||||
|
||||
async def send_messages(self, messages: list[InputMessage]) -> list[OutputMessage]:
|
||||
data = json.dumps([msg.model_dump() for msg in messages], ensure_ascii=True)
|
||||
response = await self.chat.send_message(data)
|
||||
return response.parsed
|
||||
Reference in New Issue
Block a user