Files
nl-admin-api/app/Service/common/ai/AiAgentInterface.php
2026-08-10 15:51:00 +08:00

24 lines
666 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Service\common\ai;
/**
* AI Agent 统一接口OpenAI 兼容 chat completions
* 各供应商(讯飞 Spark / DeepSeek 等)实现本接口,业务层只依赖工厂
*/
interface AiAgentInterface
{
/**
* 发起对话补全
*
* @param array $messages OpenAI 格式 messages[['role'=>'system|user|assistant','content'=>'...'], ...]
* @param array $options 可选覆盖model / temperature / max_tokens 等
*/
public function chatCompletions(array $messages, array $options = []): AiChatResult;
/**
* 供应商标识spark / deepseek
*/
public function provider(): string;
}