актуализация документации и manual теста
This commit is contained in:
parent
1b8efdb4a4
commit
8256453bbf
2 changed files with 14 additions and 36 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import asyncio
|
||||
import traceback
|
||||
|
||||
from lambda_agent_api.agent_api import AgentApi
|
||||
from lambda_agent_api.agent_api import AgentApi, AgentBusyException
|
||||
from lambda_agent_api.server import MsgEventTextChunk, MsgEventToolCallChunk, MsgEventToolResult
|
||||
|
||||
|
||||
|
|
@ -10,7 +10,12 @@ async def main():
|
|||
chat_id = input("Chat id: ") or 0
|
||||
api = AgentApi("agent-1", "ws://localhost:8000/agent_ws/", chat_id=chat_id)
|
||||
|
||||
await api.connect()
|
||||
try:
|
||||
await api.connect()
|
||||
except AgentBusyException:
|
||||
print(f"Чат {chat_id} занят другим клиентом")
|
||||
return
|
||||
|
||||
while True:
|
||||
try:
|
||||
prompt = await asyncio.get_event_loop().run_in_executor(None, input, ">>> ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue