Skip to content

Commit

Permalink
chore: update example readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRAG committed Feb 5, 2025
1 parent 5110bf7 commit 5ff1f78
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 62 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,23 @@ AgentKit is [Coinbase Developer Platform's](https://docs.cdp.coinbase.com) frame
# Clone the repository
git clone https://github.com/coinbase/agentkit.git

# Navigate to the langchain-cdp-chatbot example
cd agentkit/typescript/examples/langchain-cdp-chatbot

# At this point, fill in your CDP API key name, private key, and OpenAI API key in
# the .env.example file.
# Then, rename the .env.example file to .env
mv .env.example .env
# Navigate to the root of the repo
cd agentkit

# Install dependencies
npm install

# Build the packages locally
npm run build

# Navigate to the langchain-cdp-chatbot example
cd typescript/examples/langchain-cdp-chatbot

# At this point, fill in your CDP API key name, private key, and OpenAI API key in
# the .env.local file.
# Then, rename the .env.local file to .env
mv .env.local .env

# Run the chatbot
npm run start
```
Expand Down
44 changes: 29 additions & 15 deletions typescript/examples/langchain-cdp-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,55 @@ This example demonstrates an agent setup as a terminal style chatbot with access
- "Deploy an NFT that will go super viral!"
- "Deploy an ERC-20 token with total supply 1 billion"

## Requirements

- Node.js 18+
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
## Prerequisites

### Checking Node Version

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:

```bash
node --version
npm --version
```

## Installation
If you don't have the correct version, you can install it using [nvm](https://github.com/nvm-sh/nvm):

```bash
npm install
nvm install node
```

## Run the Chatbot
This will automatically install and use the latest version of Node.

### API Keys

You'll need the following API keys:
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)

Once you have them, rename the `.env-local` file to `.env` and make sure you set the API keys to their corresponding environment variables:

### Set ENV Vars
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "OPENAI_API_KEY"

- Ensure the following ENV Vars are set in `.env`:
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "OPENAI_API_KEY"
- "NETWORK_ID" (Defaults to `base-sepolia`)
## Running the example

From the root directory, run:

```bash
npm install
npm run build
```

This will install the dependencies and build the packages locally. The chatbot example uses the local `@coinbase/agentkit-langchain` and `@coinbase/agentkit` packages. If you make changes to the packages, you can run `npm run build` from root again to rebuild the packages, and your changes will be reflected in the chatbot example.

Now from the `typescript/examples/langchain-cdp-chatbot` directory, run:

```bash
npm start
```

Select "1. chat mode" and start telling your Agent to do things onchain!

## License

Apache-2.0
55 changes: 36 additions & 19 deletions typescript/examples/langchain-farcaster-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@ This example demonstrates an agent setup as a terminal style chatbot with access
## Ask the chatbot to engage in the onchain ecosystem!
- "Please send a cast for me to Farcaster"

## Requirements
## Prerequisites

- Node.js 18+
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
- [Farcaster API Keys via Neynar](https://dev.neynar.com/)
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
### Checking Node Version

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:

```bash
node --version
```

If you don't have the correct version, you can install it using [nvm](https://github.com/nvm-sh/nvm):

```bash
nvm install node
```

### Farcaster Application Setup

1. Visit the Neynar [Developer Portal](https://dev.neynar.com/)
2. Navigate to your application
3. Copy the API key.
Expand All @@ -23,30 +33,37 @@ This example demonstrates an agent setup as a terminal style chatbot with access
8. Copy the signer UUID.
9. Set the copied UUID value in .env as your `NEYNAR_MANAGED_SIGNER`.

### Checking Node Version
### API Keys

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:
You'll need the following API keys:
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
- [Farcaster API Keys via Neynar](https://dev.neynar.com/)

```bash
node --version
npm --version
```
Once you have them, rename the `.env-local` file to `.env` and make sure you set the API keys to their corresponding environment variables:

- "OPENAI_API_KEY"
- "NEYNAR_API_KEY"
- "NEYNAR_MANAGED_SIGNER"

## Installation
## Running the example

From the root directory, run:

```bash
npm install
npm run build
```

## Run the Chatbot
This will install the dependencies and build the packages locally. The chatbot example uses the local `@coinbase/agentkit-langchain` and `@coinbase/agentkit` packages. If you make changes to the packages, you can run `npm run build` from root again to rebuild the packages, and your changes will be reflected in the chatbot example.

Ensure the following vars are set in .env:
- "OPENAI_API_KEY"
- "NEYNAR_API_KEY"
- "NEYNAR_MANAGED_SIGNER"
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
Now from the `typescript/examples/langchain-farcaster-chatbot` directory, run:

```bash
npm start
```

Select "1. chat mode" and start telling your Agent to do things onchain!

## License

Apache-2.0
60 changes: 39 additions & 21 deletions typescript/examples/langchain-twitter-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ This example demonstrates an agent setup as a terminal style chatbot with access
- "Please get my mentions"
- "Please post responses to my mentions"

## Requirements
## Prerequisites

- Node.js 18+
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
- [Twitter (X) API Keys](https://developer.x.com/en/portal/dashboard)
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
### Checking Node Version

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:

```bash
node --version
```

If you don't have the correct version, you can install it using [nvm](https://github.com/nvm-sh/nvm):

```bash
nvm install node
```

### Twitter Application Setup

1. Visit the Twitter (X) [Developer Portal](https://developer.x.com/en/portal/dashboard)
2. Navigate to your project
3. Navigate to your application
Expand All @@ -27,32 +37,40 @@ This example demonstrates an agent setup as a terminal style chatbot with access
9. Navigate to "Keys and tokens"
10. Regenerate all keys and tokens

### Checking Node Version

Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:
### API Keys

```bash
node --version
npm --version
```

## Installation

```bash
npm install
```
You'll need the following API keys:
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
- [Twitter (X) API Keys](https://developer.x.com/en/portal/dashboard)

## Run the Chatbot
Once you have them, rename the `.env-local` file to `.env` and make sure you set the API keys to their corresponding environment variables:

Ensure the following vars are set in .env:
- "OPENAI_API_KEY"
- "TWITTER_ACCESS_TOKEN"
- "TWITTER_ACCESS_TOKEN_SECRET"
- "TWITTER_API_KEY"
- "TWITTER_API_SECRET"
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"

## Running the example

From the root directory, run:

```bash
npm install
npm run build
```

This will install the dependencies and build the packages locally. The chatbot example uses the local `@coinbase/agentkit-langchain` and `@coinbase/agentkit` packages. If you make changes to the packages, you can run `npm run build` from root again to rebuild the packages, and your changes will be reflected in the chatbot example.

Now from the `typescript/examples/langchain-twitter-chatbot` directory, run:

```bash
npm start
```

Select "1. chat mode" and start telling your Agent to do things onchain!

## License

Apache-2.0

0 comments on commit 5ff1f78

Please sign in to comment.