GithubHelp home page GithubHelp logo

karafra / ai-art Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 33.0 22.24 MB

Discord bot generating images from given query

Home Page: https://karafra.github.io/ai-art/

License: Apache License 2.0

TypeScript 93.10% JavaScript 0.40% Dockerfile 0.97% Shell 5.53%
ai art artificial-intelligence bot dalle-mini discord discord-bot discord-js generator heroku heroku-deployment integration

ai-art's Introduction

👋 Hello there! I'm Karafra

trophy

Karafras's github stats

Spotify

ai-art's People

Contributors

dependabot[bot] avatar imgbotapp avatar karafra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ai-art's Issues

MongoDB issue

I just redeployed the bot with the latest commits and got this error immediately after. How do I remediate this?

2022-08-26T05:19:52.089809+00:00 app[worker.1]: MongoError: Collection already exists. NS: test.Job 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.messageHandler (/app/node_modules/mongodb/lib/cmap/connection.js:299:20) 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.emit (node:events:513:28) 2022-08-26T05:19:52.089810+00:00 app[worker.1]: at MessageStream.emit (node:domain:489:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:144:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:42:5) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at writeOrBuffer (node:internal/streams/writable:391:12) 2022-08-26T05:19:52.089811+00:00 app[worker.1]: at _write (node:internal/streams/writable:332:10) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at MessageStream.Writable.write (node:internal/streams/writable:336:10) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at TLSSocket.ondata (node:internal/streams/readable:754:22) 2022-08-26T05:19:52.089812+00:00 app[worker.1]: at TLSSocket.emit (node:events:513:28) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at TLSSocket.emit (node:domain:489:12) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at addChunk (node:internal/streams/readable:315:12) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at readableAddChunk (node:internal/streams/readable:289:9) 2022-08-26T05:19:52.089813+00:00 app[worker.1]: at TLSSocket.Readable.push (node:internal/streams/readable:228:10) 2022-08-26T05:19:52.089814+00:00 app[worker.1]: at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) 2022-08-26T05:19:55.404560+00:00 app[worker.1]: �[32m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[32m LOG�[39m �[38;5;3m[createCappedJobsCollection1661353047612] �[39m�[32mRunning migration Create capped Jobs collection 1661353047612�[39m 2022-08-26T05:19:55.404785+00:00 app[worker.1]: �[95m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[95m DEBUG�[39m �[38;5;3m[createCappedJobsCollection1661353047612] �[39m�[95mCreating capped collection "Jobs" with size 400000000B�[39m 2022-08-26T05:19:55.440021+00:00 app[worker.1]: Migration "Create capped Jobs collection 1661353047612" failed, error: Collection already exists. NS: test.Job 2022-08-26T05:19:55.441449+00:00 app[worker.1]: �[31m[Nest] 22 - �[39m08/26/2022, 5:19:55 AM �[31m ERROR�[39m �[38;5;3m[TypeOrmModule] �[39m�[31mUnable to connect to the database. Retrying (2)...�[39m

AI-Story Failing Error 401

Have the bot deployed via Docker.
OpenAI key is valid and functioning tested by sending a request to https://api.openai.com/v1/models with my API key in the header and it did return the list of available models so that seems to be working fine.

I did slap the tokens into the docker-compose file but that hasn't been an issue for me for the required bot tokens.
Tried with and without quotation marks for the OpenAI token.

  args:  
   - DISCORD_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
   - DISCORD_BOTID=111111111111111111  
   - OPEN_AI_TOKEN=xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

When sending the story request I get the following error in Discord:
Could not process prompt due to internal error (Request failed with status code 401)

Of course, the Docker log also reports:
2022-07-14 06:45:05 : Generating story with headline a storm is brewing based on text-davinci-002 model
2022-07-14 06:45:06 : Request failed with status code 401

TypeError: Cannot destructure property 'dtoInstance' of 'commandNode' as it is undefined.

I successfully deployed the app using docker-compose -f "docker/deploy/docker-compose.yml" up -d.

But when I interact with the bot with /ai-story story, it crashes and I see the following error in the logs.

2023-01-24 16:05:09 This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
2023-01-24 16:05:09 TypeError: Cannot destructure property 'dtoInstance' of 'commandNode' as it is undefined.
2023-01-24 16:05:09     at CommandExplorer.<anonymous> (/usr/src/app/node_modules/@discord-nestjs/core/src/explorers/command/command.explorer.ts:90:17)
2023-01-24 16:05:09     at Generator.next (<anonymous>)
2023-01-24 16:05:09     at /usr/src/app/node_modules/@discord-nestjs/core/dist/explorers/command/command.explorer.js:17:71
2023-01-24 16:05:09     at new Promise (<anonymous>)
2023-01-24 16:05:09     at __awaiter (/usr/src/app/node_modules/@discord-nestjs/core/dist/explorers/command/command.explorer.js:13:12)
2023-01-24 16:05:09     at Client.<anonymous> (/usr/src/app/node_modules/@discord-nestjs/core/src/explorers/command/command.explorer.ts:67:76)
2023-01-24 16:05:09     at Client.emit (node:events:525:35)
2023-01-24 16:05:09     at Client.emit (node:domain:489:12)
2023-01-24 16:05:09     at InteractionCreateAction.handle (/usr/src/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
2023-01-24 16:05:09     at Object.module.exports [as INTERACTION_CREATE] (/usr/src/app/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
2023-01-24 16:05:09     at WebSocketManager.handlePacket (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
2023-01-24 16:05:09     at WebSocketShard.onPacket (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:478:22)
2023-01-24 16:05:09     at WebSocketShard.onMessage (/usr/src/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:317:10)
2023-01-24 16:05:09     at WebSocket.onMessage (/usr/src/app/node_modules/ws/lib/event-target.js:199:18)
2023-01-24 16:05:09     at WebSocket.emit (node:events:513:28)
2023-01-24 16:05:09     at WebSocket.emit (node:domain:489:12)

error

IMG_20221030_143915
I can't figure this one out.

Command "/ai-story story" is missing and "/ai-story open-ai" doesn't work.

I successfully deployed the app using docker-compose -f "docker/deploy/docker-compose.yml" up -d.

In my .env, I have added OPEN_API_TOKEN = '[redacted]' which contains a valid API key from Open AI.

However, the command to run /ai-story story doesn't show up.

image

If I use /ai-story open-ai Give me a poem instead, I get the following error in my logs.

2023-01-24 16:52:06 [Nest] 32  - 01/24/2023, 5:52:06 AM   DEBUG [OpenAiCommand] /ai-story open-ai command called
2023-01-24 16:52:07 [Nest] 32  - 01/24/2023, 5:52:07 AM   DEBUG [AiStoryService] Generating Give me a poem in style text-davinci-002
2023-01-24 16:52:07 [Nest] 32  - 01/24/2023, 5:52:07 AM   ERROR [OpenAiCommand] Open-ai command failed with exception: Could not generate art "Give me a poem" based on AiStoryService in style "text-davinci-002"

The only command that reliably works is /ai-art wombo-dream.

🗒️ Add documentation for commands

Add command documentation

  • Create tsconfig.doc.json file in the repo root

    • Move all configuration from package.jsom build:docs command to this file
  • Add support for commands section in documentation

  • Create markdown file with static command documentation (possible update to dynamic annotation based generator later)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.