mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
restructured reflected messages
This commit is contained in:
parent
15e6651e09
commit
86d7705166
2 changed files with 24 additions and 25 deletions
16
aider/gui.py
16
aider/gui.py
|
@ -263,6 +263,10 @@ class GUI:
|
|||
self.reset_recent_msgs()
|
||||
self.chat(prompt)
|
||||
|
||||
def cost(self):
|
||||
cost = random.random() * 0.003 + 0.001
|
||||
st.caption(f"${cost:0.4f}")
|
||||
|
||||
def chat(self, prompt):
|
||||
self.clear_controls()
|
||||
|
||||
|
@ -270,10 +274,14 @@ class GUI:
|
|||
with self.messages.chat_message("user"):
|
||||
st.write(prompt)
|
||||
|
||||
with self.messages.chat_message("assistant"):
|
||||
res = st.write(self.coder.run_stream(prompt))
|
||||
cost = random.random() * 0.003 + 0.001
|
||||
st.caption(f"${cost:0.4f}")
|
||||
while prompt:
|
||||
with self.messages.chat_message("assistant"):
|
||||
res = st.write(self.coder.run_stream(prompt))
|
||||
self.cost()
|
||||
dump(self.coder.reflected_message)
|
||||
if self.coder.reflected_message:
|
||||
self.messages.info(self.coder.reflected_message)
|
||||
prompt = self.coder.reflected_message
|
||||
|
||||
st.session_state.messages.append({"role": "assistant", "content": res})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue