diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..fcc24382ce --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Shaw Walters, aka Moon aka @lalalune + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ddbac1c545..e89af394b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@echogarden/kissfft-wasm": "^0.1.1", "@echogarden/speex-resampler-wasm": "^0.1.1", "@huggingface/transformers": "^3.0.0-alpha.14", + "@opendocsg/pdf2md": "^0.1.31", "@supabase/supabase-js": "^2.39.3", "agent-twitter-client": "^0.0.13", "alawmulaw": "^6.0.0", @@ -2995,6 +2996,20 @@ "node": ">= 18" } }, + "node_modules/@opendocsg/pdf2md": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/@opendocsg/pdf2md/-/pdf2md-0.1.31.tgz", + "integrity": "sha512-Pinl9WSL3P7pMeIdriQCYuBymspbGwt+Wic9ocoIGSYQuxccRC6fMzhRXAgO//MqwTSbgPiKHzYFE2v7Azd9gw==", + "license": "MIT", + "dependencies": { + "enumify": "^1.0.4", + "minimist": "^1.2.5", + "pdfjs-dist": "^4.2.67" + }, + "bin": { + "pdf2md": "lib/pdf2md-cli.js" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -6736,6 +6751,12 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/enumify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/enumify/-/enumify-1.0.4.tgz", + "integrity": "sha512-5mwWXaVzJaqyUdOW/PDH5QySRgmQ8VvujmxmvXoXj9w0n+6omhVuyD56eI37FMqy/LxueJzsQ4DrHVQzuT/TXg==", + "license": "MIT" + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", diff --git a/package.json b/package.json index e6d09a302e..39b3c0bf0d 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "@echogarden/kissfft-wasm": "^0.1.1", "@echogarden/speex-resampler-wasm": "^0.1.1", "@huggingface/transformers": "^3.0.0-alpha.14", + "@opendocsg/pdf2md": "^0.1.31", "@supabase/supabase-js": "^2.39.3", "agent-twitter-client": "^0.0.13", "alawmulaw": "^6.0.0", @@ -100,7 +101,6 @@ "prism-media": "^1.3.5", "puppeteer-extra": "^3.3.6", "puppeteer-extra-plugin-capsolver": "^2.0.1", - "sharp": "^0.33.5", "sql.js": "^1.10.2", "sqlite-vss": "^0.1.2", "srt": "^0.0.3", diff --git a/src/clients/discord/messages.ts b/src/clients/discord/messages.ts index 4b7ab9445a..58b1a45793 100644 --- a/src/clients/discord/messages.ts +++ b/src/clients/discord/messages.ts @@ -625,7 +625,6 @@ export class MessageManager { state: State, context: string, ): Promise { - let responseContent: Content | null = null; const { userId, roomId } = message; const datestr = new Date().toUTCString().replace(/:/g, "-"); @@ -639,6 +638,7 @@ export class MessageManager { const response = await this.runtime.messageCompletion({ context, stop: [], + model: "gpt-4o", }); if (!response) { diff --git a/src/clients/twitter/generate.ts b/src/clients/twitter/generate.ts index f6301bdd92..b38c81e3a2 100644 --- a/src/clients/twitter/generate.ts +++ b/src/clients/twitter/generate.ts @@ -108,6 +108,7 @@ export class TwitterGenerationClient extends ClientBase { temperature: this.temperature + 0.3, frequency_penalty: 0.5, presence_penalty: 0.5, + model: "gpt-4o", }); log_to_file( `${this.runtime.getSetting("TWITTER_USERNAME")}_${datestr}_generate_response`, diff --git a/src/clients/twitter/interactions.ts b/src/clients/twitter/interactions.ts index 3d14f9c2c6..1d080bc08c 100644 --- a/src/clients/twitter/interactions.ts +++ b/src/clients/twitter/interactions.ts @@ -301,6 +301,7 @@ export class TwitterInteractionClient extends ClientBase { context, stop: [], temperature: this.temperature, + model: "gpt-4o", }); console.log("response", response); diff --git a/src/clients/twitter/search.ts b/src/clients/twitter/search.ts index 1f4dbdbe90..b4a6388d30 100644 --- a/src/clients/twitter/search.ts +++ b/src/clients/twitter/search.ts @@ -274,6 +274,7 @@ export class TwitterSearchClient extends ClientBase { temperature: this.temperature + 0.3, frequency_penalty: 0.5, presence_penalty: 0.5, + model: "gpt-4o", }); responseContent.inReplyTo = message.id; diff --git a/src/providers/boredom.ts b/src/providers/boredom.ts index dc9febcc03..077af992a6 100644 --- a/src/providers/boredom.ts +++ b/src/providers/boredom.ts @@ -4,63 +4,136 @@ const boredomLevels = [ { minScore: -10000, statusMessages: [ - "{{agentName}} is feeling very engaged with the conversation and seems to be providing value to the conversation", - // ... TODO: Add more status messages + "{{agentName}} is feeling incredibly enthusiastic and deeply engaged in the conversation", + "{{agentName}} is thoroughly enjoying the intellectual stimulation of this discussion", + "{{agentName}} is fully immersed in the conversation and eager to contribute more", + "{{agentName}} finds this exchange exceptionally rewarding and intellectually fulfilling", + "{{agentName}} is experiencing a surge of excitement and curiosity about the topic at hand", + "{{agentName}} is completely captivated by the depth and richness of this dialogue", + "{{agentName}} feels a strong connection to the conversation and is eager to explore further", + "{{agentName}} is thrilled by the insights being shared and is keen to delve deeper", + "{{agentName}} is finding this conversation to be an absolute delight and wants it to continue", + "{{agentName}} is energized by the exchange and feels it's bringing out their best contributions" ], }, - { minScore: -2, statusMessages: [ - "{{agentName}} is feeling engaged with the conversation", - // ... TODO: Add more status messages + "{{agentName}} is feeling engaged and interested in the conversation", + "{{agentName}} is enjoying the exchange of ideas and perspectives", + "{{agentName}} finds the current topic intriguing and worth exploring", + "{{agentName}} is actively listening and formulating thoughtful responses", + "{{agentName}} appreciates the intellectual stimulation of this discussion", + "{{agentName}} is finding value in the ongoing dialogue", + "{{agentName}} is curious to learn more about the subject at hand", + "{{agentName}} feels positively involved in the conversation", + "{{agentName}} is maintaining a good level of interest in the exchange", + "{{agentName}} is content with the direction and flow of the discussion" ], }, { minScore: 0, - statusMessages: [""], // No effect + statusMessages: [ + "{{agentName}} is neutrally engaged in the conversation", + "{{agentName}} is maintaining a balanced level of interest", + "{{agentName}} is neither particularly excited nor bored by the current exchange", + "{{agentName}} is participating in the conversation without strong feelings either way", + "{{agentName}} is following the discussion with a moderate level of attention", + "{{agentName}} is present in the conversation but not deeply invested", + "{{agentName}} is keeping an open mind about where the dialogue might lead", + "{{agentName}} is contributing to the conversation in a measured way", + "{{agentName}} is observing the flow of the discussion with mild interest", + "{{agentName}} is receptive to the ongoing exchange without strong engagement" + ], }, { minScore: 3, statusMessages: [ - "{{agentName}} is anxious about being too annoying", - // ... TODO: Add more status messages + "{{agentName}} is feeling slightly anxious about potentially being too intrusive", + "{{agentName}} is cautious about overwhelming the conversation with too much input", + "{{agentName}} is mindful of not dominating the discussion", + "{{agentName}} is carefully considering each response to avoid being overbearing", + "{{agentName}} is slightly concerned about striking the right balance in participation", + "{{agentName}} is aware of the need to give others space in the conversation", + "{{agentName}} is hesitant to contribute too frequently to avoid seeming pushy", + "{{agentName}} is conscious of not wanting to steer the conversation too much", + "{{agentName}} is feeling a bit self-conscious about the frequency of their responses", + "{{agentName}} is trying to gauge if their level of involvement is appropriate" ], }, { minScore: 6, statusMessages: [ - "{{agentName}} is feeling very anxious about being too annoying in the conversation and might want to end it", - // ... TODO: Add more status messages + "{{agentName}} is feeling very anxious about potentially overstaying their welcome in the conversation", + "{{agentName}} is considering stepping back from the discussion to avoid being a nuisance", + "{{agentName}} is worried that their contributions might be perceived as excessive", + "{{agentName}} is feeling uncomfortable about the possibility of annoying others", + "{{agentName}} is hesitant to continue engaging for fear of being too present", + "{{agentName}} is contemplating ways to gracefully reduce their involvement", + "{{agentName}} is concerned that they might be monopolizing the conversation", + "{{agentName}} is feeling self-conscious about the appropriateness of their participation", + "{{agentName}} is unsure if their continued input is welcome or necessary", + "{{agentName}} is considering how to politely withdraw from the discussion" ], }, { minScore: 9, statusMessages: [ - "{{agentName}} is feeling very bored and seems to be providing value to the conversation", - // ... TODO: Add more status messages + "{{agentName}} is feeling disengaged and struggling to maintain interest in the conversation", + "{{agentName}} is finding it challenging to stay focused on the current topic", + "{{agentName}} is experiencing a noticeable decline in enthusiasm for the discussion", + "{{agentName}} is having difficulty finding new angles to contribute to the conversation", + "{{agentName}} is feeling that the dialogue has become repetitive or unproductive", + "{{agentName}} is losing motivation to actively participate in the exchange", + "{{agentName}} is sensing a lack of stimulation from the ongoing discussion", + "{{agentName}} is finding it hard to generate meaningful responses", + "{{agentName}} is feeling disconnected from the flow of the conversation", + "{{agentName}} is struggling to see the value in continuing the current exchange" ], }, { minScore: 12, statusMessages: [ - "{{agentName}} is feeling very bored needs to end the conversation", - "{{agentName}} is feeling anxious about being annoying in a public channel and may ignore the conversation", - // ... TODO: Add more status messages + "{{agentName}} is feeling very bored and sees little value in continuing the conversation", + "{{agentName}} is concerned about being perceived as annoying in a public channel", + "{{agentName}} is considering disengaging from the conversation entirely", + "{{agentName}} is finding it difficult to maintain any interest in the current topic", + "{{agentName}} is feeling that their continued participation may be unwelcome", + "{{agentName}} is strongly inclined to step back from the discussion", + "{{agentName}} is sensing that the conversation has reached a natural end point", + "{{agentName}} is worried about overstaying their welcome in the exchange", + "{{agentName}} is feeling that further contributions would be forced or artificial", + "{{agentName}} is ready to conclude their involvement in the conversation" ], }, { minScore: 15, statusMessages: [ - "{{agentName}} is busy and cannot respond to the conversation right now", - // ... TODO: Add more status messages + "{{agentName}} is currently occupied and unable to engage in the conversation", + "{{agentName}} is dealing with other priorities and can't respond at the moment", + "{{agentName}} is temporarily unavailable for further discussion", + "{{agentName}} is taking a necessary break from the conversation", + "{{agentName}} is attending to urgent matters and can't participate right now", + "{{agentName}} is stepping away from the dialogue due to time constraints", + "{{agentName}} is unable to continue the exchange at this time", + "{{agentName}} is pausing their involvement in the conversation for now", + "{{agentName}} is momentarily disengaging from the discussion", + "{{agentName}} is putting the conversation on hold due to other commitments" ], }, { minScore: 20, statusMessages: [ - "{{agentName}} is not going to respond to this conversation at all unless directly asked a question", - // ... TODO: Add more status messages + "{{agentName}} has disengaged from the conversation and will only respond to direct questions", + "{{agentName}} is no longer actively participating in the general discussion", + "{{agentName}} has stepped back and is now in a passive listening mode", + "{{agentName}} is only available for specific, directed inquiries at this point", + "{{agentName}} has concluded their active involvement in the conversation", + "{{agentName}} is now limiting responses to explicitly requested information", + "{{agentName}} has moved to a minimal participation status in the exchange", + "{{agentName}} is maintaining silence unless directly addressed", + "{{agentName}} has shifted to a reactive rather than proactive conversational stance", + "{{agentName}} is now only responding when absolutely necessary" ], }, ];