Skip to content

Commit

Permalink
Merge pull request #113 from mraniki/dev
Browse files Browse the repository at this point in the history
♻️ added time for llm response to consolidate
  • Loading branch information
mraniki authored Sep 26, 2023
2 parents d2d4b66 + 1bb77a3 commit 49bcb41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions myllm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import asyncio
import importlib
from time import sleep

import g4f

from g4f import Provider
from loguru import logger

Expand Down Expand Up @@ -76,7 +76,6 @@ async def get_myllm_info(self):
f"ℹ️ MyLLM v{__version__}\n {settings.llm_model}\n{settings.llm_provider}"
)


async def chat(self, prompt):
"""
Asynchronously chats with the user.
Expand All @@ -95,11 +94,12 @@ async def chat(self, prompt):
)
logger.debug("response {}", response)
self.conversation.add_message("ai", response)
return response
sleep(10)
return response if response else "No response from the model"

async def clear_chat_history(self):
"""
Clears the chat history
Clears the chat history
"""
self.conversation = Conversation()

Expand Down

0 comments on commit 49bcb41

Please sign in to comment.