Skip to content

Commit 2926753

Browse files
committed
Merge branch 'develop' of https://github.com/ai16z/eliza into develop
2 parents 5390bd5 + 7b609df commit 2926753

File tree

4 files changed

+42
-31
lines changed

4 files changed

+42
-31
lines changed

agent/src/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ export function getTokenForProvider(
321321
character.settings?.secrets?.AKASH_CHAT_API_KEY ||
322322
settings.AKASH_CHAT_API_KEY
323323
);
324+
case ModelProviderName.GOOGLE:
325+
return (
326+
character.settings?.secrets?.GOOGLE_GENERATIVE_AI_API_KEY ||
327+
settings.GOOGLE_GENERATIVE_AI_API_KEY
328+
);
324329
default:
325330
const errorMessage = `Failed to get token - unsupported model provider: ${provider}`;
326331
elizaLogger.error(errorMessage);
@@ -655,7 +660,7 @@ async function startAgent(
655660
await db.init();
656661

657662
const cache = initializeCache(
658-
process.env.CACHE_STORE,
663+
process.env.CACHE_STORE ?? CacheStore.DATABASE,
659664
character,
660665
"",
661666
db

packages/client-twitter/package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
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+
}
2424
}

packages/client-twitter/src/post.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { generateTweetActions } from "@ai16z/eliza";
1515
import { IImageDescriptionService, ServiceType } from "@ai16z/eliza";
1616
import { buildConversationThread } from "./utils.ts";
1717
import { twitterMessageHandlerTemplate } from "./interactions.ts";
18+
import { DEFAULT_MAX_TWEET_LENGTH } from "./environment.ts";
1819

1920
const twitterPostTemplate = `
2021
# Areas of Expertise
@@ -58,8 +59,6 @@ Tweet:
5859
5960
# Respond with qualifying action tags only.` + postActionResponseFooter;
6061

61-
const MAX_TWEET_LENGTH = 240;
62-
6362
/**
6463
* Truncate text to fit within the Twitter character limit, ensuring it ends at a complete sentence.
6564
*/
@@ -280,7 +279,7 @@ export class TwitterPostClient {
280279
// Use the helper function to truncate to complete sentence
281280
const content = truncateToCompleteSentence(
282281
cleanedContent,
283-
MAX_TWEET_LENGTH
282+
parseInt(this.runtime.getSetting("MAX_TWEET_LENGTH")) || DEFAULT_MAX_TWEET_LENGTH
284283
);
285284

286285
const removeQuotes = (str: string) =>

pnpm-lock.yaml

+12-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)