Commit graph

20 commits

Author SHA1 Message Date
b7f6a5fe91 toOpenAIMessages: Add fallback to use user id on empty resolved name
Previously if someone named whose current mechanism
resolved to empty string ("Джо" for example)
then the openai would scream that the name
does not match their server side regex.

Meaning that the bot could not be used
in a given channel until that person
changes it's display name
or it will be forgotten for the bot.
2023-09-27 20:45:23 +02:00
23ceca5cd3 Update OpenAI dependency 2023-09-27 17:14:17 +02:00
7ff4abc3c0 Configuration: recactor how it is written and handled 2023-09-18 11:22:10 +02:00
e6d6764e34 add user request limit to config, rename previous limit to read limit 2023-09-13 04:32:14 +02:00
32dd705498 Use Iterable when converting to OpenAI messages 2023-08-20 15:12:26 +02:00
d9a97cce8d Handle 5xx errors by repeating requests
the number of tries is stored in the extension of the array class
the shift method is extended to reset the number of tries
on the queue shift.

also I accidently refactored types in execution.ts
there were duplicate types declared

fixes #9
2023-07-31 21:44:03 +02:00
7225739527 Update eslintrc.json to also make it consider typings
note that I've marked Promises awaiting as a warn,
because I don't want to be bothered with it for now.

I also edited all files to accomodate with the new rules.

I should also think find a way to type-safely import Commands directory,
another time
2023-07-30 22:28:13 +02:00
33a16bd629 Use the first character when formatting the -_- like name sequences 2023-07-30 03:00:51 +02:00
72f4648ff9 Do not add bot's nickname if it's the bot user 2023-07-28 07:45:06 +02:00
28dce0b29f Add support for interactions in moderation 2023-05-08 08:50:59 +02:00
02730ff488 add limits related to current messages to config 2023-03-24 16:47:26 +01:00
4f4b708ba5 move config to a typescript file, add option for chatCompletionConfig
Now we can write code inside config,
which allows us to send current time to the OpenAI api
inside system message!

Example config updated accordingly
2023-03-24 15:44:22 +01:00
2a38ae4a95 Limit sent chat to 2048 tokens.
This also solves the issue where we would request more tokens,
than the model is capable of (over 4096)
2023-03-19 09:11:37 +01:00
fa1caf3ad8 Add support for stickers in messages
The sticker name and description will be now forwarded
with the rest of the message content.
2023-03-18 04:55:37 +01:00
582dff5243 Add support for fields in embeds 2023-03-18 03:38:29 +01:00
d5cb03502f Fix the username formatter returning invalid formatName
'?' is not accepted character in OpenAI api as a valid name
I also switched the order of the replace steps,
so there will be less _- in the final username
2023-03-18 03:27:44 +01:00
276d70efee Parse usernames for use in OpenAI api
also document the toOpenAIMssages.ts file
2023-03-18 02:06:49 +01:00
d877097517 Fix embed formatting for author name and hyphen condition. 2023-03-17 19:59:46 +01:00
7411648d02 Check messages aganist OpenAI moderation API 2023-03-14 23:52:37 +01:00
c18b8d83ef Initial commit 2023-03-14 21:16:54 +01:00