Skip to content

Commit 26fab78

Browse files
committed
Integrate coinbase plugin and test and get it working
1 parent 6d65551 commit 26fab78

File tree

10 files changed

+359
-938
lines changed

10 files changed

+359
-938
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
@@ -17,6 +17,7 @@ import {
1717
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
1818
import { solanaPlugin } from "@ai16z/plugin-solana";
1919
import { nodePlugin } from "@ai16z/plugin-node";
20+
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
2021
import Database from "better-sqlite3";
2122
import fs from "fs";
2223
import readline from "readline";
@@ -228,6 +229,10 @@ export async function createAgent(
228229
bootstrapPlugin,
229230
nodePlugin,
230231
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
232+
character.settings.secrets?.COINBASE_COMMERCE_KEY ||
233+
process.env.COINBASE_COMMERCE_KEY
234+
? coinbaseCommercePlugin
235+
: null,
231236
].filter(Boolean),
232237
providers: [],
233238
actions: [],

examples/CoinbaseClient.ts

-386
This file was deleted.

packages/core/src/generation.ts

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

926926
const provider = runtime.modelProvider;
927927
const model = models[provider].model[modelClass];
928+
if (!model) {
929+
throw new Error(`Unsupported model class: ${modelClass}`);
930+
}
928931
const temperature = models[provider].settings.temperature;
929932
const frequency_penalty = models[provider].settings.frequency_penalty;
930933
const presence_penalty = models[provider].settings.presence_penalty;
@@ -933,7 +936,7 @@ export const generateObjectV2 = async ({
933936
const apiKey = runtime.token;
934937

935938
try {
936-
context = await trimTokens(context, max_context_length, modelClass);
939+
context = await trimTokens(context, max_context_length, "gpt-4o");
937940

938941
const modelOptions: ModelSettings = {
939942
prompt: context,

0 commit comments

Comments
 (0)