'system'|'user'|'assistant', 'content' => string ), … ) * * Options (all optional): * - model string Overrides the provider's configured model. * - max_tokens int Output cap (floored by the feature min-token policy). * - temperature float Sampling temperature (ignored where unsupported). * - context string Feature key for min-token enforcement, e.g. 'write_with_ai'. * - timeout int Request timeout in seconds. * * On success returns the normalized result: * array( * 'success' => true, * 'content' => string, * 'model' => string, * 'usage' => array( 'prompt_tokens'=>int|null, 'completion_tokens'=>int|null, 'total_tokens'=>int|null ), * 'finish_reason' => string|null, * ) * * @param array $messages * @param array $options * @return array|\WP_Error Normalized result or a WP_Error on failure. */ public function chat( $messages, $options = array() ); /** * Validate an API key against the platform. * * @param string $api_key Key to test; falls back to the configured key when empty. * @return array array( 'valid' => bool, 'message' => string ) */ public function validate_key( $api_key = '' ); /** * Curated model list for this platform. * * @return array model_id => label */ public function models(); /** * Default model id for this platform. * * @return string */ public function default_model(); }