├── gpt4free-openai-proxy
├── __init__.py
└── main.py
├── interface
├── src
│ ├── pages
│ │ ├── index.tsx
│ │ ├── _document.tsx
│ │ ├── _app.tsx
│ │ └── api
│ │ │ └── run_agent.ts
│ ├── styles
│ │ └── globals.css
│ ├── fonts
│ │ └── Archivo-Variable.ttf
│ ├── utils
│ │ └── address.ts
│ ├── components
│ │ ├── NoSSR.ts
│ │ ├── Portal.ts
│ │ ├── GlobalStyle.tsx
│ │ └── Input.tsx
│ ├── home
│ │ ├── components
│ │ │ ├── ToolMessage.tsx
│ │ │ ├── ThinkingMessage.tsx
│ │ │ ├── GoalMessage.tsx
│ │ │ └── AgentMessage.tsx
│ │ ├── types
│ │ │ └── events.ts
│ │ ├── constants.tsx
│ │ └── HomePage.tsx
│ └── hooks
│ │ └── useLocalStorage.ts
├── public
│ ├── favicon.ico
│ ├── assets
│ │ ├── eth.png
│ │ ├── uni.png
│ │ ├── weth.png
│ │ ├── agent.png
│ │ ├── matic.png
│ │ └── cryptogpt-logo.svg
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── apple-touch-icon.png
│ ├── android-chrome-192x192.png
│ ├── android-chrome-512x512.png
│ └── site.webmanifest
├── postcss.config.js
├── next-env.d.ts
├── tailwind.config.js
├── tsconfig.json
├── next.config.js
└── package.json
├── cryptogpt
├── src
│ ├── tools
│ │ ├── index.ts
│ │ ├── SerperAPISearchTool.ts
│ │ └── tools.ts
│ ├── index.ts
│ ├── config.ts
│ └── agent
│ │ ├── index.ts
│ │ ├── tokens.ts
│ │ ├── jsonutils.ts
│ │ ├── parser.ts
│ │ ├── async_caller.ts
│ │ └── cryptogpt.ts
├── tsconfig.json
└── package.json
├── .github
├── home.png
├── logo.png
├── demo-1.png
└── demo-2.png
├── .vscode
├── extensions.json
└── settings.json
├── .yarnrc.yml
├── .gitmodules
├── .env.example
├── .prettierignore
├── .prettierrc.js
├── package.json
├── .gitignore
├── README.md
└── LICENSE
/gpt4free-openai-proxy/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/interface/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | export { default } from '@/home/HomePage';
2 |
--------------------------------------------------------------------------------
/cryptogpt/src/tools/index.ts:
--------------------------------------------------------------------------------
1 | export { createCryptoGPTTools } from './tools';
2 |
--------------------------------------------------------------------------------
/.github/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/.github/home.png
--------------------------------------------------------------------------------
/.github/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/.github/logo.png
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["esbenp.prettier-vscode"]
3 | }
4 |
--------------------------------------------------------------------------------
/.github/demo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/.github/demo-1.png
--------------------------------------------------------------------------------
/.github/demo-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/.github/demo-2.png
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 |
3 | yarnPath: .yarn/releases/yarn-3.6.0.cjs
4 |
--------------------------------------------------------------------------------
/interface/src/styles/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "gpt4free"]
2 | path = gpt4free
3 | url = https://github.com/xtekky/gpt4free
4 |
--------------------------------------------------------------------------------
/cryptogpt/src/index.ts:
--------------------------------------------------------------------------------
1 | export { runAgent } from './agent';
2 | export { type Config } from './config';
3 |
--------------------------------------------------------------------------------
/interface/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/favicon.ico
--------------------------------------------------------------------------------
/interface/public/assets/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/assets/eth.png
--------------------------------------------------------------------------------
/interface/public/assets/uni.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/assets/uni.png
--------------------------------------------------------------------------------
/interface/public/assets/weth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/assets/weth.png
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | OPENAI_API_KEY=
2 | SERPER_API_KEY=
3 | WALLET_PRIVATE_KEY=
4 | OPENAI_API_BASE_PATH=
5 | JSON_RPC_URL=
6 |
--------------------------------------------------------------------------------
/interface/public/assets/agent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/assets/agent.png
--------------------------------------------------------------------------------
/interface/public/assets/matic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/assets/matic.png
--------------------------------------------------------------------------------
/interface/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/favicon-16x16.png
--------------------------------------------------------------------------------
/interface/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/favicon-32x32.png
--------------------------------------------------------------------------------
/interface/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/interface/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/interface/src/fonts/Archivo-Variable.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/src/fonts/Archivo-Variable.ttf
--------------------------------------------------------------------------------
/interface/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/interface/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/junhoyeo/CryptoGPT/HEAD/interface/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .vscode
2 |
3 | .next
4 | .vercel
5 |
6 | # Yarn
7 | .yarn
8 | .pnp.cjs
9 | .pnp.loader.mjs
10 |
11 | *.md
12 | !README.md
13 |
--------------------------------------------------------------------------------
/interface/src/utils/address.ts:
--------------------------------------------------------------------------------
1 | export const shortenAddress = (address: string, size: number = 4) => {
2 | return `${address.substring(0, 2 + size)}...${address.substring(address.length - size)}`;
3 | };
4 |
--------------------------------------------------------------------------------
/cryptogpt/src/config.ts:
--------------------------------------------------------------------------------
1 | export type Config = {
2 | OPENAI_API_KEY: string;
3 | OPENAI_API_BASE_PATH?: string;
4 | SERPER_API_KEY: string;
5 | JSON_RPC_URL: string;
6 | WALLET_PRIVATE_KEY: string;
7 | };
8 |
--------------------------------------------------------------------------------
/interface/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
13 | {event.goal}
23 |{shortenAddress('0x043c471bEe060e00A56CcD02c0Ca286808a5A436')}. ABI is{' '}
37 | {`{"inputs":[], "name":"deposit", "outputs":[], ...}`}.
38 | >
39 | ),
40 | prompt:
41 | 'Wrap 1 ETH to WETH deployed to 0x043c471bEe060e00A56CcD02c0Ca286808a5A436. ABI is {"constant":false,"inputs":[],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"}.',
42 | },
43 | {
44 | display: (
45 | <>
46 | Swap{' '}
47 |
48 | {shortenAddress('0xAbc12345Def67890FEdcBa09876E543210FeDcBa')}.
59 | {/* FIXME: Change fake address lol */}
60 | >
61 | ),
62 | prompt:
63 | 'Swap 0.1 ETH to MATIC with UniswapRouterV2 deployed in 0xAbc12345Def67890FEdcBa09876E543210FeDcBa.',
64 | },
65 | ];
66 |
--------------------------------------------------------------------------------
/cryptogpt/src/tools/SerperAPISearchTool.ts:
--------------------------------------------------------------------------------
1 | import { SerperParameters, Tool } from 'langchain/tools';
2 |
3 | type SerperAPIResponse = {
4 | searchParameters: {
5 | q: string;
6 | gl: string;
7 | hl: string;
8 | num: number;
9 | autocorrect: boolean;
10 | page: number;
11 | type: 'search';
12 | };
13 | searchInformation?: {
14 | didYouMean: string;
15 | };
16 | answerBox?: {
17 | title: string;
18 | answer: string;
19 | };
20 | organic?: {
21 | title: string;
22 | link: string;
23 | snippet: string;
24 | position: number;
25 | }[];
26 | };
27 |
28 | type SerperAPISearchToolParameters = SerperParameters & {
29 | organicMaxLength?: number;
30 | };
31 |
32 | export class SerperAPISearchTool extends Tool {
33 | toJSON() {
34 | return this.toJSONNotImplemented();
35 | }
36 |
37 | protected key: string;
38 |
39 | protected params: Partial🤖 LLMs 🏦 Financial Autonomy
7 |
34 | {event.text}
59 | ) : ( 60 | <> 61 |{event.thoughts.reasoning}
62 | {event?.command?.name !== 'finish' && ( 63 || {key} | 74 |
75 | {(() => {
76 | if (key === 'value') {
77 | return (
78 |
79 |
87 |
88 | {(Number(value) / 10 ** 18).toLocaleString()}
89 |
90 | ETH
91 |
92 | );
93 | }
94 | if (typeof value !== 'string') {
95 | return JSON.stringify(value);
96 | }
97 | if (value.length === 42 && value.startsWith('0x')) {
98 | return shortenAddress(value);
99 | }
100 | return value;
101 | })()}
102 | |
103 |
|---|
152 | An experiment by{' '}
153 |
154 |
for