Skip to content

Commit 4730b29

Browse files
committed
Merge branches 'main' and 'main' of github.com:covespace/devchat
2 parents 87934b0 + eb33643 commit 4730b29

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

devchat/assistant.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@ def iterate_response(self) -> Iterator[str]:
110110
first_chunk = False
111111
yield self._prompt.formatted_header()
112112
yield delta
113+
if not self._prompt.responses or len(self._prompt.responses) == 0:
114+
raise RuntimeError("No responses returned from the chat API")
113115
self._store.store_prompt(self._prompt)
114116
yield self._prompt.formatted_footer(0) + '\n'
115117
for index in range(1, len(self._prompt.responses)):
116118
yield self._prompt.formatted_full_response(index) + '\n'
117119
else:
118120
response_str = self._chat.complete_response(self._prompt)
119121
self._prompt.set_response(response_str)
122+
if not self._prompt.responses or len(self._prompt.responses) == 0:
123+
raise RuntimeError("No responses returned from the chat API")
120124
self._store.store_prompt(self._prompt)
121125
for index in range(len(self._prompt.responses)):
122126
yield self._prompt.formatted_full_response(index) + '\n'

devchat/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _update_topics_table(self, prompt: Prompt):
9292
logger.warning("Topic %s not found in graph but added", topic['root'])
9393
if prompt.parent == topic['root'] or \
9494
prompt.parent in nx.ancestors(self._graph, topic['root']):
95-
topic['latest_time'] = max(topic['latest_time'], prompt.timestamp)
95+
topic['latest_time'] = prompt.timestamp
9696
self._topics_table.update(topic, doc_ids=[topic.doc_id])
9797
break
9898
else:

0 commit comments

Comments
 (0)