Open
Description
Feature description
Perplexity sonar-pro returns citations in response.citations
field ignored in ragbits.core.llms.litellm.LiteLLM._call
.
The ask is to include response.citations
in outputs
returned by _call
, or otherwise support a method that exposes citations, perhaps generate_with_metadata
.
I think you can just add this
if hasattr(response, 'citations'): # type: ignore
outputs.citations = response.citations # type: ignore
(#383)
Motivation
User wanting to use perplexity has to use api directly, missing out on tracing etc.
Additional context
here's what perplexity api returns
dict_keys(['id', 'choices', 'created', 'model', 'object', 'usage', 'citations'])