Skip to content

Commit

Permalink
Merge pull request #6 from theosli/feature/i18n-fr-en
Browse files Browse the repository at this point in the history
Translation
  • Loading branch information
benoitchazoule authored Dec 12, 2024
2 parents 4cf3f64 + d1d9869 commit 4faf9d8
Show file tree
Hide file tree
Showing 29 changed files with 1,698 additions and 1,787 deletions.
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module.exports = {
singleQuote: true,
tabWidth: 4,
trailingComma: 'es5',
useTabs: false
}
useTabs: false,
};
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@

## 0.0.2 - 2024-01-25

_First release._
_First release._
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ webpage: ## Run the webpage localy

build: ## Compile the project
npm run build
npm run format

run: ## Summarize a list of articles
cd curator && npm start
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ An AI-powered news curator. It reads a list of articles, selects the best ones d

## Requirements

- Node.js >= 18
- an [OpenAI API](https://platform.openai.com/) key
- Node.js >= 18
- an [OpenAI API](https://platform.openai.com/) key

## Initialize the project

After cloning the repository, run the following command :
After cloning the repository, run the following command :

```sh
make init
```

It will install every dependencies and create a .env file with all the required fields.

## Start the webpage

To run the webpage localy:

```sh
make webpage
```

To start Next in dev mode:

```sh
make dev
```
Expand Down
76 changes: 38 additions & 38 deletions curator/package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"name": "curator-ai",
"author": "adrien guernier <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/marmelab/curator-ai"
},
"version": "0.0.6",
"main": "./dist/index.js",
"bin": {
"curate": "./dist/cli.js"
},
"license": "MIT",
"files": [
"*.md",
"dist",
"src"
],
"devDependencies": {
"@types/cli-progress": "^3.11.5",
"@types/jsdom": "^21.1.6",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@mozilla/readability": "^0.5.0",
"chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.12",
"cli-progress": "^3.12.0",
"commander": "^11.1.0",
"dotenv": "^16.3.1",
"jsdom": "^24.0.0",
"openai": "^4.24.3",
"rss-parser": "^3.13.0"
},
"scripts": {
"build": "npx tsc",
"start": "ts-node ./src/cli.ts"
}
"name": "curator-ai",
"author": "adrien guernier <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/marmelab/curator-ai"
},
"version": "0.0.6",
"main": "./dist/index.js",
"bin": {
"curate": "./dist/cli.js"
},
"license": "MIT",
"files": [
"*.md",
"dist",
"src"
],
"devDependencies": {
"@types/cli-progress": "^3.11.5",
"@types/jsdom": "^21.1.6",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@mozilla/readability": "^0.5.0",
"chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.12",
"cli-progress": "^3.12.0",
"commander": "^11.1.0",
"dotenv": "^16.3.1",
"jsdom": "^24.0.0",
"openai": "^4.24.3",
"rss-parser": "^3.13.0"
},
"scripts": {
"build": "npx tsc",
"start": "ts-node ./src/cli.ts"
}
}
5 changes: 3 additions & 2 deletions curator/src/consoleFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import chalk from 'chalk';

import type { Summary } from './types';

const formatSummary = (summary: Summary) => `
const formatSummary = (summary: Summary) =>
`
${chalk.bold(summary.title)}
${chalk.grey(`by ${summary.author}`)}
${summary.summary}
${chalk.underline(chalk.blue(summary.link))}
`.trim();

export const consoleFormat = (summaries: Summary[]) =>
summaries.map(formatSummary).join("\n\n");
summaries.map(formatSummary).join('\n\n');
10 changes: 6 additions & 4 deletions curator/src/summarizeArticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ You will be provided with a technical article, and your task is to summarize the
`;

const completion = await getCompletion({ messages: [
{ role: 'system', content: prompt },
{ role: 'user', content: text },
]});
const completion = await getCompletion({
messages: [
{ role: 'system', content: prompt },
{ role: 'user', content: text },
],
});
if (!completion.message.content) return;
try {
return { ...JSON.parse(completion.message.content), link };
Expand Down
Loading

0 comments on commit 4faf9d8

Please sign in to comment.