Python 3.8 support + Cleaning up some issues in extracting files out of the prompts (#355)

* Changed typing to fit python 3.8

* Made sure GPT won't add in comments about the files as these confuse the chat-to-files regex
This commit is contained in:
Nitaym
2023-07-02 18:05:09 +03:00
committed by GitHub
parent 088fa3b44c
commit 24fef650ba
2 changed files with 5 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ from __future__ import annotations
import logging
from typing import Dict, List
import openai
logger = logging.getLogger(__name__)
@@ -29,7 +31,7 @@ class AI:
def fassistant(self, msg):
return {"role": "assistant", "content": msg}
def next(self, messages: list[dict[str, str]], prompt=None):
def next(self, messages: List[Dict[str, str]], prompt=None):
if prompt:
messages += [{"role": "user", "content": prompt}]