File tree 4 files changed +42
-31
lines changed
4 files changed +42
-31
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,11 @@ export function getTokenForProvider(
321
321
character . settings ?. secrets ?. AKASH_CHAT_API_KEY ||
322
322
settings . AKASH_CHAT_API_KEY
323
323
) ;
324
+ case ModelProviderName . GOOGLE :
325
+ return (
326
+ character . settings ?. secrets ?. GOOGLE_GENERATIVE_AI_API_KEY ||
327
+ settings . GOOGLE_GENERATIVE_AI_API_KEY
328
+ ) ;
324
329
default :
325
330
const errorMessage = `Failed to get token - unsupported model provider: ${ provider } ` ;
326
331
elizaLogger . error ( errorMessage ) ;
@@ -655,7 +660,7 @@ async function startAgent(
655
660
await db . init ( ) ;
656
661
657
662
const cache = initializeCache (
658
- process . env . CACHE_STORE ,
663
+ process . env . CACHE_STORE ?? CacheStore . DATABASE ,
659
664
character ,
660
665
"" ,
661
666
db
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " @ai16z/client-twitter" ,
3
- "version" : " 0.1.6" ,
4
- "main" : " dist/index.js" ,
5
- "type" : " module" ,
6
- "types" : " dist/index.d.ts" ,
7
- "dependencies" : {
8
- "@ai16z/eliza" : " workspace:*" ,
9
- "agent-twitter-client" : " 0.0.16 " ,
10
- "glob" : " 11.0.0" ,
11
- "zod" : " 3.23.8"
12
- },
13
- "devDependencies" : {
14
- "tsup" : " 8.3.5"
15
- },
16
- "scripts" : {
17
- "build" : " tsup --format esm --dts" ,
18
- "dev" : " tsup --format esm --dts --watch" ,
19
- "lint" : " eslint --fix --cache ."
20
- },
21
- "peerDependencies" : {
22
- "whatwg-url" : " 7.1.0"
23
- }
2
+ "name" : " @ai16z/client-twitter" ,
3
+ "version" : " 0.1.6" ,
4
+ "main" : " dist/index.js" ,
5
+ "type" : " module" ,
6
+ "types" : " dist/index.d.ts" ,
7
+ "dependencies" : {
8
+ "@ai16z/eliza" : " workspace:*" ,
9
+ "agent-twitter-client" : " 0.0.17 " ,
10
+ "glob" : " 11.0.0" ,
11
+ "zod" : " 3.23.8"
12
+ },
13
+ "devDependencies" : {
14
+ "tsup" : " 8.3.5"
15
+ },
16
+ "scripts" : {
17
+ "build" : " tsup --format esm --dts" ,
18
+ "dev" : " tsup --format esm --dts --watch" ,
19
+ "lint" : " eslint --fix --cache ."
20
+ },
21
+ "peerDependencies" : {
22
+ "whatwg-url" : " 7.1.0"
23
+ }
24
24
}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { generateTweetActions } from "@ai16z/eliza";
15
15
import { IImageDescriptionService , ServiceType } from "@ai16z/eliza" ;
16
16
import { buildConversationThread } from "./utils.ts" ;
17
17
import { twitterMessageHandlerTemplate } from "./interactions.ts" ;
18
+ import { DEFAULT_MAX_TWEET_LENGTH } from "./environment.ts" ;
18
19
19
20
const twitterPostTemplate = `
20
21
# Areas of Expertise
58
59
59
60
# Respond with qualifying action tags only.` + postActionResponseFooter ;
60
61
61
- const MAX_TWEET_LENGTH = 240 ;
62
-
63
62
/**
64
63
* Truncate text to fit within the Twitter character limit, ensuring it ends at a complete sentence.
65
64
*/
@@ -280,7 +279,7 @@ export class TwitterPostClient {
280
279
// Use the helper function to truncate to complete sentence
281
280
const content = truncateToCompleteSentence (
282
281
cleanedContent ,
283
- MAX_TWEET_LENGTH
282
+ parseInt ( this . runtime . getSetting ( " MAX_TWEET_LENGTH" ) ) || DEFAULT_MAX_TWEET_LENGTH
284
283
) ;
285
284
286
285
const removeQuotes = ( str : string ) =>
You can’t perform that action at this time.
0 commit comments