Skip to content

Commit

Permalink
Auto Content generation v1.2.0 (#8)
Browse files Browse the repository at this point in the history
* v1.2.0

* chore: uncommented usless add

* feat: register plugin components

* feat: added more new inputs

* fix: added peer dependencies

* fix: components add changed icon

* doc: updated Readme for new models

* Added a few more references but still kinks to work out

* fix: now components are registered :D

* feat: registered Multiselect

* feat: should publish package we'll see when the merge comes

* feat: add translations working on translations

* feat: you can now star the repository

* style: much better placement

* fix: changed react to devdependencies

* yay no more squigglies

* fix: for later I guess

* style: Github Button

* feat: better text generation

* fix: removed super Input

* fix: more settings changes

* added auths

* fix: settings.json :)

* fix: made this better zomg I rock

* fix: audio to work

* feat: homepage now using imageformat

* feat: wow entire app has been full used translated

* feat: translations for other langugues

* feat: more languages

* feat: how did I forget to check this in

* fix: space adjustments

* feat: we're fully translated for real this time

* docs: added supported languages

* style: I really want the tabs to be first

* feat: SuperAudio mostly works but not finished

* fix: deprecated asserts

* docs: add documenation for conturbuting

* feat: added tests for translations updated cache service test

* feat: added test for audio controller

* chore: remove hooks for now

* added missing translation

* feat: svg > base64 thank you chatgpt

* feat: save translations not ready to save

* fix: response did commit this

* changes to supergpt

* feat: markdown is hear to stay deal with it

* fix: json

* fix: let's push these back until we can better think these features

* doc: updated changelog

* update json

* chore: shelve super audio for now save for next update

* fix: removed unused html can't be

---------

Co-authored-by: Timothy Brantley II <tbrantley@accessintergra.com>
  • Loading branch information
theCompanyDream and Timothy Brantley II authored Aug 28, 2024
1 parent ca58d28 commit e4b6350
Show file tree
Hide file tree
Showing 43 changed files with 2,120 additions and 572 deletions.
54 changes: 38 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
name: Publish Package to npmjs
name: Publish Package and Create Release

on:
workflow_run:
workflows: ["Tests"]
types:
- completed
push:
branches:
- main
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm

# Setup Node.js and npm
- uses: actions/setup-node@v3
with:
node-version: "20.12.x"
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
scope: "@octocat"

# Install dependencies
- run: yarn
# - name: Run lint
# run: yarn lint
- name: Run Test
run: yarn test
- run: yarn publish

# Publish the package to npm
- name: Publish Package
run: yarn publish --non-interactive --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Publish to GitHub Packages
# run: yarn publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_CONFIG_REGISTRY: "https://npm.pkg.github.com"

# Create and push a tag based on the version in package.json
- name: Create and Push Tag
id: tag_version
run: |
VERSION=$(node -p "require('./package.json').version")
git tag "v$VERSION"
git push origin "v$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}

# Create GitHub Release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
tag_name: "v${{ steps.tag_version.outputs.VERSION }}"
release_name: "Release v${{ steps.tag_version.outputs.VERSION }}"
body: "Release of version v${{ steps.tag_version.outputs.VERSION }}."
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test SuperGPT"
name: "Tests"

on:
pull_request:
Expand Down
32 changes: 24 additions & 8 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# Directories
.github
copy.sh
README.md
Dockerfile
static
node_modules
__tests__
coverage
dist
build
logs

# Configuration Files
.babelrc
.eslintrc
.eslintignore
.eslintrc.back.js
.eslintrc.front.js
.eslintrc.js
.prettierignore
.prettierrc.js
node_modules
LICENSE
__tests__
jest.setup.js
.DS_Store

# Development Files
Dockerfile
jest.setup.js
docs
# Miscellaneous
npm-debug.log
yarn-error.log
*.log
*.swp
jsconfig.json
Contributing.md
CHANGELOG.md
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change Log

## 1.1.3

- fixed bug with tabs
- added translations for arabic, spanish, french, italian, japanese, korean, etc.
- improved chatgpt window especially getting code from it
- added gpt-4o-mini
- added new field called Super Audio
- updated styling for tabs
- added github star
168 changes: 168 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Contents

