Skip to content

Commit 7ba4dfa

Browse files
authored
Merge branch 'develop' into patch-1
2 parents bfb3583 + 05cd314 commit 7ba4dfa

File tree

14 files changed

+63
-302
lines changed

14 files changed

+63
-302
lines changed

docs/docs/advanced/eliza-in-tee.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Finally, click on the `Submit` button to deploy your Eliza agent.
307307

308308
This will take a few minutes to complete. Once the deployment is complete, you can click on the `View` button to view your Eliza agent.
309309

310-
Here is an example of a deployed agent named `vitailik2077`:
310+
Here is an example of a deployed agent named `vitalik2077`:
311311

312312
![Deployed Agent](https://i.imgur.com/ie8gpg9.png)
313313

docs/docs/core/evaluators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Evaluators enable agents to:
2424
1. Import the necessary evaluator types:
2525

2626
```typescript
27-
import { Evaluator, IAgentRuntime, Memory, State } from "@elizaos/core-core";
27+
import { Evaluator, IAgentRuntime, Memory, State } from "@elizaos/core";
2828
```
2929

3030
2. Choose or create an evaluator:

docs/docs/packages/agent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44

55
# 🤖 Agent Package
66

7-
The Agent Package (`@eliza/agent`) provides the high-level orchestration layer for Eliza, managing agent lifecycles, character loading, client initialization, and runtime coordination.
7+
The Agent Package (`@elizaos/agent`) provides the high-level orchestration layer for Eliza, managing agent lifecycles, character loading, client initialization, and runtime coordination.
88

99
## Architecture Overview
1010

packages/client-telegram/src/telegramClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getOrCreateRecommenderInBe } from "./getOrCreateRecommenderInBe.ts";
77
export class TelegramClient {
88
private bot: Telegraf<Context>;
99
private runtime: IAgentRuntime;
10-
private messageManager: MessageManager;
10+
public messageManager: MessageManager;
1111
private backend;
1212
private backendToken;
1313
private tgTrader;

packages/core/__tests__/models.test.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getModel, getEndpoint, models } from "../src/models.ts";
1+
import { getModelSettings, getImageModelSettings, getEndpoint, models } from "../src/models.ts";
22
import { ModelProviderName, ModelClass } from "../src/types.ts";
33
import { describe, test, expect, vi } from "vitest";
44

@@ -129,22 +129,22 @@ describe("Model Provider Configuration", () => {
129129
});
130130
describe("Livepeer Provider", () => {
131131
test("should have correct endpoint configuration", () => {
132-
expect(models[ModelProviderName.LIVEPEER].endpoint).toBe("http://gateway.test-gateway");
132+
expect(getEndpoint(ModelProviderName.LIVEPEER)).toBe("http://gateway.test-gateway");
133133
});
134134

135135
test("should have correct model mappings", () => {
136136
const livepeerModels = models[ModelProviderName.LIVEPEER].model;
137-
expect(livepeerModels[ModelClass.SMALL]).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
138-
expect(livepeerModels[ModelClass.MEDIUM]).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
139-
expect(livepeerModels[ModelClass.LARGE]).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
140-
expect(livepeerModels[ModelClass.IMAGE]).toBe("ByteDance/SDXL-Lightning");
137+
expect(livepeerModels[ModelClass.SMALL]?.name).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
138+
expect(livepeerModels[ModelClass.MEDIUM]?.name).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
139+
expect(livepeerModels[ModelClass.LARGE]?.name).toBe("meta-llama/Meta-Llama-3.1-8B-Instruct");
140+
expect(livepeerModels[ModelClass.IMAGE]?.name).toBe("ByteDance/SDXL-Lightning");
141141
});
142142

143143
test("should have correct settings configuration", () => {
144-
const settings = models[ModelProviderName.LIVEPEER].settings;
145-
expect(settings.maxInputTokens).toBe(128000);
146-
expect(settings.maxOutputTokens).toBe(8192);
147-
expect(settings.temperature).toBe(0);
144+
const settings = getModelSettings(ModelProviderName.LIVEPEER, ModelClass.LARGE);
145+
expect(settings?.maxInputTokens).toBe(8000);
146+
expect(settings?.maxOutputTokens).toBe(8192);
147+
expect(settings?.temperature).toBe(0);
148148
});
149149
});
150150
});
@@ -169,10 +169,10 @@ describe("Model Retrieval Functions", () => {
169169
).toBe("nousresearch/hermes-3-llama-3.1-405b");
170170
});
171171

