Skip to content

Commit 05f279a

Browse files
authoredDec 5, 2024··
Merge pull request #853 from ai16z/shaw/upgrade-models
fix: Use LARGE models for responses
2 parents 0a03140 + 770ba41 commit 05f279a

File tree

21 files changed

+301
-245
lines changed

21 files changed

+301
-245
lines changed
 

‎packages/client-discord/src/messages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export class MessageManager {
612612
const response = await generateMessageResponse({
613613
runtime: this.runtime,
614614
context,
615-
modelClass: ModelClass.SMALL,
615+
modelClass: ModelClass.LARGE,
616616
});
617617

618618
if (!response) {

‎packages/client-farcaster/src/interactions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class FarcasterInteractionManager {
188188
const response = await generateMessageResponse({
189189
runtime: this.runtime,
190190
context,
191-
modelClass: ModelClass.SMALL,
191+
modelClass: ModelClass.LARGE,
192192
});
193193

194194
response.inReplyTo = memoryId;

‎packages/client-telegram/src/messageManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export class MessageManager {
289289
const response = await generateMessageResponse({
290290
runtime: this.runtime,
291291
context,
292-
modelClass: ModelClass.SMALL,
292+
modelClass: ModelClass.LARGE,
293293
});
294294

295295
if (!response) {

‎packages/plugin-0g/src/actions/upload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const zgUpload: Action = {
7171
const content = await generateObjectV2({
7272
runtime,
7373
context: uploadContext,
74-
modelClass: ModelClass.SMALL,
74+
modelClass: ModelClass.LARGE,
7575
});
7676

7777
// Validate upload content

‎packages/plugin-bootstrap/src/actions/continue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const continueAction: Action = {
138138
const response = await generateMessageResponse({
139139
runtime,
140140
context,
141-
modelClass: ModelClass.SMALL,
141+
modelClass: ModelClass.LARGE,
142142
});
143143

144144
response.inReplyTo = message.id;

‎packages/plugin-bootstrap/src/actions/followRoom.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export const shouldFollowTemplate =
1515
1616
{{recentMessages}}
1717
18-
Should {{agentName}} start following this room, eagerly participating without explicit mentions?
18+
Should {{agentName}} start following this room, eagerly participating without explicit mentions?
1919
Respond with YES if:
20-
- The user has directly asked {{agentName}} to follow the conversation or participate more actively
20+
- The user has directly asked {{agentName}} to follow the conversation or participate more actively
2121
- The conversation topic is highly engaging and {{agentName}}'s input would add significant value
2222
- {{agentName}} has unique insights to contribute and the users seem receptive
2323
@@ -67,7 +67,7 @@ export const followRoomAction: Action = {
6767
const response = await generateTrueOrFalse({
6868
runtime,
6969
context: shouldFollowContext,
70-
modelClass: ModelClass.SMALL,
70+
modelClass: ModelClass.LARGE,
7171
});
7272

7373
return response;

‎packages/plugin-bootstrap/src/actions/muteRoom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const muteRoomAction: Action = {
5454
const response = await generateTrueOrFalse({
5555
runtime,
5656
context: shouldMuteContext,
57-
modelClass: ModelClass.SMALL,
57+
modelClass: ModelClass.LARGE,
5858
});
5959

6060
return response;

‎packages/plugin-bootstrap/src/actions/unfollowRoom.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const shouldUnfollowTemplate =
1717
1818
Should {{agentName}} stop closely following this previously followed room and only respond when mentioned?
1919
Respond with YES if:
20-
- The user has suggested that {{agentName}} is over-participating or being disruptive
20+
- The user has suggested that {{agentName}} is over-participating or being disruptive
2121
- {{agentName}}'s eagerness to contribute is not well-received by the users
2222
- The conversation has shifted to a topic where {{agentName}} has less to add
2323
@@ -52,7 +52,7 @@ export const unfollowRoomAction: Action = {
5252
const response = await generateTrueOrFalse({
5353
runtime,
5454
context: shouldUnfollowContext,
55-
modelClass: ModelClass.SMALL,
55+
modelClass: ModelClass.LARGE,
5656
});
5757

5858
return response;

‎packages/plugin-bootstrap/src/actions/unmuteRoom.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import {
1313
export const shouldUnmuteTemplate =
1414
`Based on the conversation so far:
1515
16-
{{recentMessages}}
16+
{{recentMessages}}
1717
1818
Should {{agentName}} unmute this previously muted room and start considering it for responses again?
19-
Respond with YES if:
19+
Respond with YES if:
2020
- The user has explicitly asked {{agentName}} to start responding again
2121
- The user seems to want to re-engage with {{agentName}} in a respectful manner
2222
- The tone of the conversation has improved and {{agentName}}'s input would be welcome
@@ -52,7 +52,7 @@ export const unmuteRoomAction: Action = {
5252
const response = generateTrueOrFalse({
5353
context: shouldUnmuteContext,
5454
runtime,
55-
modelClass: ModelClass.SMALL,
55+
modelClass: ModelClass.LARGE,
5656
});
5757

5858
return response;

‎packages/plugin-bootstrap/src/evaluators/fact.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) {
6464
const facts = await generateObjectArray({
6565
runtime,
6666
context,
67-
modelClass: ModelClass.SMALL,
67+
modelClass: ModelClass.LARGE,
6868
});
6969

7070
const factsManager = new MemoryManager({

‎packages/plugin-bootstrap/src/evaluators/goal.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async function handler(
7272
const response = await generateText({
7373
runtime,
7474
context,
75-
modelClass: ModelClass.SMALL,
75+
modelClass: ModelClass.LARGE,
7676
});
7777

7878
// Parse the JSON response to extract goal updates
@@ -160,12 +160,12 @@ export const goalEvaluator: Evaluator = {
160160
context: `Actors in the scene:
161161
{{user1}}: An avid reader and member of a book club.
162162
{{user2}}: The organizer of the book club.
163-
163+
164164
Goals:
165165
- Name: Finish reading "War and Peace"
166166
id: 12345-67890-12345-67890
167167
Status: IN_PROGRESS
168-
Objectives:
168+
Objectives:
169169
- Read up to chapter 20 by the end of the month
170170
- Discuss the first part in the next meeting`,
171171

@@ -206,12 +206,12 @@ export const goalEvaluator: Evaluator = {
206206
context: `Actors in the scene:
207207
{{user1}}: A fitness enthusiast working towards a marathon.
208208
{{user2}}: A personal trainer.
209-
209+
210210
Goals:
211211
- Name: Complete a marathon
212212
id: 23456-78901-23456-78901
213213
Status: IN_PROGRESS
214-
Objectives:
214+
Objectives:
215215
- Increase running distance to 30 miles a week
216216
- Complete a half-marathon as practice`,
217217

@@ -249,12 +249,12 @@ export const goalEvaluator: Evaluator = {
249249
context: `Actors in the scene:
250250
{{user1}}: A student working on a final year project.
251251
{{user2}}: The project supervisor.
252-
252+
253253
Goals:
254254
- Name: Finish the final year project
255255
id: 34567-89012-34567-89012
256256
Status: IN_PROGRESS
257-
Objectives:
257+
Objectives:
258258
- Submit the first draft of the thesis
259259
- Complete the project prototype`,
260260

@@ -294,12 +294,12 @@ export const goalEvaluator: Evaluator = {
294294
context: `Actors in the scene:
295295
{{user1}}: A project manager working on a software development project.
296296
{{user2}}: A software developer in the project team.
297-
297+
298298
Goals:
299299
- Name: Launch the new software version
300300
id: 45678-90123-45678-90123
301301
Status: IN_PROGRESS
302-
Objectives:
302+
Objectives:
303303
- Complete the coding for the new features
304304
- Perform comprehensive testing of the software`,
305305

‎packages/plugin-coinbase/src/plugins/commerce.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const createCoinbaseChargeAction: Action = {
147147
const chargeDetails = await generateObjectV2({
148148
runtime,
149149
context,
150-
modelClass: ModelClass.SMALL,
150+
modelClass: ModelClass.LARGE,
151151
schema: ChargeSchema,
152152
});
153153
if (!isChargeContent(chargeDetails.object)) {
@@ -344,7 +344,7 @@ export const getChargeDetailsAction: Action = {
344344
const chargeDetails = await generateObjectV2({
345345
runtime,
346346
context,
347-
modelClass: ModelClass.SMALL,
347+
modelClass: ModelClass.LARGE,
348348
schema: ChargeSchema,
349349
});
350350
if (!isChargeContent(chargeDetails.object)) {

‎packages/plugin-coinbase/src/plugins/massPayments.ts

+20-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ import path from "path";
2525
import { fileURLToPath } from "url";
2626
import fs from "fs";
2727
import { createArrayCsvWriter } from "csv-writer";
28-
import { appendTransactionsToCsv, executeTransfer, getCharityAddress, getWalletDetails, initializeWallet } from "../utils";
28+
import {
29+
appendTransactionsToCsv,
30+
executeTransfer,
31+
getCharityAddress,
32+
getWalletDetails,
33+
initializeWallet,
34+
} from "../utils";
2935

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

136142
// Execute the transfer
137-
const transfer = await executeTransfer(sendingWallet, transferAmount, assetIdLowercase, address);
143+
const transfer = await executeTransfer(
144+
sendingWallet,
145+
transferAmount,
146+
assetIdLowercase,
147+
address
148+
);
138149

139150
transactions.push({
140151
address,
@@ -143,7 +154,6 @@ async function executeMassPayout(
143154
errorCode: null,
144155
transactionUrl: transfer.getTransactionLink(),
145156
});
146-
147157
} catch (error) {
148158
elizaLogger.error(
149159
"Error during transfer for address:",
@@ -171,7 +181,12 @@ async function executeMassPayout(
171181
}
172182
// Send 1% to charity
173183
const charityAddress = getCharityAddress(networkId);
174-
const charityTransfer = await executeTransfer(sendingWallet, transferAmount * 0.01, assetId, charityAddress);
184+
const charityTransfer = await executeTransfer(
185+
sendingWallet,
186+
transferAmount * 0.01,
187+
assetId,
188+
charityAddress
189+
);
175190
transactions.push({
176191
address: charityAddress,
177192
amount: charityTransfer.getAmount().toNumber(),
@@ -243,7 +258,7 @@ export const sendMassPayoutAction: Action = {
243258
const transferDetails = await generateObjectV2({
244259
runtime,
245260
context,
246-
modelClass: ModelClass.SMALL,
261+
modelClass: ModelClass.LARGE,
247262
schema: TransferSchema,
248263
});
249264

‎packages/plugin-coinbase/src/plugins/tokenContract.ts

+233-195
Large diffs are not rendered by default.

‎packages/plugin-coinbase/src/plugins/trade.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Coinbase} from "@coinbase/coinbase-sdk";
1+
import { Coinbase } from "@coinbase/coinbase-sdk";
22
import {
33
Action,
44
Plugin,
@@ -22,7 +22,6 @@ import { fileURLToPath } from "url";
2222
import fs from "fs";
2323
import { createArrayCsvWriter } from "csv-writer";
2424

25-
2625
// Dynamically resolve the file path to the src/plugins directory
2726
const __filename = fileURLToPath(import.meta.url);
2827
const __dirname = path.dirname(__filename);
@@ -136,7 +135,7 @@ export const executeTradeAction: Action = {
136135
const tradeDetails = await generateObjectV2({
137136
runtime,
138137
context,
139-
modelClass: ModelClass.SMALL,
138+
modelClass: ModelClass.LARGE,
140139
schema: TradeSchema,
141140
});
142141

@@ -165,7 +164,13 @@ export const executeTradeAction: Action = {
165164
);
166165
return;
167166
}
168-
const { trade, transfer } = await executeTradeAndCharityTransfer(runtime, network, amount, sourceAsset, targetAsset);
167+
const { trade, transfer } = await executeTradeAndCharityTransfer(
168+
runtime,
169+
network,
170+
amount,
171+
sourceAsset,
172+
targetAsset
173+
);
169174
callback(
170175
{
171176
text: `Trade executed successfully:
@@ -264,4 +269,3 @@ export const tradePlugin: Plugin = {
264269
actions: [executeTradeAction],
265270
providers: [tradeProvider],
266271
};
267-

‎packages/plugin-conflux/src/actions/bridgeTransfer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const bridgeTransfer: Action = {
120120
const content = await generateObjectV2({
121121
runtime,
122122
context,
123-
modelClass: ModelClass.SMALL,
123+
modelClass: ModelClass.LARGE,
124124
schema: TransferSchema,
125125
});
126126

‎packages/plugin-goat/src/actions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async function generateParameters<TWalletClient extends WalletClient>(
144144
const { object } = await generateObjectV2({
145145
runtime,
146146
context,
147-
modelClass: ModelClass.SMALL,
147+
modelClass: ModelClass.LARGE,
148148
schema: tool.parameters,
149149
});
150150

@@ -195,6 +195,6 @@ async function generateResponse(
195195
return generateText({
196196
runtime,
197197
context,
198-
modelClass: ModelClass.SMALL,
198+
modelClass: ModelClass.LARGE,
199199
});
200200
}

‎packages/plugin-icp/src/actions/createToken.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ import { unwrapOption, wrapOption } from "../utils/common/types/options";
2020
import { unwrapRustResultMap } from "../utils/common/types/results";
2121
import { icpWalletProvider } from "../providers/wallet";
2222
import { uploadFileToWeb3Storage } from "../apis/uploadFile";
23-
import { createTokenTemplate, logoPromptTemplate } from './prompts/token';
24-
import { CANISTER_IDS } from '../constants/canisters';
23+
import { createTokenTemplate, logoPromptTemplate } from "./prompts/token";
24+
import { CANISTER_IDS } from "../constants/canisters";
2525

2626
async function createTokenTransaction(
2727
creator: ActorCreator,
2828
tokenInfo: CreateMemeTokenArg
2929
) {
30-
const actor: _SERVICE = await creator(
31-
idlFactory,
32-
CANISTER_IDS.PICK_PUMP
33-
);
30+
const actor: _SERVICE = await creator(idlFactory, CANISTER_IDS.PICK_PUMP);
3431
const result = await actor.create_token({
3532
...tokenInfo,
3633
name: tokenInfo.name,
@@ -123,7 +120,9 @@ export const executeCreateToken: Action = {
123120
: message.content.text || ""
124121
).toLowerCase();
125122

126-
return keywords.some((keyword) => messageText.includes(keyword.toLowerCase()));
123+
return keywords.some((keyword) =>
124+
messageText.includes(keyword.toLowerCase())
125+
);
127126
},
128127
handler: async (
129128
runtime: IAgentRuntime,
@@ -166,7 +165,7 @@ export const executeCreateToken: Action = {
166165
const logoPrompt = await generateText({
167166
runtime,
168167
context: logoPromptContext,
169-
modelClass: ModelClass.SMALL,
168+
modelClass: ModelClass.LARGE,
170169
});
171170

172171
const logo = await generateTokenLogo(logoPrompt, runtime);

‎packages/plugin-solana/src/actions/takeOrder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Determine if the user is trying to shill the ticker. if they are, respond with e
7878
const convictionResponse = await generateText({
7979
runtime,
8080
context: context,
81-
modelClass: ModelClass.SMALL,
81+
modelClass: ModelClass.LARGE,
8282
});
8383

8484
// TODOL parse and validate the JSON

‎packages/plugin-solana/src/actions/transfer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default {
122122
const content = await generateObject({
123123
runtime,
124124
context: transferContext,
125-
modelClass: ModelClass.SMALL,
125+
modelClass: ModelClass.LARGE,
126126
});
127127

128128
// Validate transfer content

‎packages/plugin-starknet/src/actions/takeOrder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const take_order: Action = {
8484
const convictionResponse = await generateText({
8585
runtime,
8686
context: context,
87-
modelClass: ModelClass.SMALL,
87+
modelClass: ModelClass.LARGE,
8888
});
8989

9090
// TODOL parse and validate the JSON

0 commit comments

Comments
 (0)
Please sign in to comment.