JSPM

@tokenomiapro/agentkit-langchain

0.3.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q65249F
  • License Apache-2.0

Langchain Toolkit extension of CDP Agentkit

Package Exports

  • @tokenomiapro/agentkit-langchain
  • @tokenomiapro/agentkit-langchain/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tokenomiapro/agentkit-langchain) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Agentkit Extension - LangChain

LangChain extension of AgentKit. Enables agentic workflows to interact with onchain actions.

Setup

Prerequisites

Installation

npm install @coinbase/agentkit-langchain @coinbase/agentkit @langchain @langchain/langgraph @langchain/openai

Environment Setup

Set the following environment variables:

export OPENAI_API_KEY=<your-openai-api-key>

Usage

Basic Setup

import { getLangChainTools } from "@coinbase/agentkit-langchain";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { ChatOpenAI } from "@langchain/openai";
import { AgentKit } from "@coinbase/agentkit";

const agentKit = await AgentKit.from({
  cdpApiKeyName: "CDP API KEY NAME",
  cdpApiKeyPrivateKey: "CDP API KEY PRIVATE KEY",
});

const tools = await getLangChainTools(agentKit);

const llm = new ChatOpenAI({
    model: "gpt-4o-mini",
});

const agent = createReactAgent({
    llm,
    tools,
});

Contributing

See CONTRIBUTING.md for detailed setup instructions and contribution guidelines.