Skip to content

Commit 3eaeae7

Browse files
committed
Merge branch 'develop' into plugin-chainbase
2 parents 07165a2 + 0bdafda commit 3eaeae7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4876
-3472
lines changed

.env.example

+42-27
Original file line numberDiff line numberDiff line change
@@ -100,32 +100,32 @@ MEDIUM_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-70B-Instruc
100100
LARGE_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-405-Instruct
101101

102102
# Infera Configuration
103-
INFERA_API_KEY= # visit api.infera.org/docs to obtain an API key under /signup_user
104-
INFERA_MODEL= # Default: llama3.2:latest
105-
INFERA_SERVER_URL= # Default: https://api.infera.org/
106-
SMALL_INFERA_MODEL= #Recommended: llama3.2:latest
107-
MEDIUM_INFERA_MODEL= #Recommended: mistral-nemo:latest
108-
LARGE_INFERA_MODEL= #Recommended: mistral-small:latest
109-
110-
# Venice Configuration
111-
VENICE_API_KEY= # generate from venice settings
112-
SMALL_VENICE_MODEL= # Default: llama-3.3-70b
113-
MEDIUM_VENICE_MODEL= # Default: llama-3.3-70b
114-
LARGE_VENICE_MODEL= # Default: llama-3.1-405b
115-
IMAGE_VENICE_MODEL= # Default: fluently-xl
116-
117-
# Nineteen.ai Configuration
118-
NINETEEN_AI_API_KEY= # Get a free api key from https://nineteen.ai/app/api
119-
SMALL_NINETEEN_AI_MODEL= # Default: unsloth/Llama-3.2-3B-Instruct
120-
MEDIUM_NINETEEN_AI_MODEL= # Default: unsloth/Meta-Llama-3.1-8B-Instruct
121-
LARGE_NINETEEN_AI_MODEL= # Default: hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4
122-
IMAGE_NINETEEN_AI_MODE= # Default: dataautogpt3/ProteusV0.4-Lightning
123-
124-
# Akash Chat API Configuration docs: https://chatapi.akash.network/documentation
125-
AKASH_CHAT_API_KEY= # Get from https://chatapi.akash.network/
126-
SMALL_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-2-3B-Instruct
127-
MEDIUM_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-3-70B-Instruct
128-
LARGE_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-1-405B-Instruct-FP8
103+
INFERA_API_KEY= # visit api.infera.org/docs to obtain an API key under /signup_user
104+
INFERA_MODEL= # Default: llama3.2:latest
105+
INFERA_SERVER_URL= # Default: https://api.infera.org/
106+
SMALL_INFERA_MODEL= #Recommended: llama3.2:latest
107+
MEDIUM_INFERA_MODEL= #Recommended: mistral-nemo:latest
108+
LARGE_INFERA_MODEL= #Recommended: mistral-small:latest
109+
110+
# Venice Configuration
111+
VENICE_API_KEY= # generate from venice settings
112+
SMALL_VENICE_MODEL= # Default: llama-3.3-70b
113+
MEDIUM_VENICE_MODEL= # Default: llama-3.3-70b
114+
LARGE_VENICE_MODEL= # Default: llama-3.1-405b
115+
IMAGE_VENICE_MODEL= # Default: fluently-xl
116+
117+
# Nineteen.ai Configuration
118+
NINETEEN_AI_API_KEY= # Get a free api key from https://nineteen.ai/app/api
119+
SMALL_NINETEEN_AI_MODEL= # Default: unsloth/Llama-3.2-3B-Instruct
120+
MEDIUM_NINETEEN_AI_MODEL= # Default: unsloth/Meta-Llama-3.1-8B-Instruct
121+
LARGE_NINETEEN_AI_MODEL= # Default: hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4
122+
IMAGE_NINETEEN_AI_MODE= # Default: dataautogpt3/ProteusV0.4-Lightning
123+
124+
# Akash Chat API Configuration docs: https://chatapi.akash.network/documentation
125+
AKASH_CHAT_API_KEY= # Get from https://chatapi.akash.network/
126+
SMALL_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-2-3B-Instruct
127+
MEDIUM_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-3-70B-Instruct
128+
LARGE_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-1-405B-Instruct-FP8
129129

