Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 351-realign-the-examp…
Browse files Browse the repository at this point in the history
…les-in-the-documentation-with-the-new-source-code
  • Loading branch information
harishmohanraj committed Oct 10, 2024
2 parents 296987c + 0356661 commit 2775779
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion fastagency/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The fastest way to bring multi-agent workflows to production."""

__version__ = "0.3.0-dev1"
__version__ = "0.3.0-dev2"
6 changes: 3 additions & 3 deletions fastagency/adapters/nats/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion fastagency/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions fastagency/ui/mesop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)

Expand Down
4 changes: 2 additions & 2 deletions fastagency/ui/mesop/mesop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions fastagency/ui/mesop/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit 2775779

Please sign in to comment.