*/ public static array $responses = []; public static int $callCount = 0; /** @var array> */ public static array $lastMessages = []; /** @var array> */ public static array $lastTools = []; public static function reset(): void { self::$responses = []; self::$callCount = 0; self::$lastMessages = []; self::$lastTools = []; } /** * @param array $responses */ public static function setResponses(array $responses): void { self::$responses = $responses; self::$callCount = 0; } public function chatCompletion( array $messages, string $model, array $tools = [], array $options = [], ): AiChatResponse { self::$lastMessages = $messages; self::$lastTools = $tools; $response = self::$responses[self::$callCount] ?? new AiChatResponse(message: 'Default test reply'); self::$callCount++; return $response; } public function textCompletion(string $prompt, string $model, array $options = []): string { return 'text completion test'; } public function validateConnection(): array { return ['ok' => true]; } }