acseo/aierrorexplained-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

acseo/aierrorexplained-bundle

最新稳定版本:v0.1.1

Composer 安装命令:

composer require acseo/aierrorexplained-bundle

包简介

This bundle provides AI explaination when an error has occured

README 文档

README

This bundle improove Symfony Official Error page with an AI Suggestion to fix the error.

It relies on OpenAI and its openai-php/client package, and it uses a cache mecanism in order to avoid calling OpenAI multiple times for the same exception.

In order to handle ALL exception, we will need to register a custom Error Handler in the Symfony Kernel. This is something that can be done with your composer.json file (see installation).

Installation

  1. Declare the Custom Error Handler in composer.json
    ...
    "extra": {
        ...
        "runtime": {
            "error_handler": "ACSEO\\AIErrorExplainedBundle\\Runtime\\Internal\\AIErrorHandler"
        }
    }
    ...
  1. Install the bundle using composer
composer require --dev acseo/aierrorexplained-bundle
  1. Enable the bundle in you Symfony project (already done with Flex)
<?php
// config/bundles.php

return [
    ACSEO\AIErrorExplainedBundle\ACSEOAIErrorExplainedBundle::class => ['dev' => true],
  1. Register your OPEN AI key in .env file
# .env
OPENAI_CLIENT_KEY=sk-XXXXXX
  1. Declare a custom Error Controller
# config/packages/framework.yml
when@dev:
    framework:
        error_controller: ACSEO\AIErrorExplainedBundle\Controller\ErrorController::show

And tadaaa 🎉, you are ready to have errors !

What you should see

统计信息

  • 总下载量: 77
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-02