feat: finalize matrix platform audit and docs
This commit is contained in:
parent
6422c7db58
commit
4524a6abc8
30 changed files with 3093 additions and 176 deletions
|
|
@ -1,8 +1,9 @@
|
|||
# platform/interface.py
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import AsyncIterator
|
||||
from datetime import datetime
|
||||
from typing import Any, AsyncIterator, Literal, Protocol
|
||||
from typing import Any, Literal, Protocol
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ class MessageResponse(BaseModel):
|
|||
|
||||
class MessageChunk(BaseModel):
|
||||
"""Один кусок стримингового ответа. При sync-режиме — единственный чанк с finished=True."""
|
||||
|
||||
message_id: str
|
||||
delta: str
|
||||
finished: bool
|
||||
|
|
@ -50,6 +52,7 @@ class UserSettings(BaseModel):
|
|||
|
||||
class AgentEvent(BaseModel):
|
||||
"""Webhook-уведомление от платформы — агент закончил долгую задачу."""
|
||||
|
||||
event_id: str
|
||||
user_id: str
|
||||
chat_id: str
|
||||
|
|
@ -96,4 +99,5 @@ class PlatformClient(Protocol):
|
|||
|
||||
class WebhookReceiver(Protocol):
|
||||
"""Регистрируется в боте. Платформа зовёт нас когда агент закончил долгую задачу."""
|
||||
|
||||
async def on_agent_event(self, event: AgentEvent) -> None: ...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue