{"_id":"@apgolubev/gpt-agent","name":"@apgolubev/gpt-agent","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apgolubev/gpt-agent","version":"0.1.0","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"start":"npm run npm:preview && tsx examples/gpt-terminal.ts","build":"tsc","npm:preview":"npm run build && mkdir -p preview && npm pack && tar -xvzf *.tgz -C preview && rm -rf node_modules/gpt-agent && mv preview/package node_modules/gpt-agent && rm -rf preview && rm gpt-agent-*.tgz"},"author":{"name":"Aleksandr Golubev https://github.com/apgolubev"},"license":"MIT","dependencies":{"@types/pako":"^2.0.3","openai":"^4.95.0","pako":"^2.1.0"},"devDependencies":{"tsx":"^4.19.3","typescript":"^5.0.0"},"gitHead":"0f52668752ecef7ce6396684b9833909cc5afbe4","description":"A TypeScript template for a GPT agent to quickly get started. With this, you can create an Agent or Copilot for your application or project in just a couple of clicks!","_id":"@apgolubev/gpt-agent@0.1.0","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-fhZLosCixJmzpIyfxm2jq+NZQFU2AsD6KdsT8pYEKnflWMdXvP2B2+GMdv6ouitsxqjIXO++tKwg+6CfGY15Nw==","shasum":"cd6bcdefb53f471c78caf4c187bb8742157f8a0c","tarball":"https://registry.npmjs.org/@apgolubev/gpt-agent/-/gpt-agent-0.1.0.tgz","fileCount":13,"unpackedSize":20450,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDBphgty6/NpA1Qm10UX4N6nR70KSKpzrfKqE0tm5NJMAiEA0Ct03/qvxhet3B6Dy5hjec28Ajn6lgNFKHGvzZ5KmO8="}]},"_npmUser":{"name":"apgolubev","email":"golubev.cto@gmail.com"},"directories":{},"maintainers":[{"name":"apgolubev","email":"golubev.cto@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gpt-agent_0.1.0_1745504914567_0.6959829255187724"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-24T14:28:34.453Z","0.1.0":"2025-04-24T14:28:34.777Z","modified":"2025-04-24T14:28:35.023Z"},"maintainers":[{"name":"apgolubev","email":"golubev.cto@gmail.com"}],"description":"A TypeScript template for a GPT agent to quickly get started. With this, you can create an Agent or Copilot for your application or project in just a couple of clicks!","author":{"name":"Aleksandr Golubev https://github.com/apgolubev"},"license":"MIT","readme":"# Node.js GPT Agent (OpenAI Assistant), MCP Platform Template\n\nA TypeScript template for a GPT agent to quickly get started. With this, you can create an Agent or Copilot for your application or project in just a couple of clicks!\n\nA standalone agent designed for rapid integration into any JS application or server, optimized for minimal token costs. \n\n#### Deploy\nIt can be deployed on a Node.js server, in a browser, Electron, or any terminal, among others. To create your agent, simply fill out the description and tools as shown in the repository example and specify your OpenAI token.\n\n#### Start\n1. Set OpenAI apiKey;\n2. Run the command `npm run start` in the project directory;\n3. Text directly and assign tasks to the agent right in the terminal!\n![terminal.png](doc/terminal.png)\n\n#### NPM package:\n- npm i gpt-agent\n- const agent = new GPTAgent.Assistant(OpenAI, …);\n- agent.send();\n- agent.init('gpt-4.1-mini');\n- agent.sendToGPT('User prompt');\n\n### OpenAI Assistant\nThe latest and most efficient OpenAI API using Assistant and gpt-4.1-mini with token caching in the model.\n\n![gpt-4.1.png](doc/gpt-4.1.png)\n\n#### Tokens Discount\nThis agent provides discounted pricing on cached tokens (4 times cheaper and faster compared to manual history management), beneficial for extensive dialogues or parsing large volumes of data.\n> Note: OpenAI currently lists this as a Beta API.\n\nAdvantages of the OpenAI Assistant used in this project:\n1. Compatible with various models; I'm using gpt-4.1-mini at $0.4 per 1M tokens.\n2. OpenAI-side caching at $0.1 per 1M tokens, 4 times cheaper than repeated submissions.\n3. Accelerated responses due to caching and parsing only the user's latest input.\n4. Allows writing custom TS functions, including Node.js support.\n\n### MCP\nYou can use this template to build your own internal MCP platform.\n\n### Agent Templates\nExamples of agents with configured Tools (function_call):\n- [rest-agent](src/agents/rest-agent.ts) - for interacting with REST APIs;\n- [wttr-agent.ts](src/agents/wttr-agent.ts) - Open API for retrieving weather data from various cities;\n- [fs-agent.ts](src/agents/fs-agent.ts) - for local file management and File System interactions;\n- [mermaid-agent](src/agents/mermaid-agent.ts) - for generating and sharing diagrams and charts;\n- [telegram-manager](src/agents/telegram-manager.ts) - for sending messages from Telegram bots to chats and groups.\n\n### Combine Agents\n[gpt-combine-agents.ts](src/gpt/gpt-combine-agents.ts) allows combining agents and sequentially performing complex chains of operations.\n\n### Support author\n[![\"Buy us ☕️ coffee and 🐶 treat ❤️\"](https://github.com/apgolubev/apgolubev/blob/main/assets/patreon-buy-coffee-and-treat.png?raw=true)](https://patreon.com/user?u=77885474)\n\n- Patreon: https://www.patreon.com/apgolubev\n- GitHub: https://github.com/apgolubev\n- LinkedIn: https://www.linkedin.com/in/aleksandr-golubev-9928aa25b\n- Reddit: https://www.reddit.com/user/apgolubev\n- Telegram: @apgolubev\n\n### Examples\n#### rest-agent\n```\nU: Send post with body {name: 'john doe'} \nA: The POST request with the body {name: 'john doe'} was sent successfully.\n\nU: Get content\nA: HTTP Response\n```\n\n#### wttr-agent\n```\nU: What is the weather like in the capitals of Europe?\nA: Here is the current weather in the capitals of Europe:\n\n- London: 6°C\n- Paris: 12°C\n- Berlin: 4°C\n- Rome: 10°C\n- Madrid: 6°C\n- Vienna: 15°C\n- Amsterdam: 5°C\n- Brussels: 6°C\n- Lisbon: 12°C\n- Athens: 22°C\n\nU: Write weather data to files\n```\n![fs-example-1.png](doc/fs-example-1.png)\n\n#### telegram-manager\n```\nU: Send 'Hi!' to chat_id 112414***\nA: The message \"Hi!\" has been sent to chat_id 112414*** using the bot Terminal GPTAgent (@TerminalGPTAgent_bot).\n```\n\n#### mermaid-agent\n```\nU: Create a CJM scheme of interaction user with the bank\nA: https://mermaid.live/edit#pako:eNp1kk1T4kAQhv/K1Jxx9eIlB6sgAUVxZQ1q1U48tElDpkxmUvOxisB/tzMEKKg1h1Sm36ff6e70iue6QB7xhYGmZLMkU4yevniyaF7Z2dkVG4h+nqO1bADqnb3gm5UOz/tN87plB4GKxUQvpDrve1eicjIHJ7XqkLhF1qkPPmuWiARs+abBFEfACGS1ZkMxNEYbdk8sLLAjknDLSDxL/GBUkPbKUUUVqPwYuRYzA8rOkRy0wuWReCOmsGQDWVX2KD4WsVYOcsdS3zTauE4dBfW27U37XfA6BO/EUDm6ZH9bgo7q3/neBWjS+s6lqfdYJ0+CfH+otRvOSddb7PcBa0fkDZ5gNwF7EClWSD20/XXKQ1Cm+zKo/Zp+T6dOg/pHdNEfithSj3vq/zWMA5WKuATHPqQrT0aZBn0mHtHq6h+ysbV+l3sbtCeaaMFScm03h/doJ2XBI2c89niNpob2yFdtTsZpzWrMeESfBZj3jGdqQzkNqL9a17s0o/2i5NEcKksn3xTgMJFA235AUBVo4naheHQZHHi04p88uujxJb03Pf4VLC9+XW6+AWjFAA8=\n\nU: Create a super detailed mindmap chart of interaction user with the bank\nA: https://mermaid.live/edit#pako:eNp1VE1v2zAM/SuCTi2Qbr304pvrLFiBpMuWbAOGXAiZsYXYkqGPpVnQ/z7Kjmw16y6JSJFPj+Sjz1zoEnnGW6nKFrqdYsxo7W5uvls0d4+gDuxJOTQgnNTq9jYEMLbUlVTDkbEQqaDFaK/B2qM2ZbS3R323oHxtWO5djcpJAQEtBjC2WW0mIwkKKV03XOVCaK8cW4GCCluKiCk/JB7H6zk6kI2d4B6hASVwcmwNKDvUwz5LS4+cxlK6EhyytdF72SQpazRWK2ioF3s9uQutHAG98Q70WAGmTEjk9Nxvgv44R7gck+rRsfXT8+BI2I35c+y0lS55GGydWDWKw1V9ezTR81O6ujRwhCbhs10lHaIEkeB9UY1UI78IxxZepSX1sgg9uX6PsU8v/70K8yBNOd3/p/4LXih8YrqGUzppypZNOtzCYCld3+3JudQQe1d4mm9L5De+67QZgYoa3D8+aJpr3yL/aieZGeepqNxaUg1EVhsU3kg3auhZO7m/KNy+r7q8QeNsSpjW6cq7MODLoESH4u2yrLSSYTM23nZSSO3tIK+EA2PfMJQxoERvXJGljnIh5TmpKvsed3obaXRIuzPeL0FVnuQ9jseQlMUpweEzXhlZ8swZjzNOrW8hmPwccnacVpu+FDyjYwnmsOM79Uo5HahfWrcxzWhf1TzbQ2PJ8v1WziVUBqYQVCWaIhTEs4cegWdn/sKz+xk/0e/rjP/pIe8/PLz+BZh2gIQ=\n\nU: Make a diagram of all the plot arcs and characters of Camus' book \"The Plague\" for mermaid and publish to mermaid.\nA: https://mermaid.live/edit#pako:eNptVEuL2zAQ/iuDTi1kl73sxYXCkrTd9tBs04VCnT1M7LEtIktGD9g0yX/vWLLzNkYaeeb75mltRWFKEpmoLXYNvM4+LTXws5AU3vOZvU/SG9zdfd59lXXj3Q5eFNaBPqTtYwK8orUm5GlL5s+kOgdVDxoxyfabRV3mcU2WU0V2PQGzcuT4BaPPAQtsV2R9PuwJ9Ae1d0CuwI5gFTw4jxsH3kDDjs8JXlCTMpzRKCSKBSlZSxM4SpS+gaJBpUjXVMJqc84w943ReVwT9kcoa5qAC1VF1oEyjlmsaS8cRzkC5sGvLOEaJGc35+TzqfQbMFU8vF3ZTzH0tSgJOTIu1eBK6vrAcNKrCPnJ1UdP3KLf3thNHtfRA5QhgrvoYvCXLHrsd12oUPbYaYMWC89Z5UcxRuAbkhbQFm6An+iZI0VyU5Pm4qYqzsFtutTum7qxkTeVsU1jQY1/skXe7/DURz5kK71EBWZoCtdzkM5g0fZXYHLtpabUBm9DXSvawVFxDXo2XTLnknYo7Q76L7N0uDb/wpbcp9SbiLNUKSq87P+FBTmjQi9fdG3kGGZ0nLBYg8N8nMR/rjiJ6EJzdHhQiAnfEbIUGadPE9GSbbE/im0PWQqejZaWImOxRLteiqXeM6ZD/deYdoTxENSNyCpUjk+hK3lcZxL59jmakC7JTk3QXmSPkUFkW/EusoeJ2PC6n4h/kfLh/nH/HxjYmkI=\n```\n![mermaid-example-1.png](doc/mermaid-example-1.png)\n![mermaid-example-2.png](doc/mermaid-example-2.png)\n\n#### fs-agent.ts\n```\nU: Create catalogs of the most popular games on Steam from the data you know about the top 10 genres and write them into .md files by genre.\nA: Catalogs of the most popular games on Steam by genre have been created and saved into the following .md files:\n- Action.md\n- Adventure.md\n- RPG.md\n- Strategy.md\n- Simulation.md\n- Sports.md\n- Indie.md\n- Casual.md\n- Horror.md\n- Multiplayer.md\n\nU: Sparse and summarize data from available files\nA: Here's a summarized and sparse overview of the top 10 Steam game genres with examples of their most popular games:\n1. Action: Includes intense gameplay titles such as Counter-Strike: Global Offensive, DOOM Eternal, and Hades.\n2. Adventure: Story-driven games like The Witcher 3: Wild Hunt, Life is Strange, and Firewatch.\n3. RPG (Role-Playing Game): Character progression games including Cyberpunk 2077, Divinity: Original Sin 2, and Dark Souls III.\n4. Strategy: Tactics and planning games such as Sid Meier's Civilization VI, Stellaris, and XCOM 2.\n5. Simulation: Realistic or creative simulations like The Sims 4, Microsoft Flight Simulator, and Euro Truck Simulator 2.\n6. Sports: Sports-themed games including FIFA 21, NBA 2K21, and Rocket League.\n7. Indie: Innovative independent games such as Hollow Knight, Celeste, and Stardew Valley.\n8. Casual: Easy-to-play fun games like Among Us, Fall Guys, and Candy Crush Saga.\n9. Horror: Scary and suspenseful games including Dead by Daylight, Resident Evil 2, and Phasmophobia.\n10. Multiplayer: Social competitive games such as Apex Legends, Team Fortress 2, and Dota 2.\n```\n![fs-example-2.png](doc/fs-example-2.png)\n\n#### fs-agent.ts + mermaid-agent\n```\nU: Parse and summarize the data from the available files and create a mindmap chart based on it. Show link and save original scheme in .md file.\nA: ...\n```\n![fs-example-1.png](doc/fs-example-1.png)","readmeFilename":"README.md","_rev":"1-58485e5f0333e915dfbb5356ef2a99fb"}