Skip to content

Commit

Permalink
Merge pull request #9 from Younis-Ahmed:feat.chat
Browse files Browse the repository at this point in the history
Add PanelBase to CLI for interactive chat
  • Loading branch information
TheAfroEngineer authored Mar 26, 2024
2 parents 3cc48e5 + f61a6e5 commit 240da43
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions senior_swe_ai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)
from senior_swe_ai.conf import config_init, load_conf, append_conf
from senior_swe_ai.cache import create_cache_dir, get_cache_path, save_vec_cache
from senior_swe_ai.panel import PanelBase
from senior_swe_ai.vec_store import VectorStore
from senior_swe_ai.consts import FaissModel, faiss_installed

Expand Down Expand Up @@ -116,10 +117,17 @@ def main() -> None:

try:
continue_chat = True
panel = PanelBase(repo_name, width=70)
while continue_chat:
question: str = input(conf['username'] + ': ')
question: str = panel.console.input(conf['username'] + ': ')
panel.create_chatbox(conf['username'], question, is_ai=False)
panel.console.clear()
panel.print_stdout()
answer = qa(question)
print(repo_name + ': ' + answer['answer'])
panel.create_chatbox(repo_name, answer['answer'])
panel.console.clear()
panel.print_stdout()
# print(repo_name + ': ' + answer['answer'])

choice: str = (
input(
Expand Down

0 comments on commit 240da43

Please sign in to comment.