diff --git a/fastagency/__about__.py b/fastagency/__about__.py index 26cc5983..f2636c68 100644 --- a/fastagency/__about__.py +++ b/fastagency/__about__.py @@ -1,3 +1,3 @@ """The fastest way to bring multi-agent workflows to production.""" -__version__ = "0.3.0-dev1" +__version__ = "0.3.0-dev2" diff --git a/fastagency/adapters/nats/base.py b/fastagency/adapters/nats/base.py index 5af90524..58bcb56e 100644 --- a/fastagency/adapters/nats/base.py +++ b/fastagency/adapters/nats/base.py @@ -190,15 +190,15 @@ async def start_chat() -> None: # type: ignore [return] task = asyncio.create_task(start_chat()) # type: ignore background_tasks.add(task) - def callback(t: asyncio.Task[Any]) -> None: + async def callback(t: asyncio.Task[Any]) -> None: try: background_tasks.discard(t) - syncify(subscriber.close)() + await subscriber.close() except Exception as e: logger.error(f"Error in callback: {e}") logger.error(traceback.format_exc()) - task.add_done_callback(callback) + task.add_done_callback(lambda t: asyncio.create_task(callback(t))) except Exception as e: await self._send_error_msg(e, logger) diff --git a/fastagency/app.py b/fastagency/app.py index 13405bb3..b860fe04 100644 --- a/fastagency/app.py +++ b/fastagency/app.py @@ -125,7 +125,7 @@ def __call__(self, *args: Any) -> Union[Awaitable[None], list[bytes]]: def handle_wsgi( self, environ: dict[str, Any], start_response: Callable[..., Any] ) -> list[bytes]: - logger.info(f"Handling WSGI request: {environ}") + logger.debug(f"Handling WSGI request: {environ}") if isinstance(self.ui, WSGIProtocol): return self.ui.handle_wsgi(self, environ, start_response) else: diff --git a/fastagency/ui/mesop/main.py b/fastagency/ui/mesop/main.py index 498ac2a8..8940cc73 100644 --- a/fastagency/ui/mesop/main.py +++ b/fastagency/ui/mesop/main.py @@ -23,9 +23,7 @@ DEFAULT_SECURITY_POLICY = me.SecurityPolicy( - allowed_script_srcs=[ - "https://cdn.jsdelivr.net", - ], + allowed_script_srcs=["https://cdn.jsdelivr.net"], allowed_iframe_parents=["https://fastagency.ai"], ) diff --git a/fastagency/ui/mesop/mesop.py b/fastagency/ui/mesop/mesop.py index f72da6f0..9fe3d6fe 100644 --- a/fastagency/ui/mesop/mesop.py +++ b/fastagency/ui/mesop/mesop.py @@ -99,7 +99,7 @@ def keep_alive_worker() -> None: if self._out_queue: msg = KeepAlive() mesop_msg = self._mesop_message(msg) - logger.info(f"putting keepalive {msg.uuid}") + logger.debug(f"putting keepalive {msg.uuid}") self._out_queue.put(mesop_msg) if self._keep_me_alive and self._keep_alive_thread is None: @@ -267,7 +267,7 @@ def handle_wsgi( environ: dict[str, Any], start_response: Callable[..., Any], ) -> list[bytes]: - logger.info(f"Starting MesopUI using WSGI interface with app: {app}") + logger.debug(f"Starting MesopUI using WSGI interface with app: {app}") MesopUI._created_instance = self MesopUI._app = app diff --git a/fastagency/ui/mesop/message.py b/fastagency/ui/mesop/message.py index 12e801d3..538aabbe 100644 --- a/fastagency/ui/mesop/message.py +++ b/fastagency/ui/mesop/message.py @@ -131,7 +131,7 @@ def _is_completed(self) -> bool: return self._conversation_message.feedback_completed def _provide_feedback(self, feedback: str) -> Iterator[None]: - logger.info(f"_provide_feedback({feedback=})") + logger.debug(f"MesopGUIMessageVisitor._provide_feedback({feedback=})") state = me.state(State) conversation = state.conversation conversation.feedback = "" @@ -216,7 +216,7 @@ def visit_system_message(self, message: SystemMessage) -> None: def visit_keep_alive(self, message: KeepAlive) -> None: def on_wakeup(e: mel.WebEvent) -> Iterator[None]: - logger.info("waking up, after the keep alive") + logger.debug("waking up, after the keep alive") self._conversation_message.feedback_completed = True yield from consume_responses(get_more_messages())