Skip to content

Commit

Permalink
Merge pull request #1176 from i-dot-ai/feature/request-log-from-app
Browse files Browse the repository at this point in the history
Added a single log line for each request
  • Loading branch information
jamesrichards4 authored Nov 11, 2024
2 parents fca7d7b + 9e5726c commit ef8590c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions redbox-core/redbox/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from logging import getLogger
from typing import Literal

from langchain_core.embeddings import Embeddings
from langchain_core.tools import StructuredTool
from langchain_core.vectorstores import VectorStoreRetriever
Expand Down Expand Up @@ -29,6 +31,9 @@ async def _default_callback(*args, **kwargs):
return None


logger = getLogger(__name__)


class Redbox:
def __init__(
self,
Expand Down Expand Up @@ -91,6 +96,8 @@ async def run(
activity_event_callback=_default_callback,
) -> RedboxState:
final_state = None
request_dict = input["request"].model_dump()
logger.info("Request: %s", {k: request_dict[k] for k in request_dict.keys() - {"ai_settings"}})
async for event in self.graph.astream_events(
input=input,
version="v2",
Expand Down

0 comments on commit ef8590c

Please sign in to comment.