reply2future / xextension-newsassistant Goto Github PK
View Code? Open in Web Editor NEWAn extension to summarize the feeds of FreshRSS using GPT.
Home Page: https://github.com/FreshRSS/FreshRSS
License: The Unlicense
An extension to summarize the feeds of FreshRSS using GPT.
Home Page: https://github.com/FreshRSS/FreshRSS
License: The Unlicense
Thinking of run it with FreshRSS, is there anyone to can help me?
const Parser = require('rss-parser');
const {
GoogleGenerativeAI,
HarmCategory,
HarmBlockThreshold,
} = require('@google/generative-ai');
const MODEL_NAME = 'gemini-1.5-pro-latest';
const API_KEY = 'XXX';
const parser = new Parser();
const feedURL = 'https://test.com/feed/';
async function getRSSData() {
try {
const feed = await parser.parseURL(feedURL);
const latestItem = feed.items[0];
const rssContent = `${latestItem.title} ${latestItem.contentSnippet}`;
return rssContent;
} catch (err) {
console.error('RSS verisi alınamadı:', err);
return null;
}
}
async function runChat() {
const rssContent = await getRSSData();
if (!rssContent) {
console.log('RSS verisi alınamadı.');
return;
}
const genAI = new GoogleGenerativeAI(API_KEY);
const model = genAI.getGenerativeModel({ model: MODEL_NAME });
const generationConfig = {
temperature: 1,
topK: 0,
topP: 0.95,
maxOutputTokens: 8192,
};
const safetySettings = [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
];
const chat = model.startChat({
generationConfig,
safetySettings,
history: [],
});
const result = await chat.sendMessage(rssContent);
const response = result.response;
console.log(response.text());
}
runChat();
It looks like Microsoft ChatGPT
/v1/completions
is a legacy api and it couldn't use gpt-3
or gpt-4
models; the old model is more expensive.
/v1/chat/completions
Hi,
I think you might be interested in what I mentionned in another repo:
polyrabbit/hacker-news-digest#22
the summary of data should be formatted when it containers some line breaks.
Can Markdown be used for rendering during the final output. Easy to read
you could select translate language
Please add support for a third-party BASE URL. Allow users to customize the base URL at their discretion.
This is wonderful but I don't want to spend thousands of dollars a month to get the results from this stuff Ollama is probably more than enough.
Due to the limitations of the model I was not able to summarize the content, while the title works well, except the content is default and may cause problems for a new user.
MaxTokens
hinsTemperature hins
定了很多英文财经feed,希望能把标题通过openAI自动翻译为中文。
There are some message is a whitespace which would be transfer to empty string.
It would send the title data to openai to summarize.
User would like to select the content of the article to summarize.
[Tue, 12 Sep 2023 09:56:11 +0000] [error] --- Could not fetch available extension from GitHub
[Tue, 12 Sep 2023 09:56:12 +0000] [error] --- Could not fetch available extension from GitHub
[Tue, 12 Sep 2023 09:56:13 +0000] [error] --- Could not fetch available extension from GitHub
[Tue, 12 Sep 2023 09:56:14 +0000] [error] --- Could not fetch available extension from GitHub
[Tue, 12 Sep 2023 09:56:39 +0000] [debug] --- gen.layout.title is not a valid key
[Tue, 12 Sep 2023 09:56:39 +0000] [debug] --- gen.action.set_read is not a valid key
[Tue, 12 Sep 2023 09:58:35 +0000] [debug] --- gen.layout.title is not a valid key
[Tue, 12 Sep 2023 09:58:35 +0000] [debug] --- gen.action.set_read is not a valid key
As shown in the figure, there is no text output [I can run normally in another freshress]
Use a self built chatGPT model that is compatible with OpenAI. There is no log output in the large model
Normally, there should be such output. But there is no log output in this freshress
(This screenshot is another normal summary of freshress logs)
It will display nothing when there are some request error like SSL_ERROR_SYSCALL
I tried many times. I put in my openai api key sk-proj-H2hWKyBlRKQ...... and have the extension enabled , version ...News Assistant (0.11.1). I notice in the web config, the drop down boxes don't have any options outside the 1 default, -- openai and gpt-3.5-turbo-16k-0613. When i click the news assistant button (which seems to be greyed out), it just gives me the page that shows...
The summary of Today
Read ← Go back
with no api data.
The log file stated it could not find the parameters in the config file. I looked at the main freshrss config files and found these entries
'extensions_enabled' =>
array (
'News Assistant' => true,
),
'openai_base_url' => 'https://api.openai.com',
'openai_api_key' => 'sk-proj-H2hWKyBl.......................................',
'provider' => 'openai',
'max_tokens' => 4096,
'temperature' => 0.7,
'limit' => 10.0,
'model' => 'gpt-3.5-turbo-16k-0613',
'prompt' => 'Summarize this as you are news editor, you should merge the similar topic.',
'field' => 'content',
);
To implement scheduled summarization and subsequently push the summarized content to a Telegram bot. But it would be a little bit difference to the original workflow, which is:
read
button to change the status of feeds (this may be not easy to do with telegram bot)Add tag to the feeds when summarizing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.