Skip to content

feat: supporting citations from perplexity models #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
patryk-kowalski-ds opened this issue Mar 2, 2025 · 0 comments
Open

feat: supporting citations from perplexity models #382

patryk-kowalski-ds opened this issue Mar 2, 2025 · 0 comments
Labels
feature New feature or request

Comments

@patryk-kowalski-ds
Copy link

patryk-kowalski-ds commented Mar 2, 2025

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'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant