*/ private const MODELS = [ 'sonar' => 'Sonar', 'sonar-pro' => 'Sonar Pro', 'sonar-reasoning' => 'Sonar Reasoning', 'sonar-reasoning-pro' => 'Sonar Reasoning Pro', 'sonar-deep-research' => 'Sonar Deep Research', ]; /** * {@inheritDoc} * * Returns the statically defined Sonar models. No HTTP request is made because * Perplexity does not provide a listing endpoint for these chat models. * * @since 1.0.0 * * @return array Map of model ID to model metadata. */ protected function sendListModelsRequest(): array { $capabilities = [ CapabilityEnum::textGeneration(), CapabilityEnum::chatHistory(), ]; $options = [ new SupportedOption(OptionEnum::systemInstruction()), new SupportedOption(OptionEnum::maxTokens()), new SupportedOption(OptionEnum::temperature()), new SupportedOption(OptionEnum::topP()), new SupportedOption(OptionEnum::stopSequences()), new SupportedOption(OptionEnum::presencePenalty()), new SupportedOption(OptionEnum::frequencyPenalty()), new SupportedOption(OptionEnum::outputMimeType(), ['text/plain', 'application/json']), new SupportedOption(OptionEnum::outputSchema()), new SupportedOption(OptionEnum::customOptions()), new SupportedOption(OptionEnum::inputModalities(), [[ModalityEnum::text()]]), new SupportedOption(OptionEnum::outputModalities(), [[ModalityEnum::text()]]), ]; $models = []; foreach (self::MODELS as $modelId => $displayName) { $models[$modelId] = new ModelMetadata( $modelId, $displayName, $capabilities, $options ); } return $models; } }