- 增加流式事件流支持,Provider 输出 `message.delta` 等事件 - 实现 OpenAI 兼容适配器,包括 RequestBuilder、ApiClient 等模块 - 更新 Agent Run 逻辑,支持流式增量写入与模型完成状态管理 - 扩展配置项 `agent.openai.*`,支持模型、密钥等配置 - 优化文档,完善流式事件与消息类型说明 - 增加单元测试,覆盖 Provider 和 OpenAI 适配相关逻辑 - 更新环境变量与配置示例,支持新功能
18 lines
381 B
PHP
18 lines
381 B
PHP
<?php
|
|
|
|
namespace App\Services\Agent;
|
|
|
|
final class AgentContext
|
|
{
|
|
/**
|
|
* @param array<int, array{message_id: string, role: string, type: string, content: ?string, seq: int}> $messages
|
|
*/
|
|
public function __construct(
|
|
public string $runId,
|
|
public string $sessionId,
|
|
public string $systemPrompt,
|
|
public array $messages,
|
|
) {
|
|
}
|
|
}
|