Skip to content

Commit 8bbf113

Browse files
authored
Merge pull request #67 from DefangLabs/linda-gcp-gateway-edits
gcp gateway edits
2 parents 07a0ddf + 84df085 commit 8bbf113

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ __pycache__
33
sentence-transformers
44
.tmp/
55
node_modules
6+
venv

app/rag_system.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ def answer_query_stream(self, query):
148148
)
149149

150150
collected_messages = []
151-
for chunk in stream:
152-
if chunk['choices'][0]['finish_reason'] is not None:
153-
break
151+
for chunk in stream:
154152
content = chunk['choices'][0]['delta'].get('content', '')
155153
collected_messages.append(content)
156154
yield content
155+
if chunk['choices'][0].get('finish_reason') is not None:
156+
break
157157

158158
if len(citations) > 0:
159159
yield "\n\nReferences:\n" + "\n".join(citations)

0 commit comments

Comments
 (0)