From 88e75d71615a10d6f4d62b77764edba997e73499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Sat, 3 Aug 2024 03:39:07 +0200 Subject: [PATCH] rag: add missing logger file (#571) --- .changeset/wet-crabs-rhyme.md | 5 +++++ .github/workflows/check-types.yml | 2 ++ .../livekit-plugins-rag/livekit/plugins/rag/chunking.py | 4 ++-- .../livekit-plugins-rag/livekit/plugins/rag/log.py | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/wet-crabs-rhyme.md create mode 100644 livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/log.py diff --git a/.changeset/wet-crabs-rhyme.md b/.changeset/wet-crabs-rhyme.md new file mode 100644 index 000000000..a30d70d8a --- /dev/null +++ b/.changeset/wet-crabs-rhyme.md @@ -0,0 +1,5 @@ +--- +"livekit-plugins-rag": patch +--- + +rag: add missing logger file diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml index aa38c7bef..aa560e70c 100644 --- a/.github/workflows/check-types.yml +++ b/.github/workflows/check-types.yml @@ -39,6 +39,7 @@ jobs: ./livekit-plugins/livekit-plugins-silero \ ./livekit-plugins/livekit-plugins-elevenlabs \ ./livekit-plugins/livekit-plugins-cartesia \ + ./livekit-plugins/livekit-plugins-rag \ ./livekit-plugins/livekit-plugins-azure - name: Install stub packages @@ -65,4 +66,5 @@ jobs: -p livekit.plugins.silero \ -p livekit.plugins.elevenlabs \ -p livekit.plugins.cartesia \ + -p livekit.plugins.rag \ -p livekit.plugins.azure diff --git a/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/chunking.py b/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/chunking.py index 2a2be3402..f866ec6b9 100644 --- a/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/chunking.py +++ b/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/chunking.py @@ -26,9 +26,9 @@ def __init__( def chunk(self, *, text: str) -> list[str]: chunks = [] - buf_words = [] + buf_words: list[str] = [] for paragraph in self._paragraph_tokenizer(text): - last_buf_words = [] + last_buf_words: list[str] = [] for sentence in self._sentence_tokenizer.tokenize(text=paragraph): for word in self._word_tokenizer.tokenize(text=sentence): diff --git a/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/log.py b/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/log.py new file mode 100644 index 000000000..2ffcf32bb --- /dev/null +++ b/livekit-plugins/livekit-plugins-rag/livekit/plugins/rag/log.py @@ -0,0 +1,3 @@ +import logging + +logger = logging.getLogger("livekit.plugins.rag")