- 增加流式事件流支持,Provider 输出 `message.delta` 等事件 - 实现 OpenAI 兼容适配器,包括 RequestBuilder、ApiClient 等模块 - 更新 Agent Run 逻辑,支持流式增量写入与模型完成状态管理 - 扩展配置项 `agent.openai.*`,支持模型、密钥等配置 - 优化文档,完善流式事件与消息类型说明 - 增加单元测试,覆盖 Provider 和 OpenAI 适配相关逻辑 - 更新环境变量与配置示例,支持新功能
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Laravel\Telescope\IncomingEntry;
|
|
use Laravel\Telescope\Telescope;
|
|
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
|
|
|
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
Telescope::night();
|
|
|
|
$this->hideSensitiveRequestDetails();
|
|
|
|
$isLocal = $this->app->environment('local');
|
|
}
|
|
|
|
/**
|
|
* Prevent sensitive request details from being logged by Telescope.
|
|
*/
|
|
protected function hideSensitiveRequestDetails(): void
|
|
{
|
|
if ($this->app->environment('local')) {
|
|
return;
|
|
}
|
|
|
|
Telescope::hideRequestParameters(['_token']);
|
|
|
|
Telescope::hideRequestHeaders([
|
|
'cookie',
|
|
'x-csrf-token',
|
|
'x-xsrf-token',
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Register the Telescope gate.
|
|
*
|
|
* This gate determines who can access Telescope in non-local environments.
|
|
*/
|
|
protected function gate(): void
|
|
{
|
|
Gate::define('viewTelescope', function ($user) {
|
|
return true;
|
|
});
|
|
}
|
|
}
|