- [Our Pledge](#Our-Pledge)
- [Branching](#Branching)
- [Git Operations](#Git-Operations)
- [Commitlint Styles](##Commit-Lint-Styles)
- [Examples](##Examples)
- [Comitlint Types](##Commitlint-Types)
- [Why Do this](##Why-do-this)
- [Our Standards](##Our-Standards)
- [Enforcement Responsibilities](##Enforcement-Responsibilities)
- [Scope](##Scope)
- [Enforcement](##Enforcement)
- [Enforcement Guidelines](##Enforcement-Guidelines)
1. [Correction](###1.-Correction)
1. [Warning](###2.-Warning)
1. [Temporary Ban](###3.Temporary-Ban)
1. [Permanent Ban](###4.Permanent-Ban)
- [Contributors](##Contributors)
- [Attribution](##Attribution)

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Branching

Currently we use [Trunk Based Development](https://trunkbaseddevelopment.com/) and it's recommended that you branch and make a pull request to the feat-trunk. We are considering moving to [Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) for more flexiblity. Especially when it comes to hotfixes and not pushing our code from feat-trunk.

## Git Operations

I reccomend reading and learing about the below subjects understand how to contribute. We do not enfroce [commit lint](https://commitlint.js.org/#/) standards but it's
reccomended that you adhere to the same concepts.

### Commit Lint Styles

Generally works like this

```sh
type(scope?): subject # scope is optional
```

### Examples

```sh
ci: fix tests
```

```sh
fix(rest_api): this ti
```

```sh
feat(gift_qr): add comment section
```

```sh
feat: new page
```

### Commitlint Types

- build
- ci
- chore
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test

### Why do this

This makes it so reverting changes becomes seamless and sure this could lead to execcsive commits but we do not discourage big commits as long as
the information is related.There

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Contributors

- Timothy Brantley<tim@madtechnology.com>
- Miguel Andres<miguel@madtechnology.com>

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html)

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage](https://www.contributor-covenant.org)

For answers to common questions about this code of conduct, see the FAQ at
[FAQ](https://www.contributor-covenant.org/faq). Translations are available at [Transations](https://www.contributor-covenant.org/translations).

27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Thats it! You can now use ChatGPT in your Strapi application.
1. **Easy to use**: The plugin is easy to use and can be set up within 10 minutes.
1. **Customizable**: You can customize the model's parameters to suit your needs.
1. **Generate Pictures** Can generate pictures based on the prompt given.
1. **Use GPT-4-Turbo** you can ulitize GPT-4-Turbo which is only avaible from Api.
1. **Use GPT-4o** you can ulitize GPT-4-Turbo and can use older models like GPT-3.5 Turbo.
1. **Auto Generate Content** you can generate content based on prompts from other content

## 🖐 Requirements

Expand Down Expand Up @@ -101,20 +102,28 @@ You can easily configure the ChatGPT plugin in the Strapi admin panel.
- On the configiration page, Enter All the fields.
- Click on Save to save the configuration.

## RoadMap

- Custom [Field](https://docs.strapi.io/dev-docs/custom-fields#:~:text=☑%EF%B8%8F%20Prerequisites-,Registering%20a%20custom%20field%20through%20a%20plugin%20requires%20creating%20and,method%20on%20the%20StrapiApp%20instance.) that generates content.
- Click ChatGPT plugin in plugin section of the sidebar.
- Click on Integration to get sample code integration code.
- Save chat's that it has with client
- Add voice to models

## 📖 Testing the plugin

- Click ChatGPT plugin in plugin section of the sidebar.
- Click on Integration to get sample code integration code.
- Copy the code and paste it in your terminal.

## 🌐 Supported Languages

- Arabic (العربية)
- German (Deutsch)
- Spanish (Español)
- French (Français)
- Hindi (हिन्दी)
- Italian (Italiano)
- Japanese (日本語)
- Korean (한국어)
- Polish (Polski)
- Portuguese (Português)
- Simplified Chinese (简体中文)

Please note that the translations may vary and are provided by contributors. If you notice any inaccuracies or have suggestions for improvement, feel free to contribute!

## 📝 License

[MIT License](LICENSE)
8 changes: 4 additions & 4 deletions __tests__/backend/controllers/cache.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ describe("Should Caching Controller", () => {
// Check if getResponsefromChatGpt is called correctly
expect(
strapi.plugin("strapi-supergpt").service("cacheController").updateConfig,
).toBeCalledWith(ctx);
).toHaveBeenCalledWith(ctx);

expect(
strapi.plugin("strapi-supergpt").service("cacheController").updateConfig,
).toBeCalledTimes(1);
).toHaveBeenCalledTimes(1);

// Check if the send method was called with the expected response
expect(ctx.send).toHaveBeenCalledWith("This didn't work");
Expand All @@ -56,10 +56,10 @@ describe("Should Caching Controller", () => {
// Check if getConfig is called correctly
expect(
strapi.plugin("strapi-supergpt").service("cacheController").getConfig,
).toBeCalledWith(ctx);
).toHaveBeenCalledWith(ctx);

expect(
strapi.plugin("strapi-supergpt").service("cacheController").getConfig,
).toBeCalledTimes(1);
).toHaveBeenCalledTimes(1);
});
});
Loading

0 comments on commit e4b6350

Please sign in to comment.