Skip to content

Commit c33f8f7

Browse files
authored
feat: dynamic example (#27)
1 parent bf161b7 commit c33f8f7

23 files changed

+9657
-3645
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NEXT_PUBLIC_ELEVEN_LABS_AGENT_ID=
2+
NEXT_PUBLIC_SEPOLIA_RPC_URL=
3+
NEXT_PUBLIC_COINGECKO_API_KEY=
4+
NEXT_PUBLIC_DYNAMIC_ENVIRONMENT_ID=
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
32+
# env files (can opt-in for committing if needed)
33+
.env*
34+
35+
# vercel
36+
.vercel
37+
38+
# typescript
39+
*.tsbuildinfo
40+
next-env.d.ts
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# conversational-agent
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [f5ea302]
8+
- Updated dependencies [e61b658]
9+
- @goat-sdk/wallet-viem@0.1.4
10+
- @goat-sdk/core@0.3.11
11+
- @goat-sdk/adapter-eleven-labs@0.1.3
12+
- @goat-sdk/plugin-coingecko@0.1.1
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Dynamic + Eleven Labs Conversational Agent Example
2+
3+
This example uses the ElevenLabs base project described [here](https://elevenlabs.io/docs/conversational-ai/guides/conversational-ai-guide-nextjs) and follows the steps to add client tool calling described [here](https://elevenlabs.io/docs/conversational-ai/customization/client-tools) as well as the Dynamic SDK to connect to the wallet and handle network switching etc.
4+
5+
Video demo: https://www.loom.com/share/5a89a3fc47a54df18ab051901bf7cc9b
6+
7+
## Setup
8+
9+
1. Copy the `.example.env` and populate with your values.
10+
11+
```
12+
cp .example.env .env
13+
```
14+
15+
2. Create an ElevenLabs agent and get the agent ID. You can follow this guide: https://elevenlabs.io/docs/conversational-ai/docs/agent-setup
16+
17+
3. Set the `NEXT_PUBLIC_ELEVEN_LABS_AGENT_ID` environment variable with the agent ID.
18+
19+
4. ElevenLabs requires you to register each tool manually through the ElevenLabs dashboard. To make it easier, we've added a `logTools` option to the `getOnChainTools` function. This will log the tools with their respective descriptions and parameters to the console.
20+
21+
```typescript
22+
const tools = await getOnChainTools({
23+
wallet: viem(wallet),
24+
options: {
25+
logTools: true,
26+
},
27+
});
28+
```
29+
30+
5. Run the app with `pnpm dev`, connect your wallet, and start the conversation!
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
};
6+
7+
export default nextConfig;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "dynamic-conversational-agent",
3+
"version": "0.1.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@11labs/react": "^0.0.4",
13+
"@dynamic-labs/ethereum": "^3.0.0",
14+
"@dynamic-labs/sdk-react-core": "^3.0.0",
15+
"@dynamic-labs/wagmi-connector": "3.9.0",
16+
"@goat-sdk/adapter-eleven-labs": "workspace:*",
17+
"@goat-sdk/core": "workspace:*",
18+
"@goat-sdk/plugin-coingecko": "workspace:*",
19+
"@goat-sdk/wallet-viem": "workspace:*",
20+
"@tanstack/react-query": "^5.62.2",
21+
"next": "15.0.3",
22+
"react": "^18.0.0",
23+
"react-dom": "^18.0.0",
24+
"viem": "^2.21.49",
25+
"wagmi": "^2.13.3"
26+
},
27+
"devDependencies": {
28+
"@types/react": "^18",
29+
"@types/react-dom": "^18",
30+
"postcss": "^8",
31+
"tailwindcss": "^3.4.1"
32+
}
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
};
7+
8+
export default config;
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)