Fix return type of the generate_chat_response method

This commit is contained in:
sabaimran 2023-11-10 17:48:54 -08:00
parent 54d4fd0e08
commit 14f8c151c8

View file

@ -2,7 +2,7 @@ import logging
import asyncio
from datetime import datetime
from functools import partial
from typing import Iterator, List, Optional, Union
from typing import Iterator, List, Optional, Union, Tuple, Dict
from concurrent.futures import ThreadPoolExecutor
from fastapi import HTTPException, Request
@ -109,7 +109,7 @@ def generate_chat_response(
inferred_queries: List[str] = [],
conversation_command: ConversationCommand = ConversationCommand.Default,
user: KhojUser = None,
) -> Union[ThreadedGenerator, Iterator[str]]:
) -> Tuple[Union[ThreadedGenerator, Iterator[str]], Dict[str, str]]:
def _save_to_conversation_log(
q: str,
chat_response: str,