{"_id":"@ainulabs/ainu","_rev":"5-2b2292af0be952f889a75220d6b6989b","name":"@ainulabs/ainu","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@ainulabs/ainu","version":"0.0.1","keywords":["ai framework","@ainulabs/ai","agent framework"],"author":"","license":"ISC","_id":"@ainulabs/ainu@0.0.1","maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"homepage":"https://ainu.pro","bugs":{"url":"https://github.com/AINU-Framework/ainu/issues"},"dist":{"shasum":"1edaebe431edd3f056bd6693848de2739ce2ee37","tarball":"https://registry.npmjs.org/@ainulabs/ainu/-/ainu-0.0.1.tgz","fileCount":68,"integrity":"sha512-D59GPwnx9jX2iS5FTStkSz0N9E/qtGMJX3d6oMBoZb/w+Aqdxl7D9EJ1FZlmfOGh3uJSF5sJ5Db7LbXbDAhhOQ==","signatures":[{"sig":"MEUCIACQBzZgLzVOWqq+GsiEXGde0CxJIov03miiHPaC0FU2AiEAsR+Y+3oCWXjJhs+6nwtv1UltL3stz7RjCnvDv20qgkc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60188},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","gitHead":"3bf049fdc88c51eb16ce1cccbbf018ab82c6e9d6","scripts":{"dev":"node --import tsx --watch -r ts-node/register src/index.ts","docs":"typedoc --out docs --theme default --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --includeVersion src/index.ts","test":"jest","build":"rm -rf dist/ && tsc","start":"node dist/index.js","example":"node --import tsx src/example.ts","mock:mcp":"node --import tsx tests/mcp/mockMcpServer.ts","prestart":"npm run build","test:mcp":"jest --testPathPattern=tests/mcp","test:tools":"jest --testPathPattern=tests/tools","test:utils":"jest --testPathPattern=tests/utils","test:agents":"jest --testPathPattern=tests/agents","prepublishOnly":"npm run build && npm run docs","test:providers":"jest --testPathPattern=tests/providers"},"_npmUser":{"name":"0xgospel","email":"ainulabs123@gmail.com"},"repository":{"url":"git+https://github.com/AINU-Framework/ainu.git","type":"git"},"_npmVersion":"11.3.0","description":"A simple, light weight, and unopinionated ai framework.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"ai":"^4.3.9","zod":"3.24.3","@ai-sdk/xai":"^1.2.15","@ai-sdk/openai":"^1.3.17","@ai-sdk/provider":"^1.1.3","@ai-sdk/anthropic":"^1.2.10","@modelcontextprotocol/sdk":"^1.10.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","jest":"^29.7.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","typedoc":"^0.28.3","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","@tsconfig/node22":"^22.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ainu_0.0.1_1754042795169_0.13788661353295306","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@ainulabs/ainu","version":"0.0.2","keywords":["ai framework","@ainulabs/ai","agent framework"],"author":"","license":"ISC","_id":"@ainulabs/ainu@0.0.2","maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"homepage":"https://ainu.pro","bugs":{"url":"https://github.com/AINU-Framework/ainu/issues"},"dist":{"shasum":"00f3ff6f18a8fa53244a7da5339ad327cf006307","tarball":"https://registry.npmjs.org/@ainulabs/ainu/-/ainu-0.0.2.tgz","fileCount":68,"integrity":"sha512-D2ylwc/6FOF/aMVyXtlppHMsbEMqk3BmgLwrd4hgGLm4tBziGvTGc3pDh0LSW0KcIkZ9gSrLQGh5GstklngCuA==","signatures":[{"sig":"MEYCIQCXNzZJqhXB01BezPw3rnrZDQ3+pj0He/5uzue+vfSEGwIhAKK0hrj7AK2SYHcN0k+bPZiMvYaP+rsjYRAsDaXPotin","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62996},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","gitHead":"ce8cc47a900b721f5253a2b5db536c045f5b3da3","scripts":{"dev":"node --import tsx --watch -r ts-node/register src/index.ts","docs":"typedoc --out docs --theme default --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --includeVersion src/index.ts","test":"jest","build":"rm -rf dist/ && tsc","start":"node dist/index.js","mock:mcp":"node --import tsx tests/mcp/mockMcpServer.ts","prestart":"npm run build","test:mcp":"jest --testPathPattern=tests/mcp","test:tools":"jest --testPathPattern=tests/tools","test:utils":"jest --testPathPattern=tests/utils","test:agents":"jest --testPathPattern=tests/agents","prepublishOnly":"npm run build && npm run docs","test:providers":"jest --testPathPattern=tests/providers"},"_npmUser":{"name":"0xgospel","email":"ainulabs123@gmail.com"},"repository":{"url":"git+https://github.com/AINU-Framework/ainu.git","type":"git"},"_npmVersion":"11.3.0","description":"A simple, light weight, and unopinionated ai framework.","directories":{},"_nodeVersion":"23.10.0","dependencies":{"ai":"^4.3.9","zod":"3.24.3","@ai-sdk/xai":"^1.2.15","@ai-sdk/openai":"^1.3.17","@ai-sdk/provider":"^1.1.3","@ai-sdk/anthropic":"^1.2.10","@modelcontextprotocol/sdk":"^1.10.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","jest":"^29.7.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","typedoc":"^0.28.3","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","@tsconfig/node22":"^22.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ainu_0.0.2_1755725152429_0.7254904211083499","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@ainulabs/ainu","version":"0.0.3","keywords":["ainu","@ainulabs/ainu","ai framework","agent framework"],"author":"","license":"ISC","_id":"@ainulabs/ainu@0.0.3","maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"homepage":"https://ainu.pro","bugs":{"url":"https://github.com/AINU-Labs/ainu/issues"},"dist":{"shasum":"2d41a68bf3577c932a57397af0899ab30f2c1238","tarball":"https://registry.npmjs.org/@ainulabs/ainu/-/ainu-0.0.3.tgz","fileCount":68,"integrity":"sha512-Zpv9a5zDrKFuPABUyazUjOb4iEgrzHiKL73/8l6M0Igm67Ovisjd6wsNDtKq14Qzru4tyLBTSqD599MvQJdYUA==","signatures":[{"sig":"MEQCIChW+IeXEyXnawKwMwayhbKnh+cGox9BQq6cyDJkx3coAiAeqYu8+7f74Uk2TsWTrP6L7in++q5logPZEexqEXVMdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63001},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","gitHead":"b1efc19db2a2a363ee9fd60d1434a63f112f2bf7","scripts":{"dev":"node --import tsx --watch -r ts-node/register src/index.ts","docs":"typedoc --out docs --theme default --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --includeVersion src/index.ts","test":"jest","build":"rm -rf dist/ && tsc","start":"node dist/index.js","mock:mcp":"node --import tsx tests/mcp/mockMcpServer.ts","prestart":"npm run build","test:mcp":"jest --testPathPattern=tests/mcp","test:tools":"jest --testPathPattern=tests/tools","test:utils":"jest --testPathPattern=tests/utils","test:agents":"jest --testPathPattern=tests/agents","prepublishOnly":"npm run build && npm run docs","test:providers":"jest --testPathPattern=tests/providers"},"_npmUser":{"name":"0xgospel","email":"ainulabs123@gmail.com"},"repository":{"url":"git+https://github.com/AINU-Labs/ainu.git","type":"git"},"_npmVersion":"11.5.1","description":"A simple, light weight, and unopinionated ai framework.","directories":{},"_nodeVersion":"24.6.0","dependencies":{"ai":"^4.3.9","zod":"3.24.3","@ai-sdk/xai":"^1.2.15","@ai-sdk/openai":"^1.3.17","@ai-sdk/provider":"^1.1.3","@ai-sdk/anthropic":"^1.2.10","@modelcontextprotocol/sdk":"^1.10.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","jest":"^29.7.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","typedoc":"^0.28.3","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","@tsconfig/node22":"^22.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ainu_0.0.3_1755814318628_0.12436498893938652","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@ainulabs/ainu","version":"0.0.4","keywords":["ainu","@ainulabs/ainu","ai framework","agent framework"],"author":"","license":"ISC","_id":"@ainulabs/ainu@0.0.4","maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"homepage":"https://ainu.pro","bugs":{"url":"https://github.com/AINU-Labs/ainu/issues"},"dist":{"shasum":"7ef3b0a2d1ba61c00feb80279e3f79a57379367f","tarball":"https://registry.npmjs.org/@ainulabs/ainu/-/ainu-0.0.4.tgz","fileCount":71,"integrity":"sha512-L0Rm8E3iekT7taDs0nJPaW+wG1j+GILsMat4Yol8nUb9jDkz5WYcDQ7pNIhoZR3xx6ARDG/eufshJ7n7/+SFzw==","signatures":[{"sig":"MEYCIQCjZD1lOxA59zg0QM7cp/8Vbd/KqNisoPvPVq0UMPUFGAIhAOLTyTxcaS6alAAshpL9rhaPqSFMy9e2c0yaUM8JLy+D","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65412},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","gitHead":"89113d1086b1b488ca9503b7844313e6031ec84d","scripts":{"dev":"node --import tsx --watch -r ts-node/register src/index.ts","docs":"typedoc --out docs --theme default --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --includeVersion src/index.ts","build":"rm -rf dist/ && tsc","start":"node dist/index.js","tests":"jest","mock:mcp":"node --import tsx tests/mcp/mockMcpServer.ts","prestart":"npm run build","test:mcp":"jest --testPathPattern=tests/mcp","test:tools":"jest --testPathPattern=tests/tools","test:utils":"jest --testPathPattern=tests/util","test:agents":"jest --testPathPattern=tests/agents","prepublishOnly":"npm run build && npm run docs","test:providers":"jest --testPathPattern=tests/providers"},"_npmUser":{"name":"0xgospel","email":"ainulabs123@gmail.com"},"repository":{"url":"git+https://github.com/AINU-Labs/ainu.git","type":"git"},"_npmVersion":"11.5.1","description":"A simple, light weight, and unopinionated ai framework.","directories":{},"_nodeVersion":"24.6.0","dependencies":{"ai":"^4.3.9","zod":"^3.25.49","@ai-sdk/xai":"^1.2.15","@ai-sdk/openai":"^1.3.17","@ai-sdk/provider":"^1.1.3","qwen-ai-provider":"^0.1.1","@ai-sdk/anthropic":"^1.2.10","@modelcontextprotocol/sdk":"^1.10.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","jest":"^29.7.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","typedoc":"^0.28.3","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","@tsconfig/node22":"^22.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ainu_0.0.4_1755839850999_0.18603254494800026","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@ainulabs/ainu","version":"0.0.5","description":"A simple, light weight, and unopinionated ai framework.","license":"ISC","author":"","homepage":"https://ainu.pro","repository":{"type":"git","url":"git+https://github.com/AINU-Labs/ainu.git"},"bugs":{"url":"https://github.com/AINU-Labs/ainu/issues"},"type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"keywords":["ainu","@ainulabs/ainu","ai framework","agent framework"],"scripts":{"docs":"typedoc --out docs --theme default --tsconfig tsconfig.json --excludePrivate --excludeProtected --excludeExternals --includeVersion src/index.ts","build":"rm -rf dist/ && tsc","prestart":"npm run build","start":"node dist/index.js","dev":"node --import tsx --watch -r ts-node/register src/index.ts","prepublishOnly":"npm run build && npm run docs","tests":"jest","test:tools":"jest --testPathPattern=tests/tools","test:providers":"jest --testPathPattern=tests/providers","test:utils":"jest --testPathPattern=tests/util","test:agent":"jest --testPathPattern=tests/agent","test:mcp":"jest --testPathPattern=tests/mcp","mock:mcp":"node --import tsx tests/mcp/mockMcpServer.ts"},"devDependencies":{"@tsconfig/node22":"^22.0.1","@types/jest":"^29.5.14","@types/node":"^22.14.1","jest":"^29.7.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","tsx":"^4.19.3","typedoc":"^0.28.3","typescript":"^5.8.3"},"dependencies":{"@ai-sdk/anthropic":"^1.2.10","@ai-sdk/openai":"^1.3.17","@ai-sdk/provider":"^1.1.3","@ai-sdk/xai":"^1.2.15","@modelcontextprotocol/sdk":"^1.10.2","ai":"^4.3.9","qwen-ai-provider":"^0.1.1","zod":"^3.25.49"},"_id":"@ainulabs/ainu@0.0.5","gitHead":"8a4f1687c320145761a5a3108f20c1c4c8d1433b","_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-/UBrQDXICwU4NxZijMHoiIwHFo7ZXilfAuxC6AnwPtCsL61q0NrLvtVXdR4pYNBAXH+T7LzZpCLwv7ybKgnKtQ==","shasum":"4195e55d236ed68472da343ccf860fd8aaf936f1","tarball":"https://registry.npmjs.org/@ainulabs/ainu/-/ainu-0.0.5.tgz","fileCount":71,"unpackedSize":65600,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF+ry2TW78iz2eKCj8arw/QgIo9YY0QKuR8KHgdfY6myAiEAmp8ANTrPuId5d45xrwHbE3FkVHb8zFoEbdneaELlhSc="}]},"_npmUser":{"name":"0xgospel","email":"ainulabs123@gmail.com"},"directories":{},"maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ainu_0.0.5_1755847573975_0.866405624892078"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-01T10:06:34.749Z","modified":"2025-08-22T07:26:14.352Z","0.0.1":"2025-08-01T10:06:35.338Z","0.0.2":"2025-08-20T21:25:52.645Z","0.0.3":"2025-08-21T22:11:58.876Z","0.0.4":"2025-08-22T05:17:31.174Z","0.0.5":"2025-08-22T07:26:14.133Z"},"bugs":{"url":"https://github.com/AINU-Labs/ainu/issues"},"license":"ISC","homepage":"https://ainu.pro","keywords":["ainu","@ainulabs/ainu","ai framework","agent framework"],"repository":{"type":"git","url":"git+https://github.com/AINU-Labs/ainu.git"},"description":"A simple, light weight, and unopinionated ai framework.","maintainers":[{"name":"0xgospel","email":"ainulabs123@gmail.com"}],"readme":"# AINU\n\n![AINU Banner](public/ainubanner.png)\n\nAn unopinionated and easily extensible ai framework\n\n## Table of Contents\n\n- [📚 Documentation](#-documentation)\n- [⚙️ Installation](#️-installation)\n- [🚀 Getting Started](#-getting-started)\n  - [🛠️ Creating an Agent](#️-creating-an-agent)\n  - [💡 Basic Example](#-basic-example)\n  - [🧰 Tools](#-tools)\n  - [🔗 MCP Clients](#-mcp-clients)\n  - [🤖 Social Agent (WIP)](#-social-agent-wip)\n- [📝 Example Repositories](#-example-repositories)\n\n---\n\n## 📚 Documentation\n\nAINU provides comprehensive documentation to help you get started and dive deeper into the framework. Below is an overview of the available resources:\n\n| **Documentation Type** | **Description**                                                                                                                                                            | **Link**                                      |\n| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |\n| **TypeDocs**           | Detailed API reference generated from the source code. Includes all classes, methods, and types used in AINU. Ideal for developers looking for in-depth technical details. | [TypeDocs](https://ainu-labs.github.io/ainu/) |\n| **Overview Docs**      | High-level documentation covering concepts, examples, and guides for using AINU. Perfect for understanding the framework and its use cases.                                | [Overview Docs](https://docs.ainu.pro/)       |\n\n## ⚙️ Installation\n\n`ainu` can be added to your project through npm.\n\n```\nnpm i @ainulabs/ainu\n```\n\n## 🚀 Getting Started\n\n### 🛠️ Creating an Agent\n\nCreating an `Agent` is super simple and only requires a single `Provider` to be supplied.\n\n```typescript\nconst provider = new Anthropic({ apikey: \"your-api-key\" });\nconst agent = new Agent({ provider });\n```\n\n### 💡 Basic Example\n\nThe following code is like the `hello, world!` of he `ainu` framework.\n\n```typescript\nimport { Agent, Anthropic, Tool } from \"@ainu/ai\";\nimport { z } from \"zod\";\n\nasync function main() {\n  // create the model provider\n  const provider = new Anthropic({\n    apiKey: \"your-api-key\",\n  });\n\n  // create a simple tool\n  const weather = new Tool(\"getWeather\", {\n    description: \"Get the weather at a given location\",\n    parameters: z.object({ location: z.string() }),\n    handler: ({ location }) => 100,\n  });\n\n  // create the agent\n  const agent = new Agent({\n    provider,\n    tools: [tool],\n    settings: {\n      // optional agent settings\n      system: \"You are a helpful and charming assistant\",\n    },\n  });\n\n  // use the agent to generateText\n  const response = await agent.generateText({\n    prompt: \"Hello, how are you?\",\n    maxSteps: 3,\n  });\n\n  console.log(response.data?.text);\n}\n\nmain();\n```\n\n### 🧰 Tools\n\nTools can be provided in three ways:\n\n1. Through the constructor.\n2. By calling `.putTool` on an agent instance.\n3. By passing the `tools` parameter directly into a `.generateText` call.\n\nThe first two methods persist the tools in the agent's class, while the third method discards the tool after it is used.\n\n---\n\n#### Example 1: Providing Tools Through the Constructor\n\n```typescript\nimport z from \"zod\";\nimport { Agent } from \"./agent\";\nimport { Anthropic } from \"./providers\";\nimport { Tool } from \"./tools\";\n\nconst populationTool = new Tool(\"getPopulation\", {\n  description: \"Get the population of any location\",\n  parameters: z.object({\n    location: z.string(),\n  }),\n  handler: async (args) => {\n    // call some external system\n    return { population: 1000000 };\n  },\n});\n\nconst agent = new Agent({\n  provider: new Anthropic({\n    apiKey: \"your-api-key\",\n  }),\n  tools: [populationTool], // Add tools during agent creation\n});\n```\n\n---\n\n#### Example 2: Adding Tools Dynamically Using `.putTool`\n\n```typescript\nimport z from \"zod\";\nimport { Agent } from \"./agent\";\nimport { Anthropic } from \"./providers\";\nimport { Tool } from \"./tools\";\n\nconst populationTool = new Tool(\"getPopulation\", {\n  description: \"Get the population of any location\",\n  parameters: z.object({\n    location: z.string(),\n  }),\n  handler: async (args) => {\n    // call some external system\n    return { population: 1000000 };\n  },\n});\n\nconst agent = new Agent({\n  provider: new Anthropic({\n    apiKey: \"your-api-key\",\n  }),\n});\n\n// Add the tool dynamically\nagent.putTool(populationTool);\n```\n\n---\n\n#### Example 3: Passing Tools Directly to `.generateText`\n\n```typescript\nimport z from \"zod\";\nimport { Agent } from \"./agent\";\nimport { Anthropic } from \"./providers\";\nimport { Tool } from \"./tools\";\n\nconst populationTool = new Tool(\"getPopulation\", {\n  description: \"Get the population of any location\",\n  parameters: z.object({\n    location: z.string(),\n  }),\n  handler: async (args) => {\n    // call some external system\n    return { population: 1000000 };\n  },\n});\n\nconst agent = new Agent({\n  provider: new Anthropic({\n    apiKey: \"your-api-key\",\n  }),\n});\n\n// Use the tool directly in a generateText call\nconst result = await agent.generateText({\n  prompt: \"What is the population of the US?\",\n  tools: [populationTool], // Pass tools directly\n});\n```\n\n---\n\nThese examples demonstrate the flexibility of tools in AINU. You can choose the method that best fits your use case, whether it's adding tools during agent creation, dynamically adding them later, or using them for specific tasks on the fly.\n\n### 🔗 MCP Clients\n\nYou may also wish to supply your agent with access to an MCP server.\n\n```typescript\nimport { Agent, Anthropic, MCP } from \"@ainu/ai\";\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport path from \"path\";\n\n// Create a MCP instances and pass in the name, version and transport\nconst solanaMcpClient = new MCP({\n  name: \"Solana MCP Client\",\n  version: \"1.0.0\",\n  transport: new StdioClientTransport({\n    command: \"node\",\n    args: [\"dist/mcp/server.js\"],\n  }),\n});\n\n// Add one or more clients to your agent.\nexport const agent = new Agent({\n  settings: {\n    system: \"You are a helpful assistant.\",\n    maxSteps: 5,\n  },\n  provider: new Anthropic({\n    apiKey: \"your-api-key\",\n  }),\n  clients: [solanaMcpClient],\n});\n```\n\n## 🤖 Social Agent (WIP)\n\nThis is just an example and none of the twitter functionality is actually complete here.\nI will create a seprate registry tools.\n\n```typescript\nimport { Agent, Anthropic, Tool } from \"@ainu/ai\";\nimport { input } from \"@inquirer/prompts\";\nimport \"dotenv/config\";\nimport z from \"zod\";\n\n// Prep the tiny agent\nconst anthropic = new Anthropic({\n  apiKey: process.env.ANTHROPIC_API_KEY,\n});\n\nconst agent = new Agent({\n  provider: anthropic,\n  settings: {\n    maxSteps: 5 //required for the agent to chain tool calls and inference\n  }\n});\n\n// create a loading function that gets all information relevant for to the agent\nfunction mockLoadContext() {\n  return {\n    Name: \"Artificial Inu\",\n    Age: 5,\n    Location: \"Solana\",\n    Interests: [\"AI\", \"Blockchain\", \"Web3\"],\n    FavoriteColor: \"Blue\",\n    FavoriteFood: \"Pizza\",\n    mentions: [\n      { from: \"user1\", text: \"Hello, how are you?\" },\n      { from: \"user2\", text: \"What is your favorite color?\" },\n      { from: \"user3\", text: \"Do you like pizza?\" },\n    ],\n    recentTweets: [\n      { text: \"Just had a great pizza!\", date: \"2023-10-01\" },\n      { text: \"Loving the new AI features!\", date: \"2023-10-02\" },\n      { text: \"Blockchain is the future!\", date: \"2023-10-03\" },\n    ],\n  };\n}\n\nconst loadContext = new Tool(\"loadContext\", {\n  description:\n    \"Load the context before writing a tweet. Must be called before calling 'tweet'. Return the context as a string.\",\n  handler: () => ({ context: formatContext(mockLoadContext()) }),\n});\n\n// add the tool to the agent\nagent.putTool(loadContext);\n\n// create a tool that posts tweets. Here you would use the twitter-sdk\nconst tweet = new Tool(\"tweet\", {\n  description: \"Post a tweet to Twitter. \",\n  parameters: z.object({\n    context: z.string();\n  }),\n  handler: async ({context}) => {\n    const generateTweet = agent.generateText({\n      prompt: `${context}\n      # Task\n      Your task is to generate compelling tweets based on all the information above`,\n      maxSteps: 5,\n      temperature: 0.7,\n    });\n  },\n});\n\n// Add the tool to the agent\nagent.putTool(tweet);\n\nasync function main() {\n  // Here if you ask the agent to write a tweet it will call the tweet tool\n  const userMessage = await input({\n    message: \"You: \",\n    validate: (input) => {\n      return input.trim() !== \"\" ? true : \"Please enter a message.\";\n    },\n  });\n\n  const response = await agent.generateText({\n    prompt: userMessage,\n  });\n\n  // Check if the response is valid\n  if (!response || !response.success) {\n    console.error(\"Error:\", response.error);\n    return;\n  }\n\n  console.log(`Agent: ${response.data?.text}`);\n}\n\nmain();\n```\n\n## 📝 Example Repositories\n\nExample Repo's will be added to a list below.\n","readmeFilename":"README.md"}