Skip to content

Commit 7ef4502

Browse files
committed
Integrate coinbase plugin and test and get it working
1 parent e96e0cc commit 7ef4502

File tree

10 files changed

+280
-863
lines changed

10 files changed

+280
-863
lines changed

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@ai16z/plugin-node": "workspace:*",
2626
"@ai16z/plugin-solana": "workspace:*",
2727
"@ai16z/plugin-starknet": "workspace:*",
28+
"@ai16z/plugin-coinbase": "workspace:*",
2829
"readline": "^1.3.0",
2930
"ws": "^8.18.0",
3031
"yargs": "17.7.2"

agent/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
2626
import { solanaPlugin } from "@ai16z/plugin-solana";
2727
import { nodePlugin } from "@ai16z/plugin-node";
28+
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
2829
import Database from "better-sqlite3";
2930
import fs from "fs";
3031
import readline from "readline";
@@ -249,6 +250,10 @@ export function createAgent(
249250
bootstrapPlugin,
250251
nodePlugin,
251252
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
253+
character.settings.secrets?.COINBASE_COMMERCE_KEY ||
254+
process.env.COINBASE_COMMERCE_KEY
255+
? coinbaseCommercePlugin
256+
: null,
252257
].filter(Boolean),
253258
providers: [],
254259
actions: [],

examples/CoinbaseClient.ts

-386
This file was deleted.

packages/core/src/generation.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,9 @@ export const generateObjectV2 = async ({
937937

938938
const provider = runtime.modelProvider;
939939
const model = models[provider].model[modelClass];
940+
if (!model) {
941+
throw new Error(`Unsupported model class: ${modelClass}`);
942+
}
940943
const temperature = models[provider].settings.temperature;
941944
const frequency_penalty = models[provider].settings.frequency_penalty;
942945
const presence_penalty = models[provider].settings.presence_penalty;
@@ -945,7 +948,7 @@ export const generateObjectV2 = async ({
945948
const apiKey = runtime.token;
946949

947950
try {
948-
context = await trimTokens(context, max_context_length, modelClass);
951+
context = await trimTokens(context, max_context_length, "gpt-4o");
949952

950953
const modelOptions: ModelSettings = {
951954
prompt: context,

0 commit comments

Comments
 (0)