130130
# Livepeer configuration
131131
LIVEPEER_GATEWAY_URL= # Free inference gateways and docs: https://livepeer-eliza.com/
@@ -184,6 +184,12 @@ MEDIUM_GOOGLE_MODEL= # Default: gemini-1.5-flash-latest
184184
LARGE_GOOGLE_MODEL= # Default: gemini-1.5-pro-latest
185185
EMBEDDING_GOOGLE_MODEL= # Default: text-embedding-004
186186

187+
# Mistral Configuration
188+
MISTRAL_MODEL=
189+
SMALL_MISTRAL_MODEL= # Default: mistral-small-latest
190+
MEDIUM_MISTRAL_MODEL= # Default: mistral-large-latest
191+
LARGE_MISTRAL_MODEL= # Default: mistral-large-latest
192+
187193
# Groq Configuration
188194
GROQ_API_KEY= # Starts with gsk_
189195
SMALL_GROQ_MODEL= # Default: llama-3.1-8b-instant
@@ -232,6 +238,13 @@ MEDIUM_VOLENGINE_MODEL= # Default: doubao-pro-128k
232238
LARGE_VOLENGINE_MODEL= # Default: doubao-pro-256k
233239
VOLENGINE_EMBEDDING_MODEL= # Default: doubao-embedding
234240

241+
# DeepSeek Configuration
242+
DEEPSEEK_API_URL= # Default: https://api.deepseek.com
243+
SMALL_DEEPSEEK_MODEL= # Default: deepseek-chat
244+
MEDIUM_DEEPSEEK_MODEL= # Default: deepseek-chat
245+
LARGE_DEEPSEEK_MODEL= # Default: deepseek-chat
246+
247+
235248
# fal.ai Configuration
236249
FAL_API_KEY=
237250
FAL_AI_LORA_PATH=
@@ -536,6 +549,8 @@ AKASH_MANIFEST_MODE=auto
536549
AKASH_MANIFEST_PATH=
537550
# Values: "strict" | "lenient" | "none" - Default: "strict"
538551
AKASH_MANIFEST_VALIDATION_LEVEL=strict
539-
552+
# Quai Network Ecosystem
553+
QUAI_PRIVATE_KEY=
554+
QUAI_RPC_URL=https://rpc.quai.network
540555
# Chainbase
541556
CHAINBASE_API_KEY=demo # demo is a free tier key

agent/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@elizaos/plugin-0g": "workspace:*",
3535
"@elizaos/plugin-abstract": "workspace:*",
3636
"@elizaos/plugin-aptos": "workspace:*",
37-
"@elizaos/plugin-coingecko": "workspace:*",
3837
"@elizaos/plugin-coinmarketcap": "workspace:*",
3938
"@elizaos/plugin-binance": "workspace:*",
4039
"@elizaos/plugin-avail": "workspace:*",
@@ -53,6 +52,7 @@
5352
"@elizaos/plugin-icp": "workspace:*",
5453
"@elizaos/plugin-image-generation": "workspace:*",
5554
"@elizaos/plugin-movement": "workspace:*",
55+
"@elizaos/plugin-massa": "workspace:*",
5656
"@elizaos/plugin-nft-generation": "workspace:*",
5757
"@elizaos/plugin-node": "workspace:*",
5858
"@elizaos/plugin-solana": "workspace:*",
@@ -71,6 +71,7 @@
7171
"@elizaos/plugin-near": "workspace:*",
7272
"@elizaos/plugin-zksync-era": "workspace:*",
7373
"@elizaos/plugin-twitter": "workspace:*",
74+
"@elizaos/plugin-primus": "workspace:*",
7475
"@elizaos/plugin-cronoszkevm": "workspace:*",
7576
"@elizaos/plugin-3d-generation": "workspace:*",
7677
"@elizaos/plugin-fuel": "workspace:*",
@@ -86,7 +87,9 @@
8687
"@elizaos/plugin-arthera": "workspace:*",
8788
"@elizaos/plugin-allora": "workspace:*",
8889
"@elizaos/plugin-opacity": "workspace:*",
90+
"@elizaos/plugin-hyperliquid": "workspace:*",
8991
"@elizaos/plugin-akash": "workspace:*",
92+
"@elizaos/plugin-quai": "workspace:*",
9093
"@elizaos/plugin-chainbase": "workspace:*",
9194
"readline": "1.3.0",
9295
"ws": "8.18.0",

