mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-07-01 14:52:48 +08:00
- 新增手机图片排版功能,支持小红书/抖音尺寸输出 - 新增AI智能排版顾问,支持内容分析与优化推荐 - 新增AI供应商管理,支持多渠道配置与同步 - 新增文章输出管理页面,支持图片预览与批量下载 - 新增字体文件与排版样式配置
53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace app\common\tools\ai;
|
|
|
|
/**
|
|
* AI 供应商接口.
|
|
*/
|
|
interface AiProviderInterface
|
|
{
|
|
/**
|
|
* 发送聊天请求.
|
|
*
|
|
* @param string $systemPrompt 系统提示词
|
|
* @param string $userPrompt 用户消息
|
|
* @param array $options 额外选项(model, temperature, max_tokens等)
|
|
*
|
|
* @return string AI回复内容
|
|
*/
|
|
public function chat(string $systemPrompt, string $userPrompt, array $options = []): string;
|
|
|
|
/**
|
|
* 发送聊天请求并返回JSON解析后的数组.
|
|
*
|
|
* @param string $systemPrompt 系统提示词
|
|
* @param string $userPrompt 用户消息
|
|
* @param array $options 额外选项
|
|
*
|
|
* @return array 解析后的JSON数组
|
|
*/
|
|
public function chatJson(string $systemPrompt, string $userPrompt, array $options = []): array;
|
|
|
|
/**
|
|
* 获取供应商名称.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getProviderName(): string;
|
|
|
|
/**
|
|
* 获取供应商支持的模型列表.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getModels(): array;
|
|
|
|
/**
|
|
* 测试连接是否可用.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function testConnection(): bool;
|
|
}
|