AI代码生成工具
This commit is contained in:
23
app/Service/common/ai/AiAgentInterface.php
Normal file
23
app/Service/common/ai/AiAgentInterface.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in New Issue
Block a user