Skip to content

Commit 3207d72

Browse files
authored
Merge branch 'develop' into feat/nillion-db
2 parents 62db7c6 + 0bdafda commit 3207d72

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

+4880
-3473
lines changed

.env.example

+44-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=
@@ -542,4 +555,8 @@ AKASH_MANIFEST_MODE=auto
542555
# Default: Will use the SDL directory
543556
AKASH_MANIFEST_PATH=
544557
# Values: "strict" | "lenient" | "none" - Default: "strict"
545-
AKASH_MANIFEST_VALIDATION_LEVEL=strict
558+
AKASH_MANIFEST_VALIDATION_LEVEL=strict
559+
560+
# Quai Network Ecosystem
561+
QUAI_PRIVATE_KEY=
562+
QUAI_RPC_URL=https://rpc.quai.network

agent/package.json

+5-2
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-coingecko": "workspace:*",
4039
"@elizaos/plugin-binance": "workspace:*",
@@ -54,6 +53,7 @@
5453
"@elizaos/plugin-icp": "workspace:*",
5554
"@elizaos/plugin-image-generation": "workspace:*",
5655
"@elizaos/plugin-movement": "workspace:*",
56+
"@elizaos/plugin-massa": "workspace:*",
5757
"@elizaos/plugin-nft-generation": "workspace:*",
5858
"@elizaos/plugin-node": "workspace:*",
5959
"@elizaos/plugin-solana": "workspace:*",
@@ -72,6 +72,7 @@
7272
"@elizaos/plugin-near": "workspace:*",
7373
"@elizaos/plugin-zksync-era": "workspace:*",
7474
"@elizaos/plugin-twitter": "workspace:*",
75+
"@elizaos/plugin-primus": "workspace:*",
7576
"@elizaos/plugin-cronoszkevm": "workspace:*",
7677
"@elizaos/plugin-3d-generation": "workspace:*",
7778
"@elizaos/plugin-fuel": "workspace:*",
@@ -88,7 +89,9 @@
8889
"@elizaos/plugin-allora": "workspace:*",
8990
"@elizaos/plugin-opacity": "workspace:*",
9091
"@elizaos/plugin-nillion": "workspace:*",
92+
"@elizaos/plugin-hyperliquid": "workspace:*",
9193
"@elizaos/plugin-akash": "workspace:*",
94+
"@elizaos/plugin-quai": "workspace:*",
9295
"readline": "1.3.0",
9396
"ws": "8.18.0",
9497
"yargs": "17.7.2"
@@ -100,4 +103,4 @@
100103
"ts-node": "10.9.2",
101104
"tsup": "8.3.5"
102105
}
103-
}
106+
}

agent/src/index.ts

+33-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,19 +87,21 @@ 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";
97+
import { quaiPlugin } from "@elizaos/plugin-quai";
9498
import Database from "better-sqlite3";
9599
import fs from "fs";
96100
import net from "net";
97101
import path from "path";
98102
import { fileURLToPath } from "url";
99103
import yargs from "yargs";
104+
import {dominosPlugin} from "@elizaos/plugin-dominos";
100105

101106
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
102107
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -398,6 +403,11 @@ export function getTokenForProvider(
398403
character.settings?.secrets?.GOOGLE_GENERATIVE_AI_API_KEY ||
399404
settings.GOOGLE_GENERATIVE_AI_API_KEY
400405
);
406+
case ModelProviderName.MISTRAL:
407+
return (
408+
character.settings?.secrets?.MISTRAL_API_KEY ||
409+
settings.MISTRAL_API_KEY
410+
);
401411
case ModelProviderName.LETZAI:
402412
return (
403413
character.settings?.secrets?.LETZAI_API_KEY ||
@@ -616,6 +626,19 @@ export async function createAgent(
616626
elizaLogger.log("modelProvider", character.modelProvider);
617627
elizaLogger.log("token", token);
618628
}
629+
if (
630+
process.env.PRIMUS_APP_ID &&
631+
process.env.PRIMUS_APP_SECRET &&
632+
process.env.VERIFIABLE_INFERENCE_ENABLED === "true"){
633+
verifiableInferenceAdapter = new PrimusAdapter({
634+
appId: process.env.PRIMUS_APP_ID,
635+
appSecret: process.env.PRIMUS_APP_SECRET,
636+
attMode: "proxytls",
637+
modelProvider: character.modelProvider,
638+
token,
639+
});
640+
elizaLogger.log("Verifiable inference primus adapter initialized");
641+
}
619642

620643
return new AgentRuntime({
621644
databaseAdapter: db,
@@ -758,6 +781,10 @@ export async function createAgent(
758781
? artheraPlugin
759782
: null,
760783
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
784+
(getSecret(character, "HYPERLIQUID_PRIVATE_KEY") ||
785+
getSecret(character, "HYPERLIQUID_TESTNET"))
786+
? hyperliquidPlugin
787+
: null,
761788
getSecret(character, "AKASH_MNEMONIC") &&
762789
getSecret(character, "AKASH_WALLET_ADDRESS")
763790
? akashPlugin
@@ -769,6 +796,11 @@ export async function createAgent(
769796
getSecret(character, "NILLION_NILDB_SCHEMA_ID")
770797
? nillionPlugin
771798
: null,
799+
? akashPlugin
800+
: null,
801+
getSecret(character, "QUAI_PRIVATE_KEY")
802+
? quaiPlugin
803+
: null,
772804
].filter(Boolean),
773805
providers: [],
774806
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)