Skip to content

Commit

Permalink
Integrate coinbase plugin and test and get it working
Browse files Browse the repository at this point in the history
  • Loading branch information
monilpat committed Nov 22, 2024
1 parent 6d65551 commit 26fab78
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 938 deletions.
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@ai16z/plugin-node": "workspace:*",
"@ai16z/plugin-solana": "workspace:*",
"@ai16z/plugin-starknet": "workspace:*",
"@ai16z/plugin-coinbase": "workspace:*",
"readline": "^1.3.0",
"ws": "^8.18.0",
"yargs": "17.7.2"
Expand Down
5 changes: 5 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { nodePlugin } from "@ai16z/plugin-node";
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
import Database from "better-sqlite3";
import fs from "fs";
import readline from "readline";
Expand Down Expand Up @@ -228,6 +229,10 @@ export async function createAgent(
bootstrapPlugin,
nodePlugin,
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
character.settings.secrets?.COINBASE_COMMERCE_KEY ||
process.env.COINBASE_COMMERCE_KEY
? coinbaseCommercePlugin
: null,
].filter(Boolean),
providers: [],
actions: [],
Expand Down
386 changes: 0 additions & 386 deletions examples/CoinbaseClient.ts

This file was deleted.

5 changes: 4 additions & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ export const generateObjectV2 = async ({

const provider = runtime.modelProvider;
const model = models[provider].model[modelClass];
if (!model) {
throw new Error(`Unsupported model class: ${modelClass}`);
}
const temperature = models[provider].settings.temperature;
const frequency_penalty = models[provider].settings.frequency_penalty;
const presence_penalty = models[provider].settings.presence_penalty;
Expand All @@ -933,7 +936,7 @@ export const generateObjectV2 = async ({
const apiKey = runtime.token;

try {
context = await trimTokens(context, max_context_length, modelClass);
context = await trimTokens(context, max_context_length, "gpt-4o");

const modelOptions: ModelSettings = {
prompt: context,
Expand Down
Loading

0 comments on commit 26fab78

Please sign in to comment.