Skip to content

Commit

Permalink
small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bkocis committed Oct 19, 2023
1 parent bd49cdc commit 995aa67
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
Empty file added chatgptApp/__init__.py
Empty file.
10 changes: 7 additions & 3 deletions chatgptApp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from langchain.chat_models import ChatOpenAI
from langchain.prompts import HumanMessagePromptTemplate
from langchain.schema import AIMessage, BaseMessage, HumanMessage, SystemMessage
from callback import QueueCallback
from utils.callback import QueueCallback


logging.basicConfig(
Expand All @@ -20,6 +20,8 @@


def insert_into_db(message, content):
conn = sqlite3.connect(path_to_db, check_same_thread=False)
c = conn.cursor()
c.execute("INSERT INTO chat_session_01 (question, answer) VALUES (?, ?)", (message, content))
conn.commit()
c.execute("select * from chat_session_01")
Expand Down Expand Up @@ -183,8 +185,10 @@ def main(human_message_prompt_template):
) as demo:
messages_gen = gr.State([SystemMessage(content=Path("prompts/system.prompt.general").read_text())])
messages_py = gr.State([SystemMessage(content=Path("prompts/system.prompt.python").read_text())])
messages_4pyanalyzer = gr.State([SystemMessage(content=Path("prompts/system.prompt.python-analyser").read_text())])
messages_unit_test = gr.State([SystemMessage(content=Path("prompts/system.prompt.python-unittest-suggertion").read_text())])
messages_4pyanalyzer = gr.State([SystemMessage(content=Path("prompts/system.prompt.python-analyser").
read_text())])
messages_unit_test = gr.State([SystemMessage(content=Path("prompts/system.prompt.python-unittest-suggestion").
read_text())])
kwargs = {
"show_label": False,
"height": 750
Expand Down
Empty file added chatgptApp/utils/__init__.py
Empty file.
File renamed without changes.

0 comments on commit 995aa67

Please sign in to comment.