172-
test("should throw error for invalid model provider", () => {
173-
expect(() =>
174-
getModel("INVALID_PROVIDER" as any, ModelClass.SMALL)
175-
).toThrow();
172+
test("Test to ensure an invalid model provider returns undefined", () => {
173+
expect(
174+
getModelSettings("INVALID_PROVIDER" as any, ModelClass.SMALL)
175+
).toBe(undefined);
176176
});
177177
});
178178

@@ -250,12 +250,12 @@ describe("Environment Variable Integration", () => {
250250
describe("Generation with Livepeer", () => {
251251
test("should have correct image generation settings", () => {
252252
const livepeerConfig = models[ModelProviderName.LIVEPEER];
253-
expect(livepeerConfig.model[ModelClass.IMAGE]).toBe("ByteDance/SDXL-Lightning");
254-
expect(livepeerConfig.settings.temperature).toBe(0);
253+
expect(livepeerConfig.model[ModelClass.IMAGE]?.name).toBe("ByteDance/SDXL-Lightning");
254+
expect(getModelSettings(ModelProviderName.LIVEPEER, ModelClass.SMALL)?.temperature).toBe(0);
255255
});
256256

257257
test("should use default image model", () => {
258258
delete process.env.IMAGE_LIVEPEER_MODEL;
259-
expect(models[ModelProviderName.LIVEPEER].model[ModelClass.IMAGE]).toBe("ByteDance/SDXL-Lightning");
259+
expect(getImageModelSettings(ModelProviderName.LIVEPEER)?.name).toBe("ByteDance/SDXL-Lightning");
260260
});
261261
});

packages/core/__tests__/parsing.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ describe("Parsing Module", () => {
113113
const input = '```json\n{"key": "value", "number": 42}\n```';
114114
expect(parseJSONObjectFromText(input)).toEqual({
115115
key: "value",
116-
number: 42,
116+
number: "42",
117117
});
118118
});
119119

120120
it("should parse JSON object without code block", () => {
121121
const input = '{"key": "value", "number": 42}';
122122
expect(parseJSONObjectFromText(input)).toEqual({
123123
key: "value",
124-
number: 42,
124+
number: "42",
125125
});
126126
});
127127

packages/core/src/environment.ts

+8
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ export const CharacterSchema = z.object({
106106
})
107107
.optional(),
108108
model: z.string().optional(),
109+
modelConfig: z.object({
110+
maxInputTokens: z.number().optional(),
111+
maxOutputTokens: z.number().optional(),
112+
temperature: z.number().optional(),
113+
frequency_penalty: z.number().optional(),
114+
presence_penalty:z.number().optional()
115+
})
116+
.optional(),
109117
embeddingModel: z.string().optional(),
110118
})
111119
.optional(),

