Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the template overrides #207

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions core/elizaConfig.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
# Paths are relative to the core/src directory

actions:
- name: askClaude
path: ./actions/askClaude.ts
- name: epicAction
path: ./custom_actions/epicAction.ts
213 changes: 0 additions & 213 deletions core/src/actions/askClaude.ts

This file was deleted.

34 changes: 30 additions & 4 deletions core/src/actions/continue.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { messageHandlerTemplate } from "../clients/discord/templates.ts";
import { composeContext } from "../core/context.ts";
import {
generateTrueOrFalse,
generateMessageResponse,
generateTrueOrFalse,
} from "../core/generation.ts";
import { log_to_file } from "../core/logger.ts";
import { booleanFooter } from "../core/parsing.ts";
import { booleanFooter, messageCompletionFooter } from "../core/parsing.ts";
import {
Action,
ActionExample,
Expand All @@ -19,6 +18,33 @@ import {

const maxContinuesInARow = 3;

export const messageHandlerTemplate =
// {{goals}}
`# Action Examples
{{actionExamples}}
(Action examples are for reference only. Do not use the information from them in your response.)

# Task: Generate dialog and actions for the character {{agentName}}.
About {{agentName}}:
{{bio}}
{{lore}}

{{providers}}

{{attachments}}

# Capabilities
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.

{{messageDirections}}

{{recentMessages}}

{{actions}}

# Instructions: Write the next message for {{agentName}}. Ignore "action".
` + messageCompletionFooter;

export const shouldContinueTemplate =
`# Task: Decide if {{agentName}} should continue, or wait for others in the conversation so speak.

Expand Down Expand Up @@ -106,7 +132,7 @@ export const continueAction: Action = {

const context = composeContext({
state,
template: messageHandlerTemplate,
template: runtime.character.templates?.continueMessageHandlerTemplate || runtime.character.templates?.messageHandlerTemplate || messageHandlerTemplate,
});
const datestr = new Date().toUTCString().replace(/:/g, "-");

Expand Down
1 change: 0 additions & 1 deletion core/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "./askClaude.ts";
export * from "./followRoom.ts";
export * from "./imageGeneration.ts";
export * from "./muteRoom.ts";
Expand Down
2 changes: 1 addition & 1 deletion core/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export async function startTwitter(runtime: IAgentRuntime) {
runtime
);
await wait();
const twitterGenerationClient = new Client.TwitterGenerationClient(runtime);
const twitterGenerationClient = new Client.TwitterPostClient(runtime);

return [
twitterInteractionClient,
Expand Down
Loading
Loading