Skip to content

Commit

Permalink
Merge branch 'main' into filipposl/coingecko-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
aigustin authored Dec 6, 2024
2 parents 1cc24e9 + 998a9c5 commit 398cb3a
Show file tree
Hide file tree
Showing 124 changed files with 2,505 additions and 3,346 deletions.
71 changes: 71 additions & 0 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Setup Node.js, PNPM, and install dependencies"

inputs:
node-version:
description: "Node.js version to use"
required: false
default: 20.12.2
pnpm-version:
description: "PNPM version to use"
required: false
default: 9.14.2
skip-install:
description: "Skip 'pnpm install'"
required: false
default: false
install-args:
description: "Additional args supplied to 'pnpm install'"
required: false
working-directory:
description: "Working directory to run the command in"
required: false
default: ./typescript

runs:
using: "composite"

steps:
- name: Log inputs
shell: bash
run: |
echo "Node.js version: ${{ inputs.node-version }}"
echo "PNPM version: ${{ inputs.pnpm-version }}"
echo "Skip install: ${{ inputs.skip-install }}"
echo "Install args: ${{ inputs.install-args }}"
echo "Working directory: ${{ inputs.working-directory }}"
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- id: pnpm-config
if: inputs.skip-install == 'false'
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- id: cache-rotation
shell: bash
if: inputs.skip-install == 'false'
run: |
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
if: inputs.skip-install == 'false'
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
- name: Install dependencies
shell: bash
if: inputs.skip-install == 'false'
working-directory: ${{ inputs.working-directory }}
run: pnpm install --frozen-lockfile --prefer-offline ${{ inputs.install-args }}
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:

jobs:
build-and-test:
name: build & test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js, PNPM, and install dependencies
uses: ./.github/actions/pnpm-install

- name: Build all
working-directory: ./typescript
run: pnpm build

- name: Test all
working-directory: ./typescript
run: pnpm test
4 changes: 4 additions & 0 deletions goat.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"name": "🐐 GOAT",
"path": "."
},
{
"name": "📘 Typescript",
"path": "./typescript"
},
{
"name": "🌋 Core",
"path": "./typescript/packages/core"
Expand Down
58 changes: 30 additions & 28 deletions typescript/biome.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["dist/**/*"]
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["dist/**/*"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 120
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
/* config options here */
};

export default nextConfig;
58 changes: 28 additions & 30 deletions typescript/examples/eleven-labs/conversational-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{
"name": "conversational-agent",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@11labs/react": "^0.0.4",
"@goat-sdk/adapter-eleven-labs": "0.1.2",
"@goat-sdk/core": "0.3.10",
"@goat-sdk/wallet-viem": "0.1.3",
"@tanstack/react-query": "^5.62.2",
"connectkit": "^1.8.2",
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"viem": "^2.21.49",
"wagmi": "^2.13.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
"name": "conversational-agent",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@11labs/react": "^0.0.4",
"@goat-sdk/adapter-eleven-labs": "0.1.2",
"@goat-sdk/core": "0.3.10",
"@goat-sdk/wallet-viem": "0.1.3",
"@tanstack/react-query": "^5.62.2",
"connectkit": "^1.8.2",
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"viem": "^2.21.49",
"wagmi": "^2.13.3"
},
"devDependencies": {
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
plugins: {
tailwindcss: {},
},
};

export default config;
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";

import { useConversation } from "@11labs/react";
import { useCallback } from "react";
import { getOnChainTools } from "@goat-sdk/adapter-eleven-labs";
import { useCallback } from "react";

import { viem } from "@goat-sdk/wallet-viem";
import { useAccount, useWalletClient } from "wagmi";
import { ConnectKitButton } from "connectkit";
import { useAccount, useWalletClient } from "wagmi";
import { sendETH } from "../../../../../../packages/core/dist/plugins/send-eth";

export function Conversation() {
Expand Down Expand Up @@ -57,16 +57,12 @@ export function Conversation() {
<h1 className="text-2xl font-bold">1. Connect Wallet to start</h1>
<ConnectKitButton />

<h1 className="text-2xl font-bold">
2. Start Conversation with Agent
</h1>
<h1 className="text-2xl font-bold">2. Start Conversation with Agent</h1>
<div className="flex flex-col items-center gap-4">
<div className="flex gap-2">
<button
onClick={startConversation}
disabled={
conversation.status === "connected" || !isConnected
}
disabled={conversation.status === "connected" || !isConnected}
className="px-4 py-2 bg-blue-500 text-white rounded disabled:bg-gray-300"
type="button"
>
Expand All @@ -85,10 +81,7 @@ export function Conversation() {
<div className="flex flex-col items-center">
<p>Status: {conversation.status}</p>
{conversation.status === "connected" && (
<p>
Agent is{" "}
{conversation.isSpeaking ? "speaking" : "listening"}
</p>
<p>Agent is {conversation.isSpeaking ? "speaking" : "listening"}</p>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
<Web3Provider>{children}</Web3Provider>
</body>
</html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm">
<h1 className="text-4xl font-bold mb-8 text-center">
GOAT 🐐 Conversational AI
</h1>
<h1 className="text-4xl font-bold mb-8 text-center">GOAT 🐐 Conversational AI</h1>
<Conversation />
</div>
</main>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import { WagmiProvider, createConfig, http } from "wagmi";
import { sepolia } from "wagmi/chains";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ConnectKitProvider, getDefaultConfig } from "connectkit";
import { http, WagmiProvider, createConfig } from "wagmi";
import { sepolia } from "wagmi/chains";

const config = createConfig(
getDefaultConfig({
Expand All @@ -15,12 +15,11 @@ const config = createConfig(
},

// Required API Keys
walletConnectProjectId:
process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?? "",
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?? "",

// Required App Info
appName: "GOAT Conversational AI",
})
}),
);

const queryClient = new QueryClient();
Expand Down
Loading

0 comments on commit 398cb3a

Please sign in to comment.