pplx - fix supports tool choice openai param (#8496)

This commit is contained in:
Ishaan Jaff 2025-02-12 17:21:16 -08:00 committed by GitHub
parent faee508d1f
commit ca7c5e8773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 63 additions and 81 deletions

View file

@ -20,3 +20,23 @@ class PerplexityChatConfig(OpenAIGPTConfig):
or get_secret_str("PERPLEXITY_API_KEY")
)
return api_base, dynamic_api_key
def get_supported_openai_params(self, model: str) -> list:
"""
Perplexity supports a subset of OpenAI params
Ref: https://docs.perplexity.ai/api-reference/chat-completions
Eg. Perplexity does not support tools, tool_choice, function_call, functions, etc.
"""
return [
"frequency_penalty",
"max_tokens",
"max_completion_tokens",
"presence_penalty",
"response_format",
"stream",
"temperature",
"top_p" "max_retries",
"extra_headers",
]