Skip to content

Commit

Permalink
linter loves me
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaandatta committed Dec 13, 2023
1 parent ab136ea commit bb78c6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions private_gpt/server/chat/chat_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ class CompletionGen(BaseModel):
response: TokenGen
sources: list[Chunk] | None = None


class SqlQueryResponse(BaseModel):
response: str
sources: None = None


@dataclass
class ChatEngineInput:
system_message: ChatMessage | None = None
Expand Down
8 changes: 6 additions & 2 deletions private_gpt/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

from private_gpt.constants import PROJECT_ROOT_PATH
from private_gpt.di import global_injector
from private_gpt.server.chat.chat_service import ChatService, CompletionGen, SqlQueryResponse
from private_gpt.server.chat.chat_service import (
ChatService,
CompletionGen,
SqlQueryResponse,
)
from private_gpt.server.chunks.chunks_service import Chunk, ChunksService
from private_gpt.server.ingest.ingest_service import IngestService
from private_gpt.settings.settings import settings
Expand Down Expand Up @@ -79,7 +83,7 @@ def __init__(

def _chat(self, message: str, history: list[list[str]], mode: str, *_: Any) -> Any:
def yield_deltas(
completion_gen: CompletionGen|SqlQueryResponse, sources: bool = True
completion_gen: CompletionGen | SqlQueryResponse, sources: bool = True
) -> Iterable[str]:
full_response: str = ""
stream = completion_gen.response
Expand Down

0 comments on commit bb78c6d

Please sign in to comment.