Commit graph

118 commits

Author SHA1 Message Date
c4edf55f65 commands/ask: enforce userLimit 2024-04-26 08:07:46 +02:00
6f5f425166 configDefault: add status options 2024-04-26 07:14:41 +02:00
b1e464fe50 Dockerfile: create db directory 2024-04-26 06:14:57 +02:00
6efb6e5876 commands/ask: create
Allows to interact with the bot when bot is user installed in discord.
2024-04-26 05:41:53 +02:00
9f5dfefb31 execution: support for requests that don't have channel set
Interactions initiated outside of servers where bot is don't have channel assigned
2024-04-26 05:41:53 +02:00
2fab1b1b42 execution: factor out replying code to it's own fuction 2024-04-26 05:17:32 +02:00
482f72a4d1 execution: factor out chat completion process 2024-04-26 04:03:34 +02:00
d3567c3607 execution: handle undefined message in logUsedTokens 2024-04-26 04:02:09 +02:00
67a6e4d486 execution+configDefault: retrofit for tooll_calls api 2024-04-26 03:27:15 +02:00
370b7623b5 Dockerfile: chmod dist to 777 for config.ts compilation 2024-04-24 02:38:52 +02:00
b567e13f2a functionManager: use json-schema-to-ts to derive arguments for OpenAIFunctions 2024-04-24 02:27:31 +02:00
d9bee2dcf2 check-quota: define integration types and context to any 2024-04-23 21:11:40 +02:00
3c10f4ed6f Allow chatting with bot through direct messages
Added new command to make the bot see direct messages,
because by default these are not visible,
unless bot opens direct message with the user.
2024-04-23 21:10:52 +02:00
63cb52e7f4 Command: Add integration and context types
While discord api supports that, discord api types, which discord.js depends on does not.
2024-04-23 20:56:55 +02:00
0e5c8d22cc functionManager: retrofit for tool calls api 2024-04-23 17:46:24 +02:00
91232e99a7 Update dependencies 2024-04-23 16:47:08 +02:00
dc01146ee8 ignore @everyone mentions 2023-12-25 16:09:35 +01:00
74359067d0 functionManager: don't return empty function array for openai
openai doesn't accept empty function parameter,
it was discovered after I removed the testing buildin function
2023-12-13 21:08:09 +01:00
24e85f535a "Gracefully" exit when receiving sigint 2023-12-13 20:56:23 +01:00
02a5b0f7b9 Remove getTime model function
it lead to higher usage of tokens.
2023-12-13 17:42:59 +01:00
722862ded3 Add shell.nix
to development util on nixos system
2023-12-13 17:06:09 +01:00
c911e567c6 Update dependencies 2023-12-13 17:04:18 +01:00
6e1cb8c956 Merge branch 'refactor/scripts' 2023-10-12 12:01:52 +02:00
a186ba9e80 scripts/pushCommands: Refactor how commands are being read
this should reduce errors when reading commands
also this won't fail if reading one command fails
2023-10-12 11:55:53 +02:00
a05047ab7d script/pushCommands: make sure the script exits 2023-09-30 14:47:10 +02:00
4729f7f563 /check-limit: rename to check-quota and change description
to match it to the new reality, limits are named quotas now

description of an option previously was longer than 100 characters
which discord api didn't like it
2023-09-30 14:46:12 +02:00
6a31473d22 scripts: move scripts to the project root directory
I believe, that these kind of scripts should reside there
instead of src directory
2023-09-30 14:46:12 +02:00
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
ffa79e798e Fix import grouping in execution.ts
I'm silly silly bad cutie
that doesn't check commits
when I push them
2023-09-27 20:30:08 +02:00
23ceca5cd3 Update OpenAI dependency 2023-09-27 17:14:17 +02:00
8ed2e758f8 Update dependencies
OpenAI package will be updated soon,
as it needs codebase migration
2023-09-27 15:52:30 +02:00
03a1c62cd5 Execution: Stringify response error on axios error
I'm sick of not understanding the 400 problem
2023-09-26 18:17:12 +02:00
6272c7f551 /check-limit: change description of recovery-for paramteter
to mach it better for the current default behaviour
2023-09-25 11:32:52 +02:00
49b074f98e /check-limit: show when the user can use the bot again by default
fixes #12
2023-09-25 11:10:21 +02:00
80f4f18eab quota/tokenCount: allow arbitrary multipliers for tokens
I didn't notice that OpenAI changed pricing again
2023-09-25 09:58:54 +02:00
552143e345 quota/tokenCount: Rename single variable name to something that has more sense
I forgot to rename it when I commited it last time ;-;
2023-09-25 09:30:52 +02:00
94992743e8 quota/tokenCount: fix "null from a database" 2023-09-21 21:51:03 +02:00
2629659ffc Interactions: fix on failed reply to be ephemeral
fixes #17
2023-09-21 20:57:40 +02:00
96dd7bce95 Merge branch 'feature/quota' 2023-09-21 20:52:06 +02:00
18646b9dc6 config: fix imports not working correctly
this patch moves the rootDir of the typescript project up a directory
this moves all content in the dist directory inside the new src directory

I couldn't find other way
2023-09-21 20:51:38 +02:00
16fb74ec4b quota/tokenCount: Implement the "request tokens as half" case 2023-09-21 20:42:06 +02:00
4abdaebf70 quota/tokenCount: I always forget about debug logs... 2023-09-21 20:38:50 +02:00
b2ee156028 /check-limit: fix wrong unit name in field name 2023-09-21 20:08:52 +02:00
6792c05959 Quota: add tokenCount QuotaEngine 2023-09-21 20:07:35 +02:00
e194c1d81a messageCount: Add docs 2023-09-21 09:31:23 +02:00
339ef06ff9 Quota: Refactor how Quotas are being handled
also renamed limits to quota

I believe this new approach would allow me and bot hosters
to add, implement or change the quota behavior more easily.

Reimplemented the currently existing "Message count" limit
to use the new IQuota, refactoring a code *a little*.
2023-09-21 07:11:15 +02:00
46bb5c867d /summon: fix command being canceled wrongly in execution
the problem was that undefined value was compared to number,
making the expression return true
2023-09-19 20:30:55 +02:00
74fe8e3e8b Init: Remove debug logger 2023-09-18 13:33:41 +02:00
29318592b0 Execution: Don't execute the summon command if bot is writing already
fixes #14
2023-09-18 12:44:55 +02:00
b6eb476162 Fix typo again 2023-09-18 12:26:29 +02:00