main: 引入 AgentProvider 流式事件与 OpenAI 兼容适配
- 增加流式事件流支持,Provider 输出 `message.delta` 等事件 - 实现 OpenAI 兼容适配器,包括 RequestBuilder、ApiClient 等模块 - 更新 Agent Run 逻辑,支持流式增量写入与模型完成状态管理 - 扩展配置项 `agent.openai.*`,支持模型、密钥等配置 - 优化文档,完善流式事件与消息类型说明 - 增加单元测试,覆盖 Provider 和 OpenAI 适配相关逻辑 - 更新环境变量与配置示例,支持新功能
This commit is contained in:
@@ -5,8 +5,8 @@ namespace App\Services\Agent;
|
||||
interface AgentProviderInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
* @param array<string, mixed> $options
|
||||
* @return \Generator<int, \App\Services\Agent\ProviderEvent>
|
||||
*/
|
||||
public function generate(array $context, array $options = []): string;
|
||||
public function stream(AgentContext $context, array $options = []): \Generator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user