get_body(), true ); $entity = Models_Virtual_Chat::instance()->create( $data ); $response = ( new API_Fetch_Chat_OpenAi() )->get_data( $entity->getProperties() ); return $this->handle_response( $response ); } catch ( \Throwable $error ) { return $this->handle_response( array( 'code' => $error->getCode(), 'message' => $error->getMessage(), ) ); } } public static function get_rest_method() { return \WP_REST_Server::CREATABLE; } public static function get_rest_args() { return array(); } }