From 898c02ab7a5613a1e63bc3da9283e37bd4a2c305 Mon Sep 17 00:00:00 2001 From: sorphwer Date: Tue, 29 Oct 2024 10:52:50 +0800 Subject: [PATCH] remove unnecessary sleep --- livekit-plugins/livekit-plugins-dify/CHANGELOG.md | 3 +++ livekit-plugins/livekit-plugins-dify/README.md | 3 ++- .../livekit-plugins-dify/livekit/plugins/dify/llm.py | 2 +- .../livekit-plugins-dify/livekit/plugins/dify/version.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/livekit-plugins/livekit-plugins-dify/CHANGELOG.md b/livekit-plugins/livekit-plugins-dify/CHANGELOG.md index 9a2980e5c..8c42e2d52 100644 --- a/livekit-plugins/livekit-plugins-dify/CHANGELOG.md +++ b/livekit-plugins/livekit-plugins-dify/CHANGELOG.md @@ -1,5 +1,8 @@ Changelog +- v0.3.0 +Remove sleep to speed up the response + - v0.2.0 Fix bug diff --git a/livekit-plugins/livekit-plugins-dify/README.md b/livekit-plugins/livekit-plugins-dify/README.md index 50d517841..e55c1c22b 100644 --- a/livekit-plugins/livekit-plugins-dify/README.md +++ b/livekit-plugins/livekit-plugins-dify/README.md @@ -1,7 +1,8 @@ # LiveKit Plugins Dify -To use: +LLM inference implemention from Dify API +Usage: ``` agent = VoicePipelineAgent( vad=ctx.proc.userdata["vad"], diff --git a/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/llm.py b/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/llm.py index f797b2bb2..40bb67edc 100644 --- a/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/llm.py +++ b/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/llm.py @@ -165,7 +165,7 @@ async def __anext__(self): async for chunk in self._dify_stream.aiter_lines(): if not chunk.strip(): - await asyncio.sleep(0.1) + # await asyncio.sleep(0.1) #remove this sleep after testing. continue # print(f"Received chunk: {chunk.strip()}") diff --git a/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/version.py b/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/version.py index 0ca70910c..7078e1a58 100644 --- a/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/version.py +++ b/livekit-plugins/livekit-plugins-dify/livekit/plugins/dify/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.2.0" +__version__ = "0.3.0"