Skip to content

Commit 8c1c2d8

Browse files
committed
Add ignore comment to chatbot index errors
1 parent 7dcdfe9 commit 8c1c2d8

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

python/rubin/rag/chat_prompt_test.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

python/rubin/rag/chatbot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ def handle_user_input(
170170
},
171171
{"callbacks": [stream_handler]},
172172
)
173-
msgs.add_ai_message(result["answer"])
173+
msgs.add_ai_message(result["answer"]) # type: ignore[index]
174174

175175
# Display source documents in an expander
176176
with st.expander("See sources"):
177177
scores = [
178-
chunk.metadata["score"] for chunk in result["context"]
178+
chunk.metadata["score"] for chunk in result["context"] # type: ignore[index]
179179
]
180180

181181
if scores:
@@ -184,7 +184,7 @@ def handle_user_input(
184184
max_score * 0.9
185185
) # Set threshold to 90% of the highest score
186186

187-
for chunk in result["context"]:
187+
for chunk in result["context"]: # type: ignore[index]
188188
score = chunk.metadata["score"]
189189

190190
# Only show sources with scores

0 commit comments

Comments
 (0)