langchain/libs/partners/perplexity/langchain_perplexity
Marina Gómez afd457d8e1
perplexity[patch]: Fix #30767: Handle missing citations attribute in ChatPerplexity (#30805)
This PR fixes an issue where ChatPerplexity would raise an
AttributeError when the citations attribute was missing from the model
response (e.g., when using offline models like r1-1776).

The fix checks for the presence of citations, images, and
related_questions before attempting to access them, avoiding crashes in
models that don't provide these fields.

Tested locally with models that omit citations, and the fix works as
expected.
2025-04-13 09:24:05 -04:00
..
__init__.py
chat_models.py perplexity[patch]: Fix #30767: Handle missing citations attribute in ChatPerplexity (#30805) 2025-04-13 09:24:05 -04:00
py.typed