assert_prompt_length(); return array( 'ai_api' => 'jfb', 'license' => $this->get_licence(), 'prompt' => $this->prompt, ); } /** * @throws Gateway_Exception */ protected function assert_prompt_length() { if ( mb_strlen( $this->prompt, 'UTF-8' ) <= self::MAX_PROMPT_LENGTH ) { return; } throw new Gateway_Exception( esc_html( sprintf( /* translators: %d: maximum allowed prompt length */ __( 'Prompt is too long. Maximum length is %d characters.', 'jet-form-builder' ), self::MAX_PROMPT_LENGTH ) ) ); } /** * @return string */ public function get_licence(): string { if ( defined( 'JFB_AI_LICENSE' ) ) { return JFB_AI_LICENSE; } return $this->license; } /** * @param string $license */ public function set_license( string $license ) { $this->license = $license; } /** * @param string $prompt */ public function set_prompt( string $prompt ) { $this->prompt = $prompt; } /** * @return string */ public function get_prompt(): string { return $this->prompt; } }