langchain
langchain copied to clipboard
feat(chat_perplexity): capture full API response metadata
Capture Full Perplexity API Response Metadata
It enhances ChatPerplexity to capture the complete API response from Perplexity, not just the message content.
The main benefit is to get the citations and search results.
- Full API response metadata is now available in
Message.processed_content - Access to citations, search results, token usage, and response identifiers
Hi @mathieuripert! Using processed_content as a place to store the additional information is an interesting approach!
One of the things I'm working on currently is support for NativeTools. This means web_search tools, which are also returning citations or annotations. The challenge is the variety of ways services return this data. But I'm looking for something more fully supported in ContentParts. I don't have it done yet, but I'll think more about it.
Thanks!
Hi @brainlid, In the meantime, do you think we can merge this change ? This would allow the perplexity sources to be available in the response message. I think this is a simple workaround. Thanks