packages/core/src/generation.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ export async function generateText({
502502
const max_context_length =
503503
modelConfiguration?.maxInputTokens || modelSettings.maxInputTokens;
504504
const max_response_length =
505-
modelConfiguration?.max_response_length ||
505+
modelConfiguration?.maxOutputTokens ||
506506
modelSettings.maxOutputTokens;
507507
const experimental_telemetry =
508508
modelConfiguration?.experimental_telemetry ||
@@ -2358,14 +2358,14 @@ async function handleGroq({
23582358
*/
23592359
async function handleGoogle({
23602360
model,
2361-
apiKey: _apiKey,
2361+
apiKey,
23622362
schema,
23632363
schemaName,
23642364
schemaDescription,
23652365
mode = "json",
23662366
modelOptions,
23672367
}: ProviderOptions): Promise<GenerateObjectResult<unknown>> {
2368-
const google = createGoogleGenerativeAI();
2368+
const google = createGoogleGenerativeAI({apiKey});
23692369
return await aiGenerateObject({
23702370
model: google(model),
23712371
schema,

packages/core/src/models.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ export const models: Models = {
987987
},
988988
},
989989
[ModelProviderName.LIVEPEER]: {
990-
endpoint: settings.LIVEPEER_GATEWAY_URL,
990+
endpoint: settings.LIVEPEER_GATEWAY_URL || "http://gateway.test-gateway",
991991
model: {
992992
[ModelClass.SMALL]: {
993993
name:

packages/core/src/parsing.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export function parseJSONObjectFromText(
146146
const jsonBlockMatch = text.match(jsonBlockPattern);
147147

148148
if (jsonBlockMatch) {
149+
text = cleanJsonResponse(text);
149150
const parsingText = normalizeJsonString(text);
150151
try {
151152
jsonData = JSON.parse(parsingText);
@@ -159,6 +160,7 @@ export function parseJSONObjectFromText(
159160
const objectMatch = text.match(objectPattern);
160161

161162
if (objectMatch) {
163+
text = cleanJsonResponse(text);
162164
const parsingText = normalizeJsonString(text);
163165
try {
164166
jsonData = JSON.parse(parsingText);
@@ -214,7 +216,7 @@ export function extractAttributes(
214216
});
215217
}
216218

217-
return attributes;
219+
return Object.entries(attributes).length > 0 ? attributes : null;
218220
}
219221

220222
/**

packages/core/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ export type TelemetrySettings = {
696696

697697
export interface ModelConfiguration {
698698
temperature?: number;
699-
max_response_length?: number;
699+
maxOutputTokens?: number;
700700
frequency_penalty?: number;
701701
presence_penalty?: number;
702702
maxInputTokens?: number;
+24-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
{
2-
"name": "@elizaos/plugin-ethstorage",
3-
"main": "dist/index.js",
4-
"type": "module",
5-
"types": "dist/index.d.ts",
6-
"dependencies": {
7-
"@elizaos/core": "workspace:*",
8-
"@elizaos/plugin-trustdb": "workspace:*",
9-
"ethers": "^6.13.5",
10-
"kzg-wasm": "^0.4.0"
11-
},
12-
"devDependencies": {
13-
"@biomejs/biome": "1.9.4",
14-
"@types/node": "^20.0.0",
15-
"tsup": "8.3.5"
16-
},
17-
"scripts": {
18-
"build": "tsup --format esm --dts",
19-
"dev": "tsup --format esm --dts --watch",
20-
"lint": "biome lint .",
21-
"lint:fix": "biome check --apply .",
22-
"format": "biome format .",
23-
"format:fix": "biome format --write ."
24-
}
2+
"name": "@elizaos/plugin-ethstorage",
3+
"version": "0.25.6-alpha.1",
4+
"main": "dist/index.js",
5+
"type": "module",
6+
"types": "dist/index.d.ts",
7+
"dependencies": {
8+
"@elizaos/core": "workspace:*",
9+
"@elizaos/plugin-trustdb": "workspace:*",
10+
"ethers": "^6.13.5",
11+
"kzg-wasm": "^0.4.0"
12+
},
13+
"devDependencies": {
14+
"@biomejs/biome": "1.9.4",
15+
"@types/node": "^20.0.0",
16+
"tsup": "8.3.5"
17+
},
18+
"scripts": {
19+
"build": "tsup --format esm --dts",
20+
"dev": "tsup --format esm --dts --watch",
21+
"lint": "biome lint .",
22+
"lint:fix": "biome check --apply .",
23+
"format": "biome format .",
24+
"format:fix": "biome format --write ."
25+
}
2526
}

0 commit comments

Comments
 (0)