agent/src/index.ts

+32-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { SlackClientInterface } from "@elizaos/client-slack";
1010
import { TelegramClientInterface } from "@elizaos/client-telegram";
1111
import { TwitterClientInterface } from "@elizaos/client-twitter";
1212
// import { ReclaimAdapter } from "@elizaos/plugin-reclaim";
13+
import { DirectClient } from "@elizaos/client-direct";
14+
import { PrimusAdapter } from "@elizaos/plugin-primus";
15+
1316
import {
1417
AgentRuntime,
1518
CacheManager,
@@ -84,20 +87,22 @@ import { webSearchPlugin } from "@elizaos/plugin-web-search";
8487
import { giphyPlugin } from "@elizaos/plugin-giphy";
8588
import { letzAIPlugin } from "@elizaos/plugin-letzai";
8689
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
87-
90+
import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid";
8891
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
8992

9093
import { OpacityAdapter } from "@elizaos/plugin-opacity";
9194
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
9295
import { stargazePlugin } from "@elizaos/plugin-stargaze";
9396
import { akashPlugin } from "@elizaos/plugin-akash";
9497
import { chainbasePlugin } from "@elizaos/plugin-chainbase";
98+
import { quaiPlugin } from "@elizaos/plugin-quai";
9599
import Database from "better-sqlite3";
96100
import fs from "fs";
97101
import net from "net";
98102
import path from "path";
99103
import { fileURLToPath } from "url";
100104
import yargs from "yargs";
105+
import { dominosPlugin } from "@elizaos/plugin-dominos";
101106

102107
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
103108
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -399,6 +404,11 @@ export function getTokenForProvider(
399404
character.settings?.secrets?.GOOGLE_GENERATIVE_AI_API_KEY ||
400405
settings.GOOGLE_GENERATIVE_AI_API_KEY
401406
);
407+
case ModelProviderName.MISTRAL:
408+
return (
409+
character.settings?.secrets?.MISTRAL_API_KEY ||
410+
settings.MISTRAL_API_KEY
411+
);
402412
case ModelProviderName.LETZAI:
403413
return (
404414
character.settings?.secrets?.LETZAI_API_KEY ||
@@ -617,6 +627,20 @@ export async function createAgent(
617627
elizaLogger.log("modelProvider", character.modelProvider);
618628
elizaLogger.log("token", token);
619629
}
630+
if (
631+
process.env.PRIMUS_APP_ID &&
632+
process.env.PRIMUS_APP_SECRET &&
633+
process.env.VERIFIABLE_INFERENCE_ENABLED === "true"
634+
) {
635+
verifiableInferenceAdapter = new PrimusAdapter({
636+
appId: process.env.PRIMUS_APP_ID,
637+
appSecret: process.env.PRIMUS_APP_SECRET,
638+
attMode: "proxytls",
639+
modelProvider: character.modelProvider,
640+
token,
641+
});
642+
elizaLogger.log("Verifiable inference primus adapter initialized");
643+
}
620644

621645
return new AgentRuntime({
622646
databaseAdapter: db,
@@ -759,11 +783,18 @@ export async function createAgent(
759783
? artheraPlugin
760784
: null,
761785
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
786+
getSecret(character, "HYPERLIQUID_PRIVATE_KEY")
787+
? hyperliquidPlugin
788+
: null,
789+
getSecret(character, "HYPERLIQUID_TESTNET")
790+
? hyperliquidPlugin
791+
: null,
762792
getSecret(character, "AKASH_MNEMONIC") &&
763793
getSecret(character, "AKASH_WALLET_ADDRESS")
764794
? akashPlugin
765795
: null,
766796
getSecret(character, "CHAINBASE_API_KEY") ? chainbasePlugin : null,
797+
getSecret(character, "QUAI_PRIVATE_KEY") ? quaiPlugin : null,
767798
].filter(Boolean),
768799
providers: [],
769800
actions: [],

docs/docs/advanced/fine-tuning.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ enum ModelProviderName {
2222
LLAMACLOUD,
2323
LLAMALOCAL,
2424
GOOGLE,
25+
MISTRAL,
2526
REDPILL,
2627
OPENROUTER,
2728
HEURIST,

packages/client-twitter/src/interactions.ts

+30-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import {
1414
stringToUuid,
1515
elizaLogger,
1616
getEmbeddingZeroVector,
17+
IImageDescriptionService,
18+
ServiceType
1719
} from "@elizaos/core";
1820
import { ClientBase } from "./base";
1921
import { buildConversationThread, sendTweet, wait } from "./utils.ts";
@@ -43,6 +45,8 @@ Recent interactions between {{agentName}} and other users:
4345
4446
Current Post:
4547
{{currentPost}}
48+
Here is the descriptions of images in the Current post.
49+
{{imageDescriptions}}
4650
4751
Thread of Tweets You Are Replying To:
4852
{{formattedConversation}}
@@ -53,6 +57,8 @@ Thread of Tweets You Are Replying To:
5357
5458
Here is the current post text again. Remember to include an action if the current post text includes a prompt that asks for one of the available actions mentioned above (does not need to be exact)
5559
{{currentPost}}
60+
Here is the descriptions of images in the Current post.
61+
{{imageDescriptions}}
5662
` + messageCompletionFooter;
5763

5864
export const twitterShouldRespondTemplate = (targetUsersStr: string) =>
@@ -342,11 +348,34 @@ export class TwitterInteractionClient {
342348

343349
elizaLogger.debug("formattedConversation: ", formattedConversation);
344350

351+
let imageDescriptionsArray = [];
352+
try{
353+
elizaLogger.debug('Getting images');
354+
for (const photo of tweet.photos) {
355+
elizaLogger.debug(photo.url);
356+
const description = await this.runtime
357+
.getService<IImageDescriptionService>(
358+
ServiceType.IMAGE_DESCRIPTION
359+
)
360+
.describeImage(photo.url);
361+
imageDescriptionsArray.push(description);
362+
}
363+
} catch (error) {
364+
// Handle the error
365+
elizaLogger.error("Error Occured during describing image: ", error);
366+
}
367+
368+
369+
370+
345371
let state = await this.runtime.composeState(message, {
346372
twitterClient: this.client.twitterClient,
347373
twitterUserName: this.client.twitterConfig.TWITTER_USERNAME,
348374
currentPost,
349375
formattedConversation,
376+
imageDescriptions: imageDescriptionsArray.length > 0
377+
? `\nImages in Tweet:\n${imageDescriptionsArray.map((desc, i) =>
378+
`Image ${i + 1}: Title: ${desc.title}\nDescription: ${desc.description}`).join("\n\n")}`:""
350379
});
351380

352381
// check if the tweet exists, save if it doesn't
@@ -413,7 +442,6 @@ export class TwitterInteractionClient {
413442
this.runtime.character?.templates?.messageHandlerTemplate ||
414443
twitterMessageHandlerTemplate,
415444
});
416-
417445
elizaLogger.debug("Interactions prompt:\n" + context);
418446

419447
const response = await generateMessageResponse({
@@ -624,4 +652,4 @@ export class TwitterInteractionClient {
624652

625653
return thread;
626654
}
627-
}
655+
}

packages/core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@ai-sdk/google": "0.0.55",
7070
"@ai-sdk/google-vertex": "0.0.43",
7171
"@ai-sdk/groq": "0.0.3",
72+
"@ai-sdk/mistral": "^1.0.8",
7273
"@ai-sdk/openai": "1.0.5",
7374
"@anthropic-ai/sdk": "0.30.1",
7475
"@fal-ai/client": "1.2.0",

0 commit comments

Comments
 (0)