mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-07 20:15:40 +00:00
community: Fix TypeError in PebbloRetrievalQA (#23170)
**Description:** Fix "`TypeError: 'NoneType' object is not iterable`" when the auth_context is absent in PebbloRetrievalQA. The auth_context is optional; hence, PebbloRetrievalQA should work without it, but it throws an error at the moment. This PR fixes that issue. **Issue:** NA **Dependencies:** None **Unit tests:** NA --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
3b7b933aa2
commit
7ee2822ec2
@ -129,9 +129,7 @@ class PebbloRetrievalQA(Chain):
|
||||
"prompt_time": prompt_time,
|
||||
"user": auth_context.user_id if auth_context else "unknown",
|
||||
"user_identities": auth_context.user_auth
|
||||
if "user_auth" in dict(auth_context)
|
||||
else []
|
||||
if auth_context
|
||||
if auth_context and hasattr(auth_context, "user_auth")
|
||||
else [],
|
||||
}
|
||||
qa_payload = Qa(**qa)
|
||||
|
Loading…
Reference in New Issue
Block a user