This commit is contained in:
Paul Gauthier 2024-04-26 16:16:02 -07:00
parent 86d7705166
commit 89a721b386

View file

@ -75,7 +75,6 @@ class GUI:
messages = """Applied edit to new_program.py""" messages = """Applied edit to new_program.py"""
# st.info(messages) # st.info(messages)
if self.chat_controls:
self.chat_controls.empty() self.chat_controls.empty()
self.chat_controls = st.empty() self.chat_controls = st.empty()
@ -223,8 +222,9 @@ class GUI:
cost = random.random() * 0.003 + 0.001 cost = random.random() * 0.003 + 0.001
st.caption(f"${cost:0.4f}") st.caption(f"${cost:0.4f}")
self.chat_controls = st.empty()
def clear_controls(self): def clear_controls(self):
if self.chat_controls:
self.chat_controls.empty() self.chat_controls.empty()
def init_state(self): def init_state(self):
@ -243,8 +243,6 @@ class GUI:
self.coder.io.yes = True self.coder.io.yes = True
self.coder.pretty = False self.coder.pretty = False
self.chat_controls = None
self.init_state() self.init_state()
self.do_sidebar() self.do_sidebar()
@ -278,7 +276,6 @@ class GUI:
with self.messages.chat_message("assistant"): with self.messages.chat_message("assistant"):
res = st.write(self.coder.run_stream(prompt)) res = st.write(self.coder.run_stream(prompt))
self.cost() self.cost()
dump(self.coder.reflected_message)
if self.coder.reflected_message: if self.coder.reflected_message:
self.messages.info(self.coder.reflected_message) self.messages.info(self.coder.reflected_message)
prompt = self.coder.reflected_message prompt = self.coder.reflected_message