{"id":21805914,"url":"https://github.com/malgamves/strapi-open-ai-text-generation","last_synced_at":"2025-04-13T20:07:15.151Z","repository":{"id":65210235,"uuid":"587244754","full_name":"malgamves/strapi-open-ai-text-generation","owner":"malgamves","description":"A Strapi Custom Field to generate text content with Open AI Text generation API","archived":false,"fork":false,"pushed_at":"2023-01-26T14:22:21.000Z","size":28,"stargazers_count":10,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-29T12:03:52.554Z","etag":null,"topics":["open-ai","strapi","strapi-custom-field","strapi-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ai-text-generation","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malgamves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-10T09:52:35.000Z","updated_at":"2024-03-20T02:25:26.000Z","dependencies_parsed_at":"2023-02-14T18:01:40.730Z","dependency_job_id":null,"html_url":"https://github.com/malgamves/strapi-open-ai-text-generation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgamves%2Fstrapi-open-ai-text-generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgamves%2Fstrapi-open-ai-text-generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgamves%2Fstrapi-open-ai-text-generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgamves%2Fstrapi-open-ai-text-generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malgamves","download_url":"https://codeload.github.com/malgamves/strapi-open-ai-text-generation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226745353,"owners_count":17675027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["open-ai","strapi","strapi-custom-field","strapi-plugin"],"created_at":"2024-11-27T12:16:46.998Z","updated_at":"2024-11-27T12:16:47.579Z","avatar_url":"https://github.com/malgamves.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strapi AI Text Generation Custom Feild with Open AI\n\nWith this Custom Field, you can leverage Open AI to generate CMS content for your products, webistes, blogs or whatever your heat desires.\n\n\n\u003cimg src=\"https://user-images.githubusercontent.com/25641936/212054710-1c96197e-f71a-4580-85b5-8a3cb5dc75e3.gif\" alt=\"A Custom Field called writer that generates text for content editors.\"\u003e\n\n\n### ✨ Coming Soon\n- Change the number of words the API generates\n- Change the langauge model used for text generation\n\n## \u003ca id=\"installation\"\u003e\u003c/a\u003e🔧 Installation\n\nInside your Strapi Application, add the package\n\nWith `npm`\n\n```bash\nnpm install ai-text-generation\n```\n\nor `yarn`\n\n```bash\nyarn add ai-text-generation\n```\n\n\nThen get your Open AI API Token [here](https://beta.openai.com/account/api-keys) and add it to the `.env` file at the root of your project as `OPEN_AI_API_TOKEN`. Next, in `./config`, create a file called `plugins.js` to enable the plugin. \n\n```javascript\n// ...\n    'ai-text-generation': {\n      enabled: true,\n      config: {\n        apiToken: process.env.OPEN_AI_API_TOKEN,\n      },\n    },\n//...\n```\n\n\nAfter, build your admin with\n\n```bash\nnpm run build\n```\n\nor\n\n```bash\nyarn build\n```\n\nand start your server with\n\n```bash\nnpm run develop\n```\n\nor\n\n```bash\nyarn develop\n```\n\nand now you have the power of Open AI, right in your favourite CMS. \nFor more on how to enable Custom Feilds in your content Model, have a look at this video on [\"How to install and use Strapi custom fields\"](https://www.youtube.com/watch?v=hIKfvLzN6VI).\n\n## \u003ca id=\"contributing\"\u003e\u003c/a\u003e🛠 Contributing\n\nIn this section, we'll look at how YOU can contribute to this Custom Field.\n\n### Setting up the environment\n\nStart by creating a new Strapi project.\n\n```bash\nnpx create-strapi-app --quickstart strapi-plugin-dev\ncd strapi-plugin-dev\n```\n\nCreate a new plugins folder if it doesn't exist already.\n```bash\nmkdir -p src/plugins\n```\n\nNow we should clone this repository so you can work on it.\n\n```bash\ngit clone https://github.com/malgamves/strapi-open-ai-text-generation.git src/plugins/ai-text-generation\n```\n\nInstall project dependencies\n\n```bash\nyarn install\n```\n\nNow we need to register plugin so strapi can use it. In order to do that we need to create (if not already created) `./config/plugins.js` file and add entry to it.\n\n```javascript\n// ...\n    'ai-text-generation': {\n      enabled: true,\n      config: {\n        apiToken: process.env.OPEN_AI_API_TOKEN,\n      },\n      resolve: './src/plugins/ai-text-generation'\n    },\n// ...\n```\n\n\u003e When contributing, you need to change the value of the `fetch()` url below https://github.com/malgamves/strapi-open-ai-text-generation/blob/78e692b214fc51f8de6bbf6a76fca4db767411eb/admin/src/components/Input/index.js#L25 to `http://localhost:1337`\n\nRebuild the project and start the server\n\n```bash\nyarn build\nyarn develop\n```\n\nFor an optimum development experience, start your Strapi server in `Watch Mode` so you don't have to build everytime you make changes as show below\n```bash\nyarn develop --watch-admin\n```\n\nThanks to the team at [CKEditor](https://ckeditor.com/), the format of this Readme is [inspired by theirs](https://github.com/ckeditor/strapi-plugin-ckeditor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgamves%2Fstrapi-open-ai-text-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalgamves%2Fstrapi-open-ai-text-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgamves%2Fstrapi-open-ai-text-generation/lists"}