TypeScript library for interacting with Eden AI
Currently the library is not published to npm, so you need to install it from github.
npm i github:Uptech/edenai-client
If you use any type of Github action or workflow, you can use the following as a template to authenticate the installation of dependencies.
Add the associated secrets (SSH_PRIVATE_KEY
, PERSONAL_ACCESS_TOKEN_GITHUB_TOKEN
) to your Github's repository settings under Settings > Secrets > Actions > Repository Secrets.
Note: You may also want to add the above secrets to the Dependabot Secrets in Github as well.
jobs:
build:
runs-on: ubuntu-latest
steps:jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: 'Installing Packages'
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB_TOKEN }}
// 1. Create the Client with proper configuration that was provided to you from Eden AI.
edenAiClient.auth('EDEN_AI_TOKEN')
// 2. Create a text moderation query
const response = await edenAPI.text_moderation_create({
providers: 'microsoft',
text: 'Some inappropriate text',
})
Make sure to bump the version in the package.json
file and then run npm i
to update the package-lock.json
file, then you can commit and push changes up to Github, and run npm update @viva/i2c
on the consuming project to update the library.
As part of the release process you should:
- Update the version in
package.json
ie:X.X.X
, runnpm install
, & commit the changes- 🔥 Leave any relevant
changelog
notes if you forgot to!
- 🔥 Leave any relevant
- Create the tag ie:
git tag X.X.X
- Generate the
CHANGELOG.md
vianpm run changelog
& commit the changes- If you forgot to add your change notes to previous commits, now is your last chance! You can rebase and reword the package.json change commit message to include some relevant notes. Then run
git tag -d X.X.X
to remove the old tag, then rungit tag X.X.X
, then you can runnpm run changelog
again to generate the changelog with the new notes.
- If you forgot to add your change notes to previous commits, now is your last chance! You can rebase and reword the package.json change commit message to include some relevant notes. Then run
- Push up commits and tags
git push
&git push --tags
- Create the release in Github https://github.com/Viva-Equity/i2c-client-ts/releases/new
We are using Git Cl on this project via: https://github.com/uptech/git-cl
Check out the above repository for installation notes.
npm run changelog