mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-07 05:52:15 +00:00
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.