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

fix: Use LARGE models for responses #853

Merged
merged 1 commit into from
Dec 5, 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: 1 addition & 1 deletion packages/client-discord/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export class MessageManager {
const response = await generateMessageResponse({
runtime: this.runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

if (!response) {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-farcaster/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class FarcasterInteractionManager {
const response = await generateMessageResponse({
runtime: this.runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

response.inReplyTo = memoryId;
Expand Down
2 changes: 1 addition & 1 deletion packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class MessageManager {
const response = await generateMessageResponse({
runtime: this.runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

if (!response) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-0g/src/actions/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const zgUpload: Action = {
const content = await generateObjectV2({
runtime,
context: uploadContext,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

// Validate upload content
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-bootstrap/src/actions/continue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const continueAction: Action = {
const response = await generateMessageResponse({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

response.inReplyTo = message.id;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-bootstrap/src/actions/followRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const shouldFollowTemplate =

{{recentMessages}}

Should {{agentName}} start following this room, eagerly participating without explicit mentions?
Should {{agentName}} start following this room, eagerly participating without explicit mentions?
Respond with YES if:
- The user has directly asked {{agentName}} to follow the conversation or participate more actively
- The user has directly asked {{agentName}} to follow the conversation or participate more actively
- The conversation topic is highly engaging and {{agentName}}'s input would add significant value
- {{agentName}} has unique insights to contribute and the users seem receptive

Expand Down Expand Up @@ -67,7 +67,7 @@ export const followRoomAction: Action = {
const response = await generateTrueOrFalse({
runtime,
context: shouldFollowContext,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

return response;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-bootstrap/src/actions/muteRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const muteRoomAction: Action = {
const response = await generateTrueOrFalse({
runtime,
context: shouldMuteContext,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

return response;
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-bootstrap/src/actions/unfollowRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const shouldUnfollowTemplate =

Should {{agentName}} stop closely following this previously followed room and only respond when mentioned?
Respond with YES if:
- The user has suggested that {{agentName}} is over-participating or being disruptive
- The user has suggested that {{agentName}} is over-participating or being disruptive
- {{agentName}}'s eagerness to contribute is not well-received by the users
- The conversation has shifted to a topic where {{agentName}} has less to add

Expand Down Expand Up @@ -52,7 +52,7 @@ export const unfollowRoomAction: Action = {
const response = await generateTrueOrFalse({
runtime,
context: shouldUnfollowContext,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

return response;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-bootstrap/src/actions/unmuteRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
export const shouldUnmuteTemplate =
`Based on the conversation so far:

{{recentMessages}}
{{recentMessages}}

Should {{agentName}} unmute this previously muted room and start considering it for responses again?
Respond with YES if:
Respond with YES if:
- The user has explicitly asked {{agentName}} to start responding again
- The user seems to want to re-engage with {{agentName}} in a respectful manner
- The tone of the conversation has improved and {{agentName}}'s input would be welcome
Expand Down Expand Up @@ -52,7 +52,7 @@ export const unmuteRoomAction: Action = {
const response = generateTrueOrFalse({
context: shouldUnmuteContext,
runtime,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

return response;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-bootstrap/src/evaluators/fact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) {
const facts = await generateObjectArray({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

const factsManager = new MemoryManager({
Expand Down
18 changes: 9 additions & 9 deletions packages/plugin-bootstrap/src/evaluators/goal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function handler(
const response = await generateText({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
});

// Parse the JSON response to extract goal updates
Expand Down Expand Up @@ -160,12 +160,12 @@ export const goalEvaluator: Evaluator = {
context: `Actors in the scene:
{{user1}}: An avid reader and member of a book club.
{{user2}}: The organizer of the book club.

Goals:
- Name: Finish reading "War and Peace"
id: 12345-67890-12345-67890
Status: IN_PROGRESS
Objectives:
Objectives:
- Read up to chapter 20 by the end of the month
- Discuss the first part in the next meeting`,

Expand Down Expand Up @@ -206,12 +206,12 @@ export const goalEvaluator: Evaluator = {
context: `Actors in the scene:
{{user1}}: A fitness enthusiast working towards a marathon.
{{user2}}: A personal trainer.

Goals:
- Name: Complete a marathon
id: 23456-78901-23456-78901
Status: IN_PROGRESS
Objectives:
Objectives:
- Increase running distance to 30 miles a week
- Complete a half-marathon as practice`,

Expand Down Expand Up @@ -249,12 +249,12 @@ export const goalEvaluator: Evaluator = {
context: `Actors in the scene:
{{user1}}: A student working on a final year project.
{{user2}}: The project supervisor.

Goals:
- Name: Finish the final year project
id: 34567-89012-34567-89012
Status: IN_PROGRESS
Objectives:
Objectives:
- Submit the first draft of the thesis
- Complete the project prototype`,

Expand Down Expand Up @@ -294,12 +294,12 @@ export const goalEvaluator: Evaluator = {
context: `Actors in the scene:
{{user1}}: A project manager working on a software development project.
{{user2}}: A software developer in the project team.

Goals:
- Name: Launch the new software version
id: 45678-90123-45678-90123
Status: IN_PROGRESS
Objectives:
Objectives:
- Complete the coding for the new features
- Perform comprehensive testing of the software`,

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-coinbase/src/plugins/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const createCoinbaseChargeAction: Action = {
const chargeDetails = await generateObjectV2({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
schema: ChargeSchema,
});
if (!isChargeContent(chargeDetails.object)) {
Expand Down Expand Up @@ -344,7 +344,7 @@ export const getChargeDetailsAction: Action = {
const chargeDetails = await generateObjectV2({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
schema: ChargeSchema,
});
if (!isChargeContent(chargeDetails.object)) {
Expand Down
25 changes: 20 additions & 5 deletions packages/plugin-coinbase/src/plugins/massPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ import path from "path";
import { fileURLToPath } from "url";
import fs from "fs";
import { createArrayCsvWriter } from "csv-writer";
import { appendTransactionsToCsv, executeTransfer, getCharityAddress, getWalletDetails, initializeWallet } from "../utils";
import {
appendTransactionsToCsv,
executeTransfer,
getCharityAddress,
getWalletDetails,
initializeWallet,
} from "../utils";

// Dynamically resolve the file path to the src/plugins directory
const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -134,7 +140,12 @@ async function executeMassPayout(
}

// Execute the transfer
const transfer = await executeTransfer(sendingWallet, transferAmount, assetIdLowercase, address);
const transfer = await executeTransfer(
sendingWallet,
transferAmount,
assetIdLowercase,
address
);

transactions.push({
address,
Expand All @@ -143,7 +154,6 @@ async function executeMassPayout(
errorCode: null,
transactionUrl: transfer.getTransactionLink(),
});

} catch (error) {
elizaLogger.error(
"Error during transfer for address:",
Expand Down Expand Up @@ -171,7 +181,12 @@ async function executeMassPayout(
}
// Send 1% to charity
const charityAddress = getCharityAddress(networkId);
const charityTransfer = await executeTransfer(sendingWallet, transferAmount * 0.01, assetId, charityAddress);
const charityTransfer = await executeTransfer(
sendingWallet,
transferAmount * 0.01,
assetId,
charityAddress
);
transactions.push({
address: charityAddress,
amount: charityTransfer.getAmount().toNumber(),
Expand Down Expand Up @@ -243,7 +258,7 @@ export const sendMassPayoutAction: Action = {
const transferDetails = await generateObjectV2({
runtime,
context,
modelClass: ModelClass.SMALL,
modelClass: ModelClass.LARGE,
schema: TransferSchema,
});

Expand Down
Loading
Loading