Skip to content
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

feat(provider/perplexity): add support for return_images #4621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinwolfcr
Copy link

Adds support for return_images to the Perplexity Provider

Note

As per @shaper's recommendation, I'm temporarily adding the logic to extract and pass the options to the underlying request in openai-compatible-chat-language-model.ts, since the Perplexity provider extends it.

@shaper
Copy link
Contributor

shaper commented Jan 31, 2025

Hi there, thank you for the contribution! I just sent #4618 which should allow us to do the input part of this PR as:

  const result = await generateText({
    model: perplexity('sonar-pro'),
    prompt: 'Invent a new holiday and describe its traditions.',
    providerOptions: {
      perplexity: {
        request_images: true,
      },
    },
  });

and similar for streamText. This should mean no changes needed for openai-compatible. I see you've kindly also done the extractor logic and tests, so I will work with you to get this landed once the other change is in (likely tomorrow).

Goal is to get you operational ASAP!

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

Successfully merging this pull request may close these issues.

2 participants