Skip to content

Commit d62ba1b

Browse files
committed
add the template overrides
1 parent ee5422d commit d62ba1b

Some content is hidden

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

70 files changed

+907
-21643
lines changed

core/elizaConfig.example.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
# Paths are relative to the core/src directory
66

77
actions:
8-
- name: askClaude
9-
path: ./actions/askClaude.ts
108
- name: epicAction
119
path: ./custom_actions/epicAction.ts

core/src/actions/askClaude.ts

-213
This file was deleted.

core/src/actions/continue.ts

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { messageHandlerTemplate } from "../clients/discord/templates.ts";
21
import { composeContext } from "../core/context.ts";
32
import {
4-
generateTrueOrFalse,
53
generateMessageResponse,
4+
generateTrueOrFalse,
65
} from "../core/generation.ts";
76
import { log_to_file } from "../core/logger.ts";
8-
import { booleanFooter } from "../core/parsing.ts";
7+
import { booleanFooter, messageCompletionFooter } from "../core/parsing.ts";
98
import {
109
Action,
1110
ActionExample,
@@ -19,6 +18,33 @@ import {
1918

2019
const maxContinuesInARow = 3;
2120

21+
export const messageHandlerTemplate =
22+
// {{goals}}
23+
`# Action Examples
24+
{{actionExamples}}
25+
(Action examples are for reference only. Do not use the information from them in your response.)
26+
27+
# Task: Generate dialog and actions for the character {{agentName}}.
28+
About {{agentName}}:
29+
{{bio}}
30+
{{lore}}
31+
32+
{{providers}}
33+
34+
{{attachments}}
35+
36+
# Capabilities
37+
Note that {{agentName}} is capable of reading/seeing/hearing various forms of media, including images, videos, audio, plaintext and PDFs. Recent attachments have been included above under the "Attachments" section.
38+
39+
{{messageDirections}}
40+
41+
{{recentMessages}}
42+
43+
{{actions}}
44+
45+
# Instructions: Write the next message for {{agentName}}. Ignore "action".
46+
` + messageCompletionFooter;
47+
2248
export const shouldContinueTemplate =
2349
`# Task: Decide if {{agentName}} should continue, or wait for others in the conversation so speak.
2450
@@ -106,7 +132,7 @@ export const continueAction: Action = {
106132

107133
const context = composeContext({
108134
state,
109-
template: messageHandlerTemplate,
135+
template: runtime.character.templates?.continueMessageHandlerTemplate || runtime.character.templates?.messageHandlerTemplate || messageHandlerTemplate,
110136
});
111137
const datestr = new Date().toUTCString().replace(/:/g, "-");
112138

core/src/actions/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from "./askClaude.ts";
21
export * from "./followRoom.ts";
32
export * from "./imageGeneration.ts";
43
export * from "./muteRoom.ts";

core/src/cli/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export async function startTwitter(runtime: IAgentRuntime) {
244244
runtime
245245
);
246246
await wait();
247-
const twitterGenerationClient = new Client.TwitterGenerationClient(runtime);
247+
const twitterGenerationClient = new Client.TwitterPostClient(runtime);
248248

249249
return [
250250
twitterInteractionClient,

0 commit comments

Comments
 (0)