Skip to content

Commit

Permalink
Merge branch 'develop' into v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo authored Jan 30, 2025
2 parents 229b6f1 + a2529c5 commit a049aed
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 21 deletions.
11 changes: 11 additions & 0 deletions i18n/readme/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,17 @@ pnpm start
pnpm clean
```

## 一键部署 Eliza

使用 [Fleek](https://fleek.xyz/eliza/) 一键部署 Eliza。这让那些非开发人员也能使用 Eliza,并提供以下选项来构建智能助手:

1. 从模板开始
2. 从头开始构建角色文件
3. 上传预制的角色文件

点击[这里](https://fleek.xyz/eliza/)开始!


#### 其他要求

您可能需要安装 Sharp.如果在启动时看到错误,请尝试使用以下命令安装:
Expand Down
20 changes: 7 additions & 13 deletions packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ export class MessageManager {

// Check if we should post
if (
timeSinceLastMessage >
this.autoPostConfig.inactivityThreshold ||
(randomThreshold &&
timeSinceLastAutoPost >
(this.autoPostConfig.minTimeBetweenPosts || 0))
timeSinceLastMessage > randomThreshold &&
timeSinceLastAutoPost >
(this.autoPostConfig.minTimeBetweenPosts || 0)
) {
try {
const roomId = stringToUuid(
Expand Down Expand Up @@ -258,7 +256,7 @@ export class MessageManager {
// Create and store memories
const memories = messages.map((m) => ({
id: stringToUuid(
m.message_id.toString() + "-" + this.runtime.agentId
roomId + "-" + m.message_id.toString()
),
userId: this.runtime.agentId,
agentId: this.runtime.agentId,
Expand Down Expand Up @@ -384,9 +382,7 @@ export class MessageManager {
);

const memories = messages.map((m) => ({
id: stringToUuid(
m.message_id.toString() + "-" + this.runtime.agentId
),
id: stringToUuid(roomId + "-" + m.message_id.toString()),
userId: this.runtime.agentId,
agentId: this.runtime.agentId,
content: {
Expand Down Expand Up @@ -1264,7 +1260,7 @@ export class MessageManager {

// Get message ID
const messageId = stringToUuid(
message.message_id.toString() + "-" + this.runtime.agentId
roomId + "-" + message.message_id.toString()
) as UUID;

// Handle images
Expand Down Expand Up @@ -1339,9 +1335,7 @@ export class MessageManager {

const memory: Memory = {
id: stringToUuid(
sentMessage.message_id.toString() +
"-" +
this.runtime.agentId
roomId + "-" + sentMessage.message_id.toString()
),
agentId,
userId: agentId,
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export function extractAttributes(
* - Wraps unquoted values in double quotes.
* - Converts single-quoted values to double-quoted.
* - Ensures consistency in key-value formatting.
* - Collapses multiple double quotes into a single one.
* - Normalizes mixed adjacent quote pairs.
*
* This is useful for cleaning up improperly formatted JSON strings
Expand Down Expand Up @@ -251,11 +250,8 @@ export const normalizeJsonString = (str: string) => {
// "key": someWord → "key": "someWord"
str = str.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g, '$1: "$2"');

// Collapse multiple double quotes ("") into one
str = str.replace(/"+/g, '"');

// Replace adjacent quote pairs with a single double quote
str = str.replace(/(["'])(['"])/g, '"');
str = str.replace(/(?:"')|(?:'")/g, '"');
return str;
};

Expand Down
13 changes: 11 additions & 2 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,23 @@ export class AgentRuntime implements IAgentRuntime {

this.imageModelProvider =
this.character.imageModelProvider ?? this.modelProvider;


this.imageVisionModelProvider =
this.character.imageVisionModelProvider ?? this.modelProvider;

elizaLogger.info(
`${this.character.name}(${this.agentId}) - Selected model provider:`,
this.modelProvider
);

elizaLogger.info(
`${this.character.name}(${this.agentId}) - Selected image model provider:`,
this.imageVisionModelProvider
this.imageModelProvider
);

elizaLogger.info(
`${this.character.name}(${this.agentId}) - Selected image vision model provider:`,
this.imageVisionModelProvider
);

// Validate model provider
Expand Down
41 changes: 41 additions & 0 deletions packages/plugin-gitbook/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
},
"suspicious": {
"noExplicitAny": "error"
},
"style": {
"useConst": "error",
"useImportType": "off"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5"
}
},
"files": {
"ignore": [
"dist/**/*",
"extra/**/*",
"node_modules/**/*"
]
}
}
9 changes: 8 additions & 1 deletion packages/plugin-gitbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@
"@elizaos/core": "workspace:*",
"tsup": "8.3.5"
},
"devDependencies": {
"@biomejs/biome": "1.9.4"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"test": "vitest"
"test": "vitest",
"lint": "biome lint .",
"lint:fix": "biome check --apply .",
"format": "biome format .",
"format:fix": "biome format --write ."
}
}

0 comments on commit a049aed

Please sign in to comment.