Переимнованы OutgoingMessage в ServerMessage и IncomingMessage в ClientMessage
This commit is contained in:
parent
dab8cf6335
commit
f2d50ae88b
3 changed files with 10 additions and 10 deletions
|
|
@ -79,7 +79,7 @@ async with AgentApi("ws://localhost:8000") as agent:
|
|||
```python
|
||||
import asyncio
|
||||
import websockets
|
||||
from models import OutgoingMessage, OM
|
||||
from models import ServerMessage, OM
|
||||
|
||||
async def main():
|
||||
uri = "ws://localhost:8000/ws"
|
||||
|
|
@ -95,7 +95,7 @@ async def main():
|
|||
# 3. Читаем ответ в виде потока событий
|
||||
while True:
|
||||
msg = await ws.recv()
|
||||
data = OutgoingMessage.model_validate_json(msg)
|
||||
data = ServerMessage.model_validate_json(msg)
|
||||
|
||||
match data:
|
||||
case OM.AgentEvent(subtype=OM.AgentEventType.TEXT_CHUNK):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue