ayacoo/news-tldr
Composer 安装命令:
composer require ayacoo/news-tldr
包简介
Creates a short summary for news via ChatGPT
README 文档
README
1 Features
The extension makes it possible to create short news summaries using ChatGPT.
2 Hints
- The code can be used and further developed as desired, e.g. for a backport to version 11
- Only the field bodytext is read. Other linked content elements must be read and manipulated via an event.
3 Usage
3.1 Prerequisites
To use this extension, you need the following requirements:
- PHP version 8.2 or higher
- TYPO3 version 13
- News Extension 11 or higher
- ChatGPT API Token (Please note the number of tokens and costs)
3.2 Installation
Installation using Composer
The recommended way to install the extension is using Composer.
Run the following command within your Composer based TYPO3 project:
composer require ayacoo/news-tldr
3.3 Event / EventListener
To modify the ChatGPT request, e.g. to change the payload, there is
an event: ModifyChatGptContentEvent.
EventListener registration
services:
Vendor\Ext\Listener\ContentListener:
tags:
- name: event.listener
identifier: 'news-tldr/content'
method: 'setContent'
event: Ayacoo\NewsTldr\Event\ModifyChatGptContentEvent
EventListener
<?php
declare(strict_types=1);
namespace Vendor\Ext\Listener;
use Ayacoo\NewsTldr\Event\ModifyChatGptContentEvent;
class ContentListener
{
public function setContent(ModifyChatGptContentEvent $event): ModifyChatGptContentEvent
{
$row = $event->getRow()
$text = strip_tags($row['bodytext'] ?? '');
$content = 'Summarise this text for me in 100 characters: ' . $text;
$event->setContent($content);
return $event;
}
}
4 Support
If you are happy with the extension and would like to support it in any way, I would appreciate the support of social institutions.
ayacoo/news-tldr 适用场景与选型建议
ayacoo/news-tldr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 364 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ayacoo/news-tldr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ayacoo/news-tldr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 364
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-04-14