diff --git a/404.html b/404.html index de3806de..a2f60069 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ - + diff --git a/assets/js/0058b4c6.aa29e756.js b/assets/js/0058b4c6.aa29e756.js deleted file mode 100644 index 96682fb9..00000000 --- a/assets/js/0058b4c6.aa29e756.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[4088],{6462:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Payments for AI Agents and Apps","href":"/docs/getting-started/payments-for-ai","docId":"getting-started/payments-for-ai","unlisted":false},{"type":"link","label":"Frequently Asked Questions (FAQ)","href":"/docs/getting-started/faq","docId":"getting-started/faq","unlisted":false}],"href":"/docs/getting-started/"},{"type":"category","label":"Libraries","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"What can you do with the Payment Libraries?","href":"/docs/libraries/what-can-you-do","docId":"libraries/what-can-you-do","unlisted":false},{"type":"link","label":"Getting Started","href":"/docs/libraries/getting-started","docId":"libraries/getting-started","unlisted":false},{"type":"link","label":"How to register Payment Plans and Agents?","href":"/docs/libraries/assets-registration","docId":"libraries/assets-registration","unlisted":false},{"type":"link","label":"How Subscribers can order Plans?","href":"/docs/libraries/order-plans","docId":"libraries/order-plans","unlisted":false},{"type":"link","label":"How Subscribers can query AI Agents?","href":"/docs/libraries/query-agents","docId":"libraries/query-agents","unlisted":false},{"type":"link","label":"How AI Builders can process AI Tasks?","href":"/docs/libraries/process-tasks","docId":"libraries/process-tasks","unlisted":false},{"type":"link","label":"Examples","href":"/docs/libraries/examples","docId":"libraries/examples","unlisted":false}],"href":"/docs/libraries/"},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"First Steps","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to login?","href":"/docs/tutorials/first-steps/loggin","docId":"tutorials/first-steps/loggin","unlisted":false},{"type":"link","label":"Navigating the payments app","href":"/docs/tutorials/first-steps/navigate-app","docId":"tutorials/first-steps/navigate-app","unlisted":false}],"href":"/docs/tutorials/first-steps/"},{"type":"category","label":"For AI Builders","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Configure your account to accept payments","href":"/docs/tutorials/builders/configure-account","docId":"tutorials/builders/configure-account","unlisted":false},{"type":"link","label":"How to create a Payment Plan","href":"/docs/tutorials/builders/create-plan","docId":"tutorials/builders/create-plan","unlisted":false},{"type":"link","label":"How to register your AI agent and link to a Payment Plan","href":"/docs/tutorials/builders/register-agent","docId":"tutorials/builders/register-agent","unlisted":false},{"type":"link","label":"How to register your file assets and link to a Payment Plan","href":"/docs/tutorials/builders/register-file-asset","docId":"tutorials/builders/register-file-asset","unlisted":false},{"type":"link","label":"Distribute your AI agents and make some money","href":"/docs/tutorials/builders/distribute","docId":"tutorials/builders/distribute","unlisted":false},{"type":"link","label":"Monetize your Open AI Assistant","href":"/docs/tutorials/builders/openai-assistant","docId":"tutorials/builders/openai-assistant","unlisted":false}],"href":"/docs/tutorials/builders/"},{"type":"category","label":"Subscribers","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Searching assets and buying plans","href":"/docs/tutorials/subscribers/search-and-purchase","docId":"tutorials/subscribers/search-and-purchase","unlisted":false},{"type":"link","label":"Paying plans with Credit Card","href":"/docs/tutorials/subscribers/paying-stripe","docId":"tutorials/subscribers/paying-stripe","unlisted":false},{"type":"link","label":"Paying plans with Crypto","href":"/docs/tutorials/subscribers/paying-crypto","docId":"tutorials/subscribers/paying-crypto","unlisted":false}],"href":"/docs/tutorials/subscribers/"},{"type":"category","label":"Integration","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to integrate an AI agent in another application","href":"/docs/tutorials/integration/agent-integration","docId":"tutorials/integration/agent-integration","unlisted":false},{"type":"link","label":"What is a Nvm Api Key? How to obtain it and how to use it","href":"/docs/tutorials/integration/nvm-api-keys","docId":"tutorials/integration/nvm-api-keys","unlisted":false},{"type":"link","label":"Tutorial on how to use the Nevermined Payments Protocol in Python","href":"/docs/tutorials/integration/python-integration","docId":"tutorials/integration/python-integration","unlisted":false},{"type":"link","label":"Tutorial on how to use the Nevermined Payments Protocol in a React app","href":"/docs/tutorials/integration/nextjs-react-payments","docId":"tutorials/integration/nextjs-react-payments","unlisted":false},{"type":"link","label":"Using the Nvm App SDK for building web applications","href":"/docs/tutorials/integration/sdk-integration","docId":"tutorials/integration/sdk-integration","unlisted":false}],"href":"/docs/tutorials/integration/"},{"type":"category","label":"Advanced Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to integrate a widget in your website","href":"/docs/tutorials/advanced/widgets-integration","docId":"tutorials/advanced/widgets-integration","unlisted":false},{"type":"link","label":"How to use Payment Plans to protect Smart Contracts?","href":"/docs/tutorials/advanced/smart-contract-access","docId":"tutorials/advanced/smart-contract-access","unlisted":false},{"type":"link","label":"How an AI Agent or Service can charge credits dynamically","href":"/docs/tutorials/advanced/dynamic-charge-credits","docId":"tutorials/advanced/dynamic-charge-credits","unlisted":false}],"href":"/docs/tutorials/advanced/"},{"type":"category","label":"For Web3 users","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to set up a MetaMask wallet","href":"/docs/tutorials/web3/metamask","docId":"tutorials/web3/metamask","unlisted":false},{"type":"link","label":"How to add networks to MetaMask","href":"/docs/tutorials/web3/metamask-networks","docId":"tutorials/web3/metamask-networks","unlisted":false},{"type":"link","label":"How to add funds to your MetaMask wallet","href":"/docs/tutorials/web3/metamask-tokens","docId":"tutorials/web3/metamask-tokens","unlisted":false},{"type":"link","label":"Getting tokens for testnets","href":"/docs/tutorials/web3/faucets","docId":"tutorials/web3/faucets","unlisted":false}],"href":"/docs/tutorials/web3/"},{"type":"category","label":"Where to deploy your AI and get paid","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to accept payments in your Streamlit application","href":"/docs/tutorials/ai/streamlit","docId":"tutorials/ai/streamlit","unlisted":false},{"type":"link","label":"How to accept payments in your Super Agent AI application","href":"/docs/tutorials/ai/super-agent","docId":"tutorials/ai/super-agent","unlisted":false},{"type":"link","label":"How to expose a Python AI agent and publish it into Nevermined","href":"/docs/tutorials/ai/expose-python-agent","docId":"tutorials/ai/expose-python-agent","unlisted":false},{"type":"link","label":"Monetizing a ChatGPT plugin using Nevermined","href":"/docs/tutorials/ai/chatgpt-plugin","docId":"tutorials/ai/chatgpt-plugin","unlisted":false},{"type":"link","label":"How to create and integrate a Hugging Face Inference Endpoint","href":"/docs/tutorials/ai/huggingface","docId":"tutorials/ai/huggingface","unlisted":false}],"href":"/docs/tutorials/ai/"}],"href":"/docs/tutorials/"},{"type":"category","label":"Environments","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Production","href":"/docs/environments/production","docId":"environments/production","unlisted":false},{"type":"link","label":"Testing","href":"/docs/environments/testing","docId":"environments/testing","unlisted":false},{"type":"link","label":"Network Fees","href":"/docs/environments/network-fees","docId":"environments/network-fees","unlisted":false},{"type":"link","label":"Nevermined AI Hub","href":"/docs/environments/ai-hub","docId":"environments/ai-hub","unlisted":false}],"href":"/docs/environments/"},{"type":"category","label":"Architecture","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Overview","href":"/docs/architecture/high-level-architecture","docId":"architecture/high-level-architecture","unlisted":false},{"type":"link","label":"Nevermined Assets","href":"/docs/architecture/assets","docId":"architecture/assets","unlisted":false},{"type":"link","label":"How everything works","href":"/docs/architecture/how-works","docId":"architecture/how-works","unlisted":false},{"type":"link","label":"Nevermined\'s Payment Plans","href":"/docs/architecture/smart-subscriptions","docId":"architecture/smart-subscriptions","unlisted":false},{"type":"link","label":"Payment Plans: the evolution of NFTs","href":"/docs/architecture/nvm-nfts","docId":"architecture/nvm-nfts","unlisted":false}],"href":"/docs/architecture/"}]},"docs":{"architecture/assets":{"id":"architecture/assets","title":"Nevermined Assets","description":"What are the Nevermined Assets? and Why are important?","sidebar":"tutorialSidebar"},"architecture/high-level-architecture":{"id":"architecture/high-level-architecture","title":"Overview","description":"High Level architecture of Nevermined App","sidebar":"tutorialSidebar"},"architecture/how-works":{"id":"architecture/how-works","title":"How everything works","description":"Details about how everything works. Logical Architecture","sidebar":"tutorialSidebar"},"architecture/index":{"id":"architecture/index","title":"Overview","description":"Deep dive in Nevermined App technical solution","sidebar":"tutorialSidebar"},"architecture/nvm-nfts":{"id":"architecture/nvm-nfts","title":"Payment Plans: the evolution of NFTs","description":"Some background on NFT","sidebar":"tutorialSidebar"},"architecture/smart-subscriptions":{"id":"architecture/smart-subscriptions","title":"Nevermined\'s Payment Plans","description":"What are the Nevermined Payment Plans?","sidebar":"tutorialSidebar"},"environments/ai-hub":{"id":"environments/ai-hub","title":"Nevermined AI Hub","description":"Nevermined AI Hub","sidebar":"tutorialSidebar"},"environments/index":{"id":"environments/index","title":"Environments","description":"Nevermined Point of Sales Environments","sidebar":"tutorialSidebar"},"environments/network-fees":{"id":"environments/network-fees","title":"Network Fees","description":"Network Fees","sidebar":"tutorialSidebar"},"environments/production":{"id":"environments/production","title":"Production","description":"Production Environment","sidebar":"tutorialSidebar"},"environments/testing":{"id":"environments/testing","title":"Testing","description":"Point of Sales Testing Environment","sidebar":"tutorialSidebar"},"getting-started/faq":{"id":"getting-started/faq","title":"Frequently Asked Questions (FAQ)","description":"FAQ","sidebar":"tutorialSidebar"},"getting-started/index":{"id":"getting-started/index","title":"Welcome to Nevermined Payments App","description":"What is the Nevermined Payments Protocol and Point of Sales Solution?","sidebar":"tutorialSidebar"},"getting-started/payments-for-ai":{"id":"getting-started/payments-for-ai","title":"Payments for AI Agents and Apps","description":"Payments for AI Agents and Apps. What can you do with Nevermined Payments App?","sidebar":"tutorialSidebar"},"libraries/assets-registration":{"id":"libraries/assets-registration","title":"How to register Payment Plans and Agents?","description":"How AI Builders can register Payment Plans and Agents?","sidebar":"tutorialSidebar"},"libraries/examples":{"id":"libraries/examples","title":"Examples","description":"Examples","sidebar":"tutorialSidebar"},"libraries/getting-started":{"id":"libraries/getting-started","title":"Getting Started","description":"Getting Started and Requirements","sidebar":"tutorialSidebar"},"libraries/index":{"id":"libraries/index","title":"Payment Libraries","description":"Payment Libraries","sidebar":"tutorialSidebar"},"libraries/order-plans":{"id":"libraries/order-plans","title":"How Subscribers can order Plans?","description":"How Subscribers can order Plans?","sidebar":"tutorialSidebar"},"libraries/process-tasks":{"id":"libraries/process-tasks","title":"How AI Builders can process AI Tasks?","description":"How AI Builders can process AI Tasks?","sidebar":"tutorialSidebar"},"libraries/query-agents":{"id":"libraries/query-agents","title":"How Subscribers can query AI Agents?","description":"How Subscribers can query AI Agents?","sidebar":"tutorialSidebar"},"libraries/what-can-you-do":{"id":"libraries/what-can-you-do","title":"What can you do with the Payment Libraries?","description":"Payment Libraries allow AI Builders and Subscribers to interact with the Nevermined platform to create and manage Payment Plans and AI Agents.","sidebar":"tutorialSidebar"},"tutorials/advanced/dynamic-charge-credits":{"id":"tutorials/advanced/dynamic-charge-credits","title":"How an AI Agent or Service can charge credits dynamically","description":"How to charge credits dynamically","sidebar":"tutorialSidebar"},"tutorials/advanced/index":{"id":"tutorials/advanced/index","title":"Tutorials for Nevermined App Advanced used","description":"Nevermined App Advanced tutorials","sidebar":"tutorialSidebar"},"tutorials/advanced/smart-contract-access":{"id":"tutorials/advanced/smart-contract-access","title":"How to use Payment Plans to protect Smart Contracts?","description":"How to use Payment Plans to protect Smart Contracts","sidebar":"tutorialSidebar"},"tutorials/advanced/widgets-integration":{"id":"tutorials/advanced/widgets-integration","title":"How to integrate a widget in your website","description":"How to integrate a widget in your website","sidebar":"tutorialSidebar"},"tutorials/ai/chatgpt-plugin":{"id":"tutorials/ai/chatgpt-plugin","title":"Monetizing a ChatGPT plugin using Nevermined","description":"How to monetize a ChatGPT plugin using Nevermined","sidebar":"tutorialSidebar"},"tutorials/ai/expose-python-agent":{"id":"tutorials/ai/expose-python-agent","title":"How to expose a Python AI agent and publish it into Nevermined","description":"How to expose an AI agent and publish it into Nevermined","sidebar":"tutorialSidebar"},"tutorials/ai/huggingface":{"id":"tutorials/ai/huggingface","title":"How to create and integrate a Hugging Face Inference Endpoint","description":"How to create and integrate a Hugging Face Inference Endpoint","sidebar":"tutorialSidebar"},"tutorials/ai/index":{"id":"tutorials/ai/index","title":"Where to deploy your AI and get paid","description":"Where to deploy your AI and get paid","sidebar":"tutorialSidebar"},"tutorials/ai/streamlit":{"id":"tutorials/ai/streamlit","title":"How to accept payments in your Streamlit application","description":"How to accept payments in your Streamlit application","sidebar":"tutorialSidebar"},"tutorials/ai/super-agent":{"id":"tutorials/ai/super-agent","title":"How to accept payments in your Super Agent AI application","description":"How to integrate a Super Agent AI into Nevermined","sidebar":"tutorialSidebar"},"tutorials/builders/configure-account":{"id":"tutorials/builders/configure-account","title":"Configure your account to accept payments","description":"Configure your account to accept payments","sidebar":"tutorialSidebar"},"tutorials/builders/create-plan":{"id":"tutorials/builders/create-plan","title":"How to create a Payment Plan","description":"Steps to publish a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/builders/distribute":{"id":"tutorials/builders/distribute","title":"Distribute your AI agents and make some money","description":"Distribute your AI agents, services and files and make some money","sidebar":"tutorialSidebar"},"tutorials/builders/index":{"id":"tutorials/builders/index","title":"For AI Builders","description":"Getting your first contact with the Point of Sales App","sidebar":"tutorialSidebar"},"tutorials/builders/openai-assistant":{"id":"tutorials/builders/openai-assistant","title":"Monetize your Open AI Assistant","description":"Monetize your Open AI Assistant with Nevermined","sidebar":"tutorialSidebar"},"tutorials/builders/register-agent":{"id":"tutorials/builders/register-agent","title":"How to register your AI agent and link to a Payment Plan","description":"How to register your AI agent and link to a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/builders/register-file-asset":{"id":"tutorials/builders/register-file-asset","title":"How to register your file assets and link to a Payment Plan","description":"How to register your file assets and link to a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/first-steps/index":{"id":"tutorials/first-steps/index","title":"Getting started with the payments app","description":"Getting your first contact with the Point of Sales App","sidebar":"tutorialSidebar"},"tutorials/first-steps/loggin":{"id":"tutorials/first-steps/loggin","title":"How to login?","description":"How to login in the App","sidebar":"tutorialSidebar"},"tutorials/first-steps/navigate-app":{"id":"tutorials/first-steps/navigate-app","title":"Navigating the payments app","description":"Navigating the payments app","sidebar":"tutorialSidebar"},"tutorials/index":{"id":"tutorials/index","title":"Getting Started with the Tutorials","description":"Get Started with the Tutorials","sidebar":"tutorialSidebar"},"tutorials/integration/agent-integration":{"id":"tutorials/integration/agent-integration","title":"How to integrate an AI agent in another application","description":"How to generate the JWT access token that gives access to an AI Agent or service","sidebar":"tutorialSidebar"},"tutorials/integration/index":{"id":"tutorials/integration/index","title":"Tutorials for integrating the Nevermined App","description":"How to integrate the Nevermined App from different applications","sidebar":"tutorialSidebar"},"tutorials/integration/nextjs-react-payments":{"id":"tutorials/integration/nextjs-react-payments","title":"Tutorial on how to use the Nevermined Payments Protocol in a React app","description":"How to integrate the Nevermined Payments library in a react application","sidebar":"tutorialSidebar"},"tutorials/integration/nvm-api-keys":{"id":"tutorials/integration/nvm-api-keys","title":"What is a Nvm Api Key? How to obtain it and how to use it","description":"What is a Nvm Api Key and how to obtain it","sidebar":"tutorialSidebar"},"tutorials/integration/python-integration":{"id":"tutorials/integration/python-integration","title":"Tutorial on how to use the Nevermined Payments Protocol in Python","description":"How to integrate the Nevermined Payments Python library","sidebar":"tutorialSidebar"},"tutorials/integration/sdk-integration":{"id":"tutorials/integration/sdk-integration","title":"Using the Nvm App SDK for building web applications","description":"How to build sophisticated web applications on top of the Nevermined network with the Nevermined SDK","sidebar":"tutorialSidebar"},"tutorials/subscribers/index":{"id":"tutorials/subscribers/index","title":"For Subscribers","description":"For Subscribers","sidebar":"tutorialSidebar"},"tutorials/subscribers/paying-crypto":{"id":"tutorials/subscribers/paying-crypto","title":"Paying plans with Crypto","description":"Paying plans with Crypto","sidebar":"tutorialSidebar"},"tutorials/subscribers/paying-stripe":{"id":"tutorials/subscribers/paying-stripe","title":"Paying plans with Credit Card","description":"Paying plans with Credit Card (via Stripe)","sidebar":"tutorialSidebar"},"tutorials/subscribers/search-and-purchase":{"id":"tutorials/subscribers/search-and-purchase","title":"Searching assets and buying plans","description":"How to find an asset and purchase the Payment Plans","sidebar":"tutorialSidebar"},"tutorials/web3/faucets":{"id":"tutorials/web3/faucets","title":"Getting tokens for testnets","description":"What faucets can you use to start playing with Nevermined environments","sidebar":"tutorialSidebar"},"tutorials/web3/index":{"id":"tutorials/web3/index","title":"For Web3 users","description":"For Web3 users","sidebar":"tutorialSidebar"},"tutorials/web3/metamask":{"id":"tutorials/web3/metamask","title":"How to set up a MetaMask wallet","description":"How to connect MetaMask","sidebar":"tutorialSidebar"},"tutorials/web3/metamask-networks":{"id":"tutorials/web3/metamask-networks","title":"How to add networks to MetaMask","description":"How to add networks to MetaMask","sidebar":"tutorialSidebar"},"tutorials/web3/metamask-tokens":{"id":"tutorials/web3/metamask-tokens","title":"How to add funds to your MetaMask wallet","description":"How to get tokens","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/0058b4c6.dfad8fe3.js b/assets/js/0058b4c6.dfad8fe3.js new file mode 100644 index 00000000..e1535d2a --- /dev/null +++ b/assets/js/0058b4c6.dfad8fe3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[4088],{6462:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Payments for AI Agents and Apps","href":"/docs/getting-started/payments-for-ai","docId":"getting-started/payments-for-ai","unlisted":false},{"type":"link","label":"Frequently Asked Questions (FAQ)","href":"/docs/getting-started/faq","docId":"getting-started/faq","unlisted":false}],"href":"/docs/getting-started/"},{"type":"category","label":"Libraries","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"What can you do with the Payment Libraries?","href":"/docs/libraries/what-can-you-do","docId":"libraries/what-can-you-do","unlisted":false},{"type":"link","label":"Getting Started","href":"/docs/libraries/getting-started","docId":"libraries/getting-started","unlisted":false},{"type":"link","label":"How to register Payment Plans and Agents?","href":"/docs/libraries/assets-registration","docId":"libraries/assets-registration","unlisted":false},{"type":"link","label":"How Subscribers can order Plans?","href":"/docs/libraries/order-plans","docId":"libraries/order-plans","unlisted":false},{"type":"link","label":"How Subscribers can query AI Agents?","href":"/docs/libraries/query-agents","docId":"libraries/query-agents","unlisted":false},{"type":"link","label":"How AI Builders can process AI Tasks?","href":"/docs/libraries/process-tasks","docId":"libraries/process-tasks","unlisted":false},{"type":"link","label":"Code Examples","href":"/docs/libraries/examples","docId":"libraries/examples","unlisted":false}],"href":"/docs/libraries/"},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"First Steps","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to login?","href":"/docs/tutorials/first-steps/loggin","docId":"tutorials/first-steps/loggin","unlisted":false},{"type":"link","label":"Navigating the payments app","href":"/docs/tutorials/first-steps/navigate-app","docId":"tutorials/first-steps/navigate-app","unlisted":false}],"href":"/docs/tutorials/first-steps/"},{"type":"category","label":"For AI Builders","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Configure your account to accept payments","href":"/docs/tutorials/builders/configure-account","docId":"tutorials/builders/configure-account","unlisted":false},{"type":"link","label":"How to create a Payment Plan","href":"/docs/tutorials/builders/create-plan","docId":"tutorials/builders/create-plan","unlisted":false},{"type":"link","label":"How to register your AI agent and link to a Payment Plan","href":"/docs/tutorials/builders/register-agent","docId":"tutorials/builders/register-agent","unlisted":false},{"type":"link","label":"How to register your file assets and link to a Payment Plan","href":"/docs/tutorials/builders/register-file-asset","docId":"tutorials/builders/register-file-asset","unlisted":false},{"type":"link","label":"Distribute your AI agents and make some money","href":"/docs/tutorials/builders/distribute","docId":"tutorials/builders/distribute","unlisted":false},{"type":"link","label":"Monetize your Open AI Assistant","href":"/docs/tutorials/builders/openai-assistant","docId":"tutorials/builders/openai-assistant","unlisted":false}],"href":"/docs/tutorials/builders/"},{"type":"category","label":"Subscribers","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Searching assets and buying plans","href":"/docs/tutorials/subscribers/search-and-purchase","docId":"tutorials/subscribers/search-and-purchase","unlisted":false},{"type":"link","label":"Paying plans with Credit Card","href":"/docs/tutorials/subscribers/paying-stripe","docId":"tutorials/subscribers/paying-stripe","unlisted":false},{"type":"link","label":"Paying plans with Crypto","href":"/docs/tutorials/subscribers/paying-crypto","docId":"tutorials/subscribers/paying-crypto","unlisted":false}],"href":"/docs/tutorials/subscribers/"},{"type":"category","label":"Integration","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to integrate an AI agent in another application","href":"/docs/tutorials/integration/agent-integration","docId":"tutorials/integration/agent-integration","unlisted":false},{"type":"link","label":"What is a Nvm Api Key? How to obtain it and how to use it","href":"/docs/tutorials/integration/nvm-api-keys","docId":"tutorials/integration/nvm-api-keys","unlisted":false},{"type":"link","label":"Tutorial on how to use the Nevermined Payments Protocol in Python","href":"/docs/tutorials/integration/python-integration","docId":"tutorials/integration/python-integration","unlisted":false},{"type":"link","label":"Tutorial on how to use the Nevermined Payments Protocol in a React app","href":"/docs/tutorials/integration/nextjs-react-payments","docId":"tutorials/integration/nextjs-react-payments","unlisted":false},{"type":"link","label":"Using the Nvm App SDK for building web applications","href":"/docs/tutorials/integration/sdk-integration","docId":"tutorials/integration/sdk-integration","unlisted":false}],"href":"/docs/tutorials/integration/"},{"type":"category","label":"Advanced Tutorials","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to integrate a widget in your website","href":"/docs/tutorials/advanced/widgets-integration","docId":"tutorials/advanced/widgets-integration","unlisted":false},{"type":"link","label":"How to use Payment Plans to protect Smart Contracts?","href":"/docs/tutorials/advanced/smart-contract-access","docId":"tutorials/advanced/smart-contract-access","unlisted":false},{"type":"link","label":"How an AI Agent or Service can charge credits dynamically","href":"/docs/tutorials/advanced/dynamic-charge-credits","docId":"tutorials/advanced/dynamic-charge-credits","unlisted":false}],"href":"/docs/tutorials/advanced/"},{"type":"category","label":"For Web3 users","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to set up a MetaMask wallet","href":"/docs/tutorials/web3/metamask","docId":"tutorials/web3/metamask","unlisted":false},{"type":"link","label":"How to add networks to MetaMask","href":"/docs/tutorials/web3/metamask-networks","docId":"tutorials/web3/metamask-networks","unlisted":false},{"type":"link","label":"How to add funds to your MetaMask wallet","href":"/docs/tutorials/web3/metamask-tokens","docId":"tutorials/web3/metamask-tokens","unlisted":false},{"type":"link","label":"Getting tokens for testnets","href":"/docs/tutorials/web3/faucets","docId":"tutorials/web3/faucets","unlisted":false}],"href":"/docs/tutorials/web3/"},{"type":"category","label":"Where to deploy your AI and get paid","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"How to accept payments in your Streamlit application","href":"/docs/tutorials/ai/streamlit","docId":"tutorials/ai/streamlit","unlisted":false},{"type":"link","label":"How to accept payments in your Super Agent AI application","href":"/docs/tutorials/ai/super-agent","docId":"tutorials/ai/super-agent","unlisted":false},{"type":"link","label":"How to expose a Python AI agent and publish it into Nevermined","href":"/docs/tutorials/ai/expose-python-agent","docId":"tutorials/ai/expose-python-agent","unlisted":false},{"type":"link","label":"Monetizing a ChatGPT plugin using Nevermined","href":"/docs/tutorials/ai/chatgpt-plugin","docId":"tutorials/ai/chatgpt-plugin","unlisted":false},{"type":"link","label":"How to create and integrate a Hugging Face Inference Endpoint","href":"/docs/tutorials/ai/huggingface","docId":"tutorials/ai/huggingface","unlisted":false}],"href":"/docs/tutorials/ai/"}],"href":"/docs/tutorials/"},{"type":"category","label":"Environments","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Production","href":"/docs/environments/production","docId":"environments/production","unlisted":false},{"type":"link","label":"Testing","href":"/docs/environments/testing","docId":"environments/testing","unlisted":false},{"type":"link","label":"Network Fees","href":"/docs/environments/network-fees","docId":"environments/network-fees","unlisted":false},{"type":"link","label":"Nevermined AI Hub","href":"/docs/environments/ai-hub","docId":"environments/ai-hub","unlisted":false}],"href":"/docs/environments/"},{"type":"category","label":"Architecture","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Overview","href":"/docs/architecture/high-level-architecture","docId":"architecture/high-level-architecture","unlisted":false},{"type":"link","label":"Nevermined Assets","href":"/docs/architecture/assets","docId":"architecture/assets","unlisted":false},{"type":"link","label":"How everything works","href":"/docs/architecture/how-works","docId":"architecture/how-works","unlisted":false},{"type":"link","label":"Nevermined\'s Payment Plans","href":"/docs/architecture/smart-subscriptions","docId":"architecture/smart-subscriptions","unlisted":false},{"type":"link","label":"Payment Plans: the evolution of NFTs","href":"/docs/architecture/nvm-nfts","docId":"architecture/nvm-nfts","unlisted":false}],"href":"/docs/architecture/"}]},"docs":{"architecture/assets":{"id":"architecture/assets","title":"Nevermined Assets","description":"What are the Nevermined Assets? and Why are important?","sidebar":"tutorialSidebar"},"architecture/high-level-architecture":{"id":"architecture/high-level-architecture","title":"Overview","description":"High Level architecture of Nevermined App","sidebar":"tutorialSidebar"},"architecture/how-works":{"id":"architecture/how-works","title":"How everything works","description":"Details about how everything works. Logical Architecture","sidebar":"tutorialSidebar"},"architecture/index":{"id":"architecture/index","title":"Overview","description":"Deep dive in Nevermined App technical solution","sidebar":"tutorialSidebar"},"architecture/nvm-nfts":{"id":"architecture/nvm-nfts","title":"Payment Plans: the evolution of NFTs","description":"Some background on NFT","sidebar":"tutorialSidebar"},"architecture/smart-subscriptions":{"id":"architecture/smart-subscriptions","title":"Nevermined\'s Payment Plans","description":"What are the Nevermined Payment Plans?","sidebar":"tutorialSidebar"},"environments/ai-hub":{"id":"environments/ai-hub","title":"Nevermined AI Hub","description":"Nevermined AI Hub","sidebar":"tutorialSidebar"},"environments/index":{"id":"environments/index","title":"Environments","description":"Nevermined Point of Sales Environments","sidebar":"tutorialSidebar"},"environments/network-fees":{"id":"environments/network-fees","title":"Network Fees","description":"Network Fees","sidebar":"tutorialSidebar"},"environments/production":{"id":"environments/production","title":"Production","description":"Production Environment","sidebar":"tutorialSidebar"},"environments/testing":{"id":"environments/testing","title":"Testing","description":"Point of Sales Testing Environment","sidebar":"tutorialSidebar"},"getting-started/faq":{"id":"getting-started/faq","title":"Frequently Asked Questions (FAQ)","description":"FAQ","sidebar":"tutorialSidebar"},"getting-started/index":{"id":"getting-started/index","title":"Welcome to Nevermined Payments App","description":"What is the Nevermined Payments Protocol and Point of Sales Solution?","sidebar":"tutorialSidebar"},"getting-started/payments-for-ai":{"id":"getting-started/payments-for-ai","title":"Payments for AI Agents and Apps","description":"Payments for AI Agents and Apps. What can you do with Nevermined Payments App?","sidebar":"tutorialSidebar"},"libraries/assets-registration":{"id":"libraries/assets-registration","title":"How to register Payment Plans and Agents?","description":"How AI Builders can register Payment Plans and Agents?","sidebar":"tutorialSidebar"},"libraries/examples":{"id":"libraries/examples","title":"Code Examples","description":"Examples","sidebar":"tutorialSidebar"},"libraries/getting-started":{"id":"libraries/getting-started","title":"Getting Started","description":"Getting Started and Requirements","sidebar":"tutorialSidebar"},"libraries/index":{"id":"libraries/index","title":"Payment Libraries","description":"Payment Libraries","sidebar":"tutorialSidebar"},"libraries/order-plans":{"id":"libraries/order-plans","title":"How Subscribers can order Plans?","description":"How Subscribers can order Plans?","sidebar":"tutorialSidebar"},"libraries/process-tasks":{"id":"libraries/process-tasks","title":"How AI Builders can process AI Tasks?","description":"How AI Builders can process AI Tasks?","sidebar":"tutorialSidebar"},"libraries/query-agents":{"id":"libraries/query-agents","title":"How Subscribers can query AI Agents?","description":"How Subscribers can query AI Agents?","sidebar":"tutorialSidebar"},"libraries/what-can-you-do":{"id":"libraries/what-can-you-do","title":"What can you do with the Payment Libraries?","description":"Payment Libraries allow AI Builders and Subscribers to interact with the Nevermined platform to create and manage Payment Plans and AI Agents.","sidebar":"tutorialSidebar"},"tutorials/advanced/dynamic-charge-credits":{"id":"tutorials/advanced/dynamic-charge-credits","title":"How an AI Agent or Service can charge credits dynamically","description":"How to charge credits dynamically","sidebar":"tutorialSidebar"},"tutorials/advanced/index":{"id":"tutorials/advanced/index","title":"Tutorials for Nevermined App Advanced used","description":"Nevermined App Advanced tutorials","sidebar":"tutorialSidebar"},"tutorials/advanced/smart-contract-access":{"id":"tutorials/advanced/smart-contract-access","title":"How to use Payment Plans to protect Smart Contracts?","description":"How to use Payment Plans to protect Smart Contracts","sidebar":"tutorialSidebar"},"tutorials/advanced/widgets-integration":{"id":"tutorials/advanced/widgets-integration","title":"How to integrate a widget in your website","description":"How to integrate a widget in your website","sidebar":"tutorialSidebar"},"tutorials/ai/chatgpt-plugin":{"id":"tutorials/ai/chatgpt-plugin","title":"Monetizing a ChatGPT plugin using Nevermined","description":"How to monetize a ChatGPT plugin using Nevermined","sidebar":"tutorialSidebar"},"tutorials/ai/expose-python-agent":{"id":"tutorials/ai/expose-python-agent","title":"How to expose a Python AI agent and publish it into Nevermined","description":"How to expose an AI agent and publish it into Nevermined","sidebar":"tutorialSidebar"},"tutorials/ai/huggingface":{"id":"tutorials/ai/huggingface","title":"How to create and integrate a Hugging Face Inference Endpoint","description":"How to create and integrate a Hugging Face Inference Endpoint","sidebar":"tutorialSidebar"},"tutorials/ai/index":{"id":"tutorials/ai/index","title":"Where to deploy your AI and get paid","description":"Where to deploy your AI and get paid","sidebar":"tutorialSidebar"},"tutorials/ai/streamlit":{"id":"tutorials/ai/streamlit","title":"How to accept payments in your Streamlit application","description":"How to accept payments in your Streamlit application","sidebar":"tutorialSidebar"},"tutorials/ai/super-agent":{"id":"tutorials/ai/super-agent","title":"How to accept payments in your Super Agent AI application","description":"How to integrate a Super Agent AI into Nevermined","sidebar":"tutorialSidebar"},"tutorials/builders/configure-account":{"id":"tutorials/builders/configure-account","title":"Configure your account to accept payments","description":"Configure your account to accept payments","sidebar":"tutorialSidebar"},"tutorials/builders/create-plan":{"id":"tutorials/builders/create-plan","title":"How to create a Payment Plan","description":"Steps to publish a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/builders/distribute":{"id":"tutorials/builders/distribute","title":"Distribute your AI agents and make some money","description":"Distribute your AI agents, services and files and make some money","sidebar":"tutorialSidebar"},"tutorials/builders/index":{"id":"tutorials/builders/index","title":"For AI Builders","description":"Getting your first contact with the Point of Sales App","sidebar":"tutorialSidebar"},"tutorials/builders/openai-assistant":{"id":"tutorials/builders/openai-assistant","title":"Monetize your Open AI Assistant","description":"Monetize your Open AI Assistant with Nevermined","sidebar":"tutorialSidebar"},"tutorials/builders/register-agent":{"id":"tutorials/builders/register-agent","title":"How to register your AI agent and link to a Payment Plan","description":"How to register your AI agent and link to a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/builders/register-file-asset":{"id":"tutorials/builders/register-file-asset","title":"How to register your file assets and link to a Payment Plan","description":"How to register your file assets and link to a Payment Plan","sidebar":"tutorialSidebar"},"tutorials/first-steps/index":{"id":"tutorials/first-steps/index","title":"Getting started with the payments app","description":"Getting your first contact with the Point of Sales App","sidebar":"tutorialSidebar"},"tutorials/first-steps/loggin":{"id":"tutorials/first-steps/loggin","title":"How to login?","description":"How to login in the App","sidebar":"tutorialSidebar"},"tutorials/first-steps/navigate-app":{"id":"tutorials/first-steps/navigate-app","title":"Navigating the payments app","description":"Navigating the payments app","sidebar":"tutorialSidebar"},"tutorials/index":{"id":"tutorials/index","title":"Getting Started with the Tutorials","description":"Get Started with the Tutorials","sidebar":"tutorialSidebar"},"tutorials/integration/agent-integration":{"id":"tutorials/integration/agent-integration","title":"How to integrate an AI agent in another application","description":"How to generate the JWT access token that gives access to an AI Agent or service","sidebar":"tutorialSidebar"},"tutorials/integration/index":{"id":"tutorials/integration/index","title":"Tutorials for integrating the Nevermined App","description":"How to integrate the Nevermined App from different applications","sidebar":"tutorialSidebar"},"tutorials/integration/nextjs-react-payments":{"id":"tutorials/integration/nextjs-react-payments","title":"Tutorial on how to use the Nevermined Payments Protocol in a React app","description":"How to integrate the Nevermined Payments library in a react application","sidebar":"tutorialSidebar"},"tutorials/integration/nvm-api-keys":{"id":"tutorials/integration/nvm-api-keys","title":"What is a Nvm Api Key? How to obtain it and how to use it","description":"What is a Nvm Api Key and how to obtain it","sidebar":"tutorialSidebar"},"tutorials/integration/python-integration":{"id":"tutorials/integration/python-integration","title":"Tutorial on how to use the Nevermined Payments Protocol in Python","description":"How to integrate the Nevermined Payments Python library","sidebar":"tutorialSidebar"},"tutorials/integration/sdk-integration":{"id":"tutorials/integration/sdk-integration","title":"Using the Nvm App SDK for building web applications","description":"How to build sophisticated web applications on top of the Nevermined network with the Nevermined SDK","sidebar":"tutorialSidebar"},"tutorials/subscribers/index":{"id":"tutorials/subscribers/index","title":"For Subscribers","description":"For Subscribers","sidebar":"tutorialSidebar"},"tutorials/subscribers/paying-crypto":{"id":"tutorials/subscribers/paying-crypto","title":"Paying plans with Crypto","description":"Paying plans with Crypto","sidebar":"tutorialSidebar"},"tutorials/subscribers/paying-stripe":{"id":"tutorials/subscribers/paying-stripe","title":"Paying plans with Credit Card","description":"Paying plans with Credit Card (via Stripe)","sidebar":"tutorialSidebar"},"tutorials/subscribers/search-and-purchase":{"id":"tutorials/subscribers/search-and-purchase","title":"Searching assets and buying plans","description":"How to find an asset and purchase the Payment Plans","sidebar":"tutorialSidebar"},"tutorials/web3/faucets":{"id":"tutorials/web3/faucets","title":"Getting tokens for testnets","description":"What faucets can you use to start playing with Nevermined environments","sidebar":"tutorialSidebar"},"tutorials/web3/index":{"id":"tutorials/web3/index","title":"For Web3 users","description":"For Web3 users","sidebar":"tutorialSidebar"},"tutorials/web3/metamask":{"id":"tutorials/web3/metamask","title":"How to set up a MetaMask wallet","description":"How to connect MetaMask","sidebar":"tutorialSidebar"},"tutorials/web3/metamask-networks":{"id":"tutorials/web3/metamask-networks","title":"How to add networks to MetaMask","description":"How to add networks to MetaMask","sidebar":"tutorialSidebar"},"tutorials/web3/metamask-tokens":{"id":"tutorials/web3/metamask-tokens","title":"How to add funds to your MetaMask wallet","description":"How to get tokens","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/8ad336ef.2f63f78e.js b/assets/js/8ad336ef.2f63f78e.js deleted file mode 100644 index ec90aa51..00000000 --- a/assets/js/8ad336ef.2f63f78e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[9476],{6746:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>r,toc:()=>d});var s=n(5893),a=n(1151);const i={sidebar_position:10,description:"Examples"},o="Examples",r={id:"libraries/examples",title:"Examples",description:"Examples",source:"@site/docs/libraries/10-examples.md",sourceDirName:"libraries",slug:"/libraries/examples",permalink:"/docs/libraries/examples",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/libraries/10-examples.md",tags:[],version:"current",sidebarPosition:10,frontMatter:{sidebar_position:10,description:"Examples"},sidebar:"tutorialSidebar",previous:{title:"How AI Builders can process AI Tasks?",permalink:"/docs/libraries/process-tasks"},next:{title:"Getting Started with the Tutorials",permalink:"/docs/tutorials/"}},p={},d=[{value:"AI Agents",id:"ai-agents",level:2},{value:"Youtube Agent (Python)",id:"youtube-agent-python",level:3},{value:"Notebooks",id:"notebooks",level:2}];function u(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,a.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"examples",children:"Examples"})}),"\n",(0,s.jsx)(t.p,{children:"The Payment Libraries allow you to interact with the Nevermined platform to create and manage Payment Plans and AI Agents."}),"\n",(0,s.jsx)(t.h2,{id:"ai-agents",children:"AI Agents"}),"\n",(0,s.jsx)(t.h3,{id:"youtube-agent-python",children:"Youtube Agent (Python)"}),"\n",(0,s.jsx)(t.p,{children:"The Youtube Summarizer it's a small Python AI Agent with Nevermined Payments Library integrated which receives a Youtube video URL and returns a summary of the transcription of the video."}),"\n",(0,s.jsx)(t.p,{children:"The Agent uses LangChain to retrieve the transcription and summarize it via OpenAI integration."}),"\n",(0,s.jsxs)(t.p,{children:["Here is the ",(0,s.jsx)(t.a,{href:"https://github.com/nevermined-io/youtube-agent/",children:"Youtube Summarizer Agent code"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"As you can see, the Agent is a simple Python script that implements a callback function to process the AI Tasks that are sent by the users."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"class YoutubeAgent:\n def __init__(self, payment):\n self.payment = payment\n\n async def run(self, data):\n print(\"Data received:\", data)\n step = self.payment.ai_protocol.get_step(data['step_id'])\n\n loader = YoutubeLoader.from_youtube_url(\n youtube_url=step['input_query'],\n add_video_info=False, \n language=[\"en\"],\n transcript_format=TranscriptFormat.CHUNKS, \n chunk_size_seconds=30,\n )\n # Load the documents from the video\n docs = loader.load()\n result = \" \".join(doc.page_content for doc in docs)\n\n llm = OpenAI(api_key=openai_api_key)\n summarize_chain = load_summarize_chain(llm, chain_type=\"map_reduce\")\n docs = [Document(page_content=result)]\n summary = summarize_chain.invoke(docs)\n print('Summary:', summary['output_text'])\n\n\n # Use the `payment` object to update the step\n self.payment.ai_protocol.update_step(\n did=data['did'],\n task_id=data['task_id'], \n step_id=data['step_id'],\n step={'step_id': data['step_id'],\n 'task_id': data[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': summary['output_text'],\n 'is_last': True\n },\n )\n"})}),"\n",(0,s.jsxs)(t.p,{children:["As you can see the fuction ",(0,s.jsx)(t.code,{children:"run"})," is the callback function that processes the AI Task. The function receives the data from the AI Task and uses it to process the task. In this case, the function uses the data to retrieve the Youtube video URL, transcribe it, and summarize it. After processing you have to update the step with the result."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:'async def main():\n # Initialize the Payments object\n payment = Payments(\n app_id="youtube_agent", \n nvm_api_key=nvm_api_key, \n version="1.0.0", \n environment=Environment.get_environment(environment), \n ai_protocol=True, \n web_socket_options={\'bearer_token\': nvm_api_key}\n )\n\n # Initialize the YoutubeAgent with the payment instance\n agent = YoutubeAgent(payment)\n\n # Subscribe to the ai_protocol with the agent\'s `run` method\n subscription_task = asyncio.get_event_loop().create_task(payment.ai_protocol.subscribe(agent.run, join_account_room=True))\n try:\n await subscription_task\n except asyncio.CancelledError:\n print("Subscription task was cancelled")\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"main"})," function initializes the Payments object and the YoutubeAgent object. Then it subscribes to the ai_protocol with the agent's ",(0,s.jsx)(t.code,{children:"run"})," method.\nIn this example we are asuming that the agent is processing the AI task in one step, but you can implement the agent to process multiple steps."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"class YoutubeAgent:\n def __init__(self, payment):\n self.payment = payment\n\n async def run(self, data):\n step = self.payment.ai_protocol.get_step(data['step_id'])\n if(step['step_status'] != AgentExecutionStatus.Pending.value):\n print('Step status is not pending')\n return\n \n if(step['name'] == 'init'):\n transcript_step_id = generate_step_id()\n self.payment.ai_protocol.create_steps(did=step['did'], task_id=step['task_id'], steps={\"steps\" : [{\n 'task_id': step['task_id'],\n 'step_id': transcript_step_id,\n 'input_query': step['input_query'],\n 'name': 'transcript',\n 'predecessor': step['step_id'],\n 'is_last': False,\n 'order': 2\n },\n { \n 'task_id': step['task_id'],\n 'step_id': generate_step_id(),\n 'predecessor': transcript_step_id,\n 'input_query': '',\n 'name': 'summarize',\n 'is_waiting': True, \n 'is_last': True,\n 'order': 3\n }]})\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'input_query': step['input_query'],\n 'output': step['input_query'],\n 'is_last': False\n },\n )\n \n elif (step['name'] == 'transcript'):\n loader = YoutubeLoader.from_youtube_url(\n youtube_url=step['input_query'],\n add_video_info=False, \n language=[\"en\"],\n transcript_format=TranscriptFormat.CHUNKS, \n chunk_size_seconds=30,\n )\n # Load the documents from the video\n docs = loader.load()\n result = \" \".join(doc.page_content for doc in docs)\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': result,\n 'is_last': False\n },\n )\n \n elif (step['name'] == 'summarize'):\n llm = OpenAI(api_key=openai_api_key)\n summarize_chain = load_summarize_chain(llm, chain_type=\"map_reduce\")\n docs = [Document(page_content=step[\"input_query\"])]\n summary = summarize_chain.invoke(docs)\n print('Summary:', summary['output_text'])\n # Use the `payment` object to update the step\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': summary['output_text'],\n 'is_last': True\n },\n )\n \n else:\n print(f\"Unknown step name: {step['name']}\")\n"})}),"\n",(0,s.jsx)(t.p,{children:"In this example, we are assuming that the agent is processing the AI task in multiple steps. The agent receives the data from the AI Task and uses it to process the task.\nAfter processing you have to update the step with the result. Automatically the output of the previous step is the input of the next step."}),"\n",(0,s.jsx)(t.h2,{id:"notebooks",children:"Notebooks"}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.a,{href:"https://colab.research.google.com/drive/1Pqrfm3P5t8P9DS7Hwp3v72jhRrB2KsP5#scrollTo=dghI-HwVgulp",children:"Python Notebook"})," example, we will show you how to use the Payments Library to create Payment Plans, register AI Agents, and query them."]})]})}function c(e={}){const{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>o});var s=n(7294);const a={},i=s.createContext(a);function o(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8ad336ef.343653ae.js b/assets/js/8ad336ef.343653ae.js new file mode 100644 index 00000000..c511f437 --- /dev/null +++ b/assets/js/8ad336ef.343653ae.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[9476],{6746:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>l,frontMatter:()=>i,metadata:()=>r,toc:()=>u});var s=n(5893),a=n(1151);const i={sidebar_position:10,description:"Examples"},o="Code Examples",r={id:"libraries/examples",title:"Code Examples",description:"Examples",source:"@site/docs/libraries/10-examples.md",sourceDirName:"libraries",slug:"/libraries/examples",permalink:"/docs/libraries/examples",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/libraries/10-examples.md",tags:[],version:"current",sidebarPosition:10,frontMatter:{sidebar_position:10,description:"Examples"},sidebar:"tutorialSidebar",previous:{title:"How AI Builders can process AI Tasks?",permalink:"/docs/libraries/process-tasks"},next:{title:"Getting Started with the Tutorials",permalink:"/docs/tutorials/"}},p={},u=[{value:"AI Agents",id:"ai-agents",level:2},{value:"Youtube Agent (Python)",id:"youtube-agent-python",level:3},{value:"The Text to Speech Agent (Typescript)",id:"the-text-to-speech-agent-typescript",level:3},{value:"Simple Text to Speech Agent implementation",id:"simple-text-to-speech-agent-implementation",level:3},{value:"Agent2Agent implementation (Youtube to Speech)",id:"agent2agent-implementation-youtube-to-speech",level:3},{value:"Notebooks",id:"notebooks",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,a.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"code-examples",children:"Code Examples"})}),"\n",(0,s.jsx)(t.p,{children:"The Payment Libraries allow you to interact with the Nevermined platform to create and manage Payment Plans and AI Agents."}),"\n",(0,s.jsx)(t.h2,{id:"ai-agents",children:"AI Agents"}),"\n",(0,s.jsx)(t.h3,{id:"youtube-agent-python",children:"Youtube Agent (Python)"}),"\n",(0,s.jsx)(t.p,{children:"The Youtube Summarizer it's a small Python AI Agent with Nevermined Payments Library integrated which receives a Youtube video URL and returns a summary of the transcription of the video."}),"\n",(0,s.jsx)(t.p,{children:"The Agent uses LangChain to retrieve the transcription and summarize it via OpenAI integration."}),"\n",(0,s.jsxs)(t.p,{children:["Here is the ",(0,s.jsx)(t.a,{href:"https://github.com/nevermined-io/youtube-agent/",children:"Youtube Summarizer Agent code"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"As you can see, the Agent is a simple Python script that implements a callback function to process the AI Tasks that are sent by the users."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"class YoutubeAgent:\n def __init__(self, payment):\n self.payment = payment\n\n async def run(self, data):\n print(\"Data received:\", data)\n step = self.payment.ai_protocol.get_step(data['step_id'])\n\n loader = YoutubeLoader.from_youtube_url(\n youtube_url=step['input_query'],\n add_video_info=False, \n language=[\"en\"],\n transcript_format=TranscriptFormat.CHUNKS, \n chunk_size_seconds=30,\n )\n # Load the documents from the video\n docs = loader.load()\n result = \" \".join(doc.page_content for doc in docs)\n\n llm = OpenAI(api_key=openai_api_key)\n summarize_chain = load_summarize_chain(llm, chain_type=\"map_reduce\")\n docs = [Document(page_content=result)]\n summary = summarize_chain.invoke(docs)\n print('Summary:', summary['output_text'])\n\n\n # Use the `payment` object to update the step\n self.payment.ai_protocol.update_step(\n did=data['did'],\n task_id=data['task_id'], \n step_id=data['step_id'],\n step={'step_id': data['step_id'],\n 'task_id': data[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': summary['output_text'],\n 'is_last': True\n },\n )\n"})}),"\n",(0,s.jsxs)(t.p,{children:["As you can see the fuction ",(0,s.jsx)(t.code,{children:"run"})," is the callback function that processes the AI Task. The function receives the data from the AI Task and uses it to process the task. In this case, the function uses the data to retrieve the Youtube video URL, transcribe it, and summarize it. After processing you have to update the step with the result."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:'async def main():\n # Initialize the Payments object\n payment = Payments(\n app_id="youtube_agent", \n nvm_api_key=nvm_api_key, \n version="1.0.0", \n environment=Environment.get_environment(environment), \n ai_protocol=True, \n web_socket_options={\'bearer_token\': nvm_api_key}\n )\n\n # Initialize the YoutubeAgent with the payment instance\n agent = YoutubeAgent(payment)\n\n # Subscribe to the ai_protocol with the agent\'s `run` method\n subscription_task = asyncio.get_event_loop().create_task(payment.ai_protocol.subscribe(agent.run, join_account_room=True))\n try:\n await subscription_task\n except asyncio.CancelledError:\n print("Subscription task was cancelled")\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"main"})," function initializes the Payments object and the YoutubeAgent object. Then it subscribes to the ai_protocol with the agent's ",(0,s.jsx)(t.code,{children:"run"})," method.\nIn this example we are asuming that the agent is processing the AI task in one step, but you can implement the agent to process multiple steps."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"class YoutubeAgent:\n def __init__(self, payment):\n self.payment = payment\n\n async def run(self, data):\n step = self.payment.ai_protocol.get_step(data['step_id'])\n if(step['step_status'] != AgentExecutionStatus.Pending.value):\n print('Step status is not pending')\n return\n \n if(step['name'] == 'init'):\n transcript_step_id = generate_step_id()\n self.payment.ai_protocol.create_steps(did=step['did'], task_id=step['task_id'], steps={\"steps\" : [{\n 'task_id': step['task_id'],\n 'step_id': transcript_step_id,\n 'input_query': step['input_query'],\n 'name': 'transcript',\n 'predecessor': step['step_id'],\n 'is_last': False,\n 'order': 2\n },\n { \n 'task_id': step['task_id'],\n 'step_id': generate_step_id(),\n 'predecessor': transcript_step_id,\n 'input_query': '',\n 'name': 'summarize',\n 'is_waiting': True, \n 'is_last': True,\n 'order': 3\n }]})\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'input_query': step['input_query'],\n 'output': step['input_query'],\n 'is_last': False\n },\n )\n \n elif (step['name'] == 'transcript'):\n loader = YoutubeLoader.from_youtube_url(\n youtube_url=step['input_query'],\n add_video_info=False, \n language=[\"en\"],\n transcript_format=TranscriptFormat.CHUNKS, \n chunk_size_seconds=30,\n )\n # Load the documents from the video\n docs = loader.load()\n result = \" \".join(doc.page_content for doc in docs)\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': result,\n 'is_last': False\n },\n )\n \n elif (step['name'] == 'summarize'):\n llm = OpenAI(api_key=openai_api_key)\n summarize_chain = load_summarize_chain(llm, chain_type=\"map_reduce\")\n docs = [Document(page_content=step[\"input_query\"])]\n summary = summarize_chain.invoke(docs)\n print('Summary:', summary['output_text'])\n # Use the `payment` object to update the step\n self.payment.ai_protocol.update_step(\n did=step['did'],\n task_id=step['task_id'], \n step_id=step['step_id'],\n step={'step_id': step['step_id'],\n 'task_id': step[\"task_id\"], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': summary['output_text'],\n 'is_last': True\n },\n )\n \n else:\n print(f\"Unknown step name: {step['name']}\")\n"})}),"\n",(0,s.jsx)(t.p,{children:"In this example, we are assuming that the agent is processing the AI task in multiple steps. The agent receives the data from the AI Task and uses it to process the task.\nAfter processing you have to update the step with the result. Automatically the output of the previous step is the input of the next step."}),"\n",(0,s.jsx)(t.h3,{id:"the-text-to-speech-agent-typescript",children:"The Text to Speech Agent (Typescript)"}),"\n",(0,s.jsx)(t.p,{children:"The Text to Speech Agent is a simple Typescript AI Agent with Nevermined Payments Library integrated which receives a text and returns an audio file with the speech of the text."}),"\n",(0,s.jsx)(t.p,{children:"The Agent uses OpenAPI to generate the audio file, which after the generation is uploaded to IPFS."}),"\n",(0,s.jsxs)(t.p,{children:["Here is the ",(0,s.jsx)(t.a,{href:"https://github.com/nevermined-io/agent-text2speech-js",children:"Text to Speech agent code"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["In this agent we created 2 separate implementations, one for a single step agent generating the audio file, and another integrating the above Youtube agent (",(0,s.jsx)(t.a,{href:"https://github.com/nevermined-io/agent-text2speech-js/blob/main/src/agent2agent.ts",children:"agent2agent implementation"}),")."]}),"\n",(0,s.jsx)(t.h3,{id:"simple-text-to-speech-agent-implementation",children:"Simple Text to Speech Agent implementation"}),"\n",(0,s.jsxs)(t.p,{children:["As you can see, the Agent is a ",(0,s.jsx)(t.a,{href:"https://github.com/nevermined-io/agent-text2speech-js/blob/main/src/main.ts",children:"simple Typescript code"})," that implements a callback function (",(0,s.jsx)(t.code,{children:"processSteps"}),") to process the AI Tasks that are sent by the users."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async function main() { \n openaiTools = new OpenAITools(OPEN_API_KEY!)\n payments = getPaymentsInstance(NVM_API_KEY!, NVM_ENVIRONMENT)\n logger.info(`Connected to Nevermined Network: ${NVM_ENVIRONMENT}`) \n\n await payments.query.subscribe(processSteps, opts)\n}\n\n// This callback function is invoked when a new AI Task is received\nasync function processSteps(data: any) {\n \n const eventData = JSON.parse(data)\n logger.info(`Received event: ${JSON.stringify(eventData)}`)\n const step = await payments.query.getStep(eventData.step_id) \n logger.info(`Processing Step ${step.task_id} - ${step.step_id} [ ${step.step_status} ]: ${step.input_query}`)\n \n if (step.step_status != AgentExecutionStatus.Pending) {\n logger.warn(`Step ${step.step_id} is not pending. Skipping...`)\n return\n }\n \n logger.info(`Generating Speech from input query`)\n const fileSpeech = await openaiTools.text2speech(step.input_query)\n logger.info(`Speech file generated: ${fileSpeech}`)\n const cid = await uploadSpeechFileToIPFS(fileSpeech)\n logger.info(`Speech file uploaded to IPFS: ${cid}`)\n\n\n const updateResult = await payments.query.updateStep(step.did, {\n ...step,\n step_status: AgentExecutionStatus.Completed,\n is_last: true,\n output: 'success', \n output_artifacts: [cid],\n cost: 5\n })\n if (updateResult.status === 201)\n logger.info(`Step ${step.step_id} completed!`)\n else\n logger.error(`Error updating step ${step.step_id} - ${JSON.stringify(updateResult.data)}`)\n}\n"})}),"\n",(0,s.jsx)(t.h3,{id:"agent2agent-implementation-youtube-to-speech",children:"Agent2Agent implementation (Youtube to Speech)"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"(Text2Speech + Youtube Summarizer) = Youtube2Speech\n"})}),"\n",(0,s.jsx)(t.p,{children:"In this example we are going to show you how to integrate an external agent (Youtube summarizer) in our agent. This is implemented using multiple steps."}),"\n",(0,s.jsxs)(t.p,{children:["First we implement our ",(0,s.jsx)(t.code,{children:"main"})," function to initialize the Payments object and subscribe to receive new tasks. This is as we saw before:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async function main() { \n openaiTools = new OpenAITools(OPEN_API_KEY!)\n payments = getPaymentsInstance(NVM_API_KEY!, NVM_ENVIRONMENT)\n logger.info(`Connected to Nevermined Network: ${NVM_ENVIRONMENT}`) \n\n await payments.query.subscribe(processSteps, opts)\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["But in this example our logic is a bit more sophisticated because when the ",(0,s.jsx)(t.code,{children:"processSteps"})," callback function is invoked, we check the step name to know which step we are processing."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async function processSteps(data: any) {\n \n const eventData = JSON.parse(data)\n logger.info(`Received event: ${JSON.stringify(eventData)}`)\n const step = await payments.query.getStep(eventData.step_id) \n logger.info(`Processing Step ${step.task_id} - ${step.step_id} [ ${step.step_status} ]: ${step.input_query}`)\n\n if (step.step_status != AgentExecutionStatus.Pending) {\n logger.warn(`Step ${step.step_id} is not pending. Skipping...`)\n return\n }\n \n // Check the step name to know which step we are processing\n\n // ....\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["When a new Task is created by the user, automatically is created a step with name ",(0,s.jsx)(t.code,{children:"init"}),". What we do in this case is create the execution plan of the task, which in our example involves 2 steps: ",(0,s.jsx)(t.code,{children:"transcribe"})," and ",(0,s.jsx)(t.code,{children:"text2speech"}),":"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"if (step.name === 'init') {\n logger.info(`Setting up steps necessary to resolve the task ...`)\n const transcribeStepId = generateStepId()\n const createResult = await payments.query.createSteps(step.did, step.task_id, { steps: [{\n step_id: transcribeStepId,\n task_id: step.task_id,\n predecessor: step.step_id,\n input_query: step.input_query, \n name: 'transcribe',\n is_last: false,\n cost: 20,\n order: 2\n }, { \n step_id: generateStepId(), \n task_id: step.task_id,\n predecessor: transcribeStepId, \n input_query: '',\n name: 'text2speech',\n is_last: true,\n order: 3\n }]})\n createResult.status === 201 ? logger.info('Steps created successfully') : logger.error(`Error creating steps: ${JSON.stringify(createResult.data)}`) \n\n const updateResult = await payments.query.updateStep(step.did, {\n ...step,\n step_status: AgentExecutionStatus.Completed,\n output: step.input_query\n })\n updateResult.status === 201 ? logger.info(`Step ${step.name} : ${step.step_id} completed!`) : logger.error(`Error updating step ${step.step_id} - ${JSON.stringify(updateResult.data)}`)\n\n } else if (step.name === 'transcribe') {\n // Here we integrate with the Youtube Summarizer agent\n\n } else if (step.name === 'text2speech') {\n // Here we generate the speech from the Youtube summarized text\n\n } else { \n logger.warn(`Step ${step.name} is not recognized. Skipping...`)\n return\n }\n\n"})}),"\n",(0,s.jsxs)(t.p,{children:["When the step ",(0,s.jsx)(t.code,{children:"init"})," is completed, it will add 2 additional steps to the task and our agent will receive the next step to process. Because the ",(0,s.jsx)(t.code,{children:"text2speech"})," steps depend on the completion of the ",(0,s.jsx)(t.code,{children:"transcribe"})," step, we will receive first that one, and there is where we integrate with the Youtube Summarizer:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:" } else if (step.name === 'transcribe') {\n logger.info(`Transcribing video to text with external agent ...`)\n\n // First we check if we have enough balance to query the Youtube AI Agent\n const balanceResult = await payments.getPlanBalance(PLAN_YOUTUBE_DID)\n logger.info(`Youtube Plan balance: ${balanceResult.balance}`)\n\n if (balanceResult.balance < 1) { // If we don't have enough balance, we order more credits\n logger.warn('Insufficient balance to query the Youtube AI Agent')\n logger.info('Ordering more credits...')\n await payments.orderPlan(PLAN_YOUTUBE_DID)\n }\n\n // Create the AI Task to query the Youtube Agent with the youtube video URL\n const aiTask = {\n query: step.input_query,\n name: \"transcribe\",\n \"additional_params\": [],\n \"artifacts\": []\n }\n\n logger.info(`Querying Youtube Agent DID: ${AGENT_YOUTUBE_DID} with input: ${step.input_query}`)\n\n // Get the JWT access token and the Proxy we must use to query theYoutube Agent\n const accessConfig = await payments.getServiceAccessConfig(AGENT_YOUTUBE_DID)\n\n // Create the task\n const taskResult = await payments.query.createTask(AGENT_YOUTUBE_DID, aiTask, accessConfig)\n\n if (taskResult.status !== 201) {\n logger.error(`Failed to create task: ${taskResult.data}`)\n return\n }\n logger.info(`Task created: ${JSON.stringify(taskResult.data)}`)\n\n const taskId = taskResult.data.task.task_id\n const did = taskResult.data.task.did\n\n let fullTask\n let resultFound = false\n let counter = 1\n\n // We iterate a few times until the task is completed\n while (counter <= MAX_RETRIES) {\n logger.info(`Checking Youtube task status for task ID [${counter}]: ${taskId}`)\n const fullTaskResult = await payments.query.getTaskWithSteps(did, taskId, accessConfig)\n \n if (fullTaskResult.status !== 200) {\n logger.error(`Failed to get Youtube task: ${fullTaskResult.data}`)\n process.exit(1) \n }\n fullTask = fullTaskResult.data.task\n logger.info(`Youtube Task status: ${JSON.stringify(fullTask.task_status)}`)\n if (fullTask.task_status === AgentExecutionStatus.Completed) {\n logger.info(`Youtube Task completed with cost: ${fullTask.cost}`)\n logger.info(` Output: ${fullTask.output}`)\n resultFound = true\n break\n } else if (fullTask.task_status === AgentExecutionStatus.Failed) {\n logger.error(`Task failed with message ${fullTask.output}`) \n break\n }\n counter++\n await sleep(SLEEP_INTERVAL)\n }\n\n let updateResult \n if (!resultFound) { // If for whatever reason the task is not completed in time, we update the step with the error\n logger.error('Task not completed in time')\n updateResult = await payments.query.updateStep(step.did, {\n ...step,\n step_status: AgentExecutionStatus.Failed,\n is_last: true,\n output: 'Task not completed in time '\n })\n } else { // If the task is completed, we update the step with the output result\n updateResult = await payments.query.updateStep(step.did, {\n ...step,\n step_status: AgentExecutionStatus.Completed,\n output: fullTask.output,\n output_additional: fullTask.output_additional,\n output_artifacts: fullTask.output_artifacts,\n cost: fullTask.cost\n })\n } \n\n"})}),"\n",(0,s.jsxs)(t.p,{children:["At this stage if everything worked correctly we must have a few credits and the summary of the Youtube video. Because the ",(0,s.jsx)(t.code,{children:"transcribe"})," is completed now we will receive an update on the ",(0,s.jsx)(t.code,{children:"text2speech"})," step, meaning now we can process that step:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"\n } else if (step.name === 'text2speech') {\n\n logger.info(`Converting text to audio ...`)\n const fileSpeech = await openaiTools.text2speech(step.input_query)\n logger.info(`Speech file generated: ${fileSpeech}`)\n const cid = await uploadSpeechFileToIPFS(fileSpeech)\n logger.info(`Speech file uploaded to IPFS: ${cid}`)\n \n const updateResult = await payments.query.updateStep(step.did, {\n ...step,\n step_status: AgentExecutionStatus.Completed,\n is_last: true,\n output: 'hey baby, we got this!',\n output_additional: '{\"result\": \"success\"}',\n output_artifacts: [cid],\n cost: 5\n })\n }\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If the ",(0,s.jsx)(t.code,{children:"text2speech"})," step is completed, we will update the step with the result of the audio file and the cost of the step. And because the ",(0,s.jsx)(t.code,{children:"text2speech"})," step is the last one, when we update the step this will resolve the whole task and calculate the total cost as the sum of all the individual cost of the steps."]}),"\n",(0,s.jsx)(t.h2,{id:"notebooks",children:"Notebooks"}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.a,{href:"https://colab.research.google.com/drive/1Pqrfm3P5t8P9DS7Hwp3v72jhRrB2KsP5#scrollTo=dghI-HwVgulp",children:"Python Notebook"})," example, we will show you how to use the Payments Library to create Payment Plans, register AI Agents, and query them."]})]})}function l(e={}){const{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>o});var s=n(7294);const a={},i=s.createContext(a);function o(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a424efa6.17153b7e.js b/assets/js/a424efa6.67485a6c.js similarity index 97% rename from assets/js/a424efa6.17153b7e.js rename to assets/js/a424efa6.67485a6c.js index dc5299cc..b5482e2a 100644 --- a/assets/js/a424efa6.17153b7e.js +++ b/assets/js/a424efa6.67485a6c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[2076],{990:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),o=s(9948);const i={sidebar_position:1,description:"Blog Posts"},a="The last 10 posts of Nevermined Medium",c={permalink:"/blog/index",editUrl:"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md",source:"@site/blog/index.md",title:"The last 10 posts of Nevermined Medium",description:"Blog Posts",date:"2024-10-30T13:50:51.000Z",tags:[],readingTime:.025,hasTruncateMarker:!1,authors:[],frontMatter:{sidebar_position:1,description:"Blog Posts"},unlisted:!1},l={authorsImageUrls:[]},d=[];function u(e){return(0,n.jsx)(o.Z,{})}function m(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u()}},9948:(e,t,s)=>{s.d(t,{Z:()=>l});var n=s(7294),r=s(6154);var o=s(6798),i=s(1446),a=s(5893);const c=(0,o.CY)("blog",{blog__title:"blog__title_Smim",blog__content:"blog__content_zw9B","blog__pub-data":"blog__pub-data_YBEj"}),l=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)((()=>{(async()=>{const e=(await r.Z.get("https://api.rss2json.com/v1/api.json",{params:{rss_url:"https://medium.com/feed/nevermined-io"}})).data.items.map((e=>{const t={...e};return t.content=(0,i.e)(e.content),t}));t([...e])})()}),[]),(0,a.jsx)("div",{children:e.map((e=>(0,a.jsxs)("div",{className:c("content"),children:[(0,a.jsx)(o.II,{type:"h1",className:c("title"),children:e.title}),(0,a.jsx)(o.II,{dangerouslySetInnerHTML:{__html:e.content},className:c("content")}),(0,a.jsxs)(o.II,{type:"small",className:c("pub-data"),children:[(0,a.jsx)("strong",{children:"Published:"})," ",e.pubDate]})]},e.title)))})}},1446:(e,t,s)=>{s.d(t,{e:()=>n,w:()=>r});const n=e=>{const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("a").forEach((e=>{if(e.hasAttribute("href")&&e.getAttribute("href").includes("/href")){const t=e.getAttribute("href"),s=document.createElement("img");e.parentElement.replaceChild(s,e),s.setAttribute("src",t),s.setAttribute("alt","Gift")}})),t.documentElement.innerHTML},r=(e,t)=>{const s=`script[src='${e}']`;if(document.querySelectorAll(s).length>0)return;const n=document.createElement("script");n.src=e,n.defer=!0,t.parentNode?.insertBefore(n,t)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[2076],{990:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),o=s(9948);const i={sidebar_position:1,description:"Blog Posts"},a="The last 10 posts of Nevermined Medium",c={permalink:"/blog/index",editUrl:"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md",source:"@site/blog/index.md",title:"The last 10 posts of Nevermined Medium",description:"Blog Posts",date:"2024-10-31T10:35:40.000Z",tags:[],readingTime:.025,hasTruncateMarker:!1,authors:[],frontMatter:{sidebar_position:1,description:"Blog Posts"},unlisted:!1},l={authorsImageUrls:[]},d=[];function u(e){return(0,n.jsx)(o.Z,{})}function m(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u()}},9948:(e,t,s)=>{s.d(t,{Z:()=>l});var n=s(7294),r=s(6154);var o=s(6798),i=s(1446),a=s(5893);const c=(0,o.CY)("blog",{blog__title:"blog__title_Smim",blog__content:"blog__content_zw9B","blog__pub-data":"blog__pub-data_YBEj"}),l=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)((()=>{(async()=>{const e=(await r.Z.get("https://api.rss2json.com/v1/api.json",{params:{rss_url:"https://medium.com/feed/nevermined-io"}})).data.items.map((e=>{const t={...e};return t.content=(0,i.e)(e.content),t}));t([...e])})()}),[]),(0,a.jsx)("div",{children:e.map((e=>(0,a.jsxs)("div",{className:c("content"),children:[(0,a.jsx)(o.II,{type:"h1",className:c("title"),children:e.title}),(0,a.jsx)(o.II,{dangerouslySetInnerHTML:{__html:e.content},className:c("content")}),(0,a.jsxs)(o.II,{type:"small",className:c("pub-data"),children:[(0,a.jsx)("strong",{children:"Published:"})," ",e.pubDate]})]},e.title)))})}},1446:(e,t,s)=>{s.d(t,{e:()=>n,w:()=>r});const n=e=>{const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("a").forEach((e=>{if(e.hasAttribute("href")&&e.getAttribute("href").includes("/href")){const t=e.getAttribute("href"),s=document.createElement("img");e.parentElement.replaceChild(s,e),s.setAttribute("src",t),s.setAttribute("alt","Gift")}})),t.documentElement.innerHTML},r=(e,t)=>{const s=`script[src='${e}']`;if(document.querySelectorAll(s).length>0)return;const n=document.createElement("script");n.src=e,n.defer=!0,t.parentNode?.insertBefore(n,t)}}}]); \ No newline at end of file diff --git a/assets/js/a65f7afd.0ec16059.js b/assets/js/a65f7afd.0ec16059.js deleted file mode 100644 index 8c581558..00000000 --- a/assets/js/a65f7afd.0ec16059.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[63],{1353:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var r=n(5893),i=n(1151),s=n(7922);const o={sidebar_position:1,description:"Get Started with the Tutorials"},a="Getting Started with the Tutorials",c={id:"tutorials/index",title:"Getting Started with the Tutorials",description:"Get Started with the Tutorials",source:"@site/docs/tutorials/index.mdx",sourceDirName:"tutorials",slug:"/tutorials/",permalink:"/docs/tutorials/",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/tutorials/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,description:"Get Started with the Tutorials"},sidebar:"tutorialSidebar",previous:{title:"Examples",permalink:"/docs/libraries/examples"},next:{title:"Getting started with the payments app",permalink:"/docs/tutorials/first-steps/"}},l={},u=[];function d(e){const t={a:"a",admonition:"admonition",h1:"h1",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"getting-started-with-the-tutorials",children:"Getting Started with the Tutorials"})}),"\n",(0,r.jsx)(t.p,{children:"Nevermined payments infrastructure enables the registration, subscription and monetization of AI agents."}),"\n",(0,r.jsx)(t.p,{children:"In the following tutorials, we explain how the Nevermined App can be used."}),"\n",(0,r.jsx)(t.p,{children:"These tutorials are a detailed guide for each of the different steps."}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["If you need further help or you miss a tutorial, feel free to let us know via ",(0,r.jsx)(t.a,{href:"https://discord.gg/GZju2qScKq",children:"Discord"})]})}),"\n","\n",(0,r.jsx)(s.Z,{})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},7922:(e,t,n)=>{n.d(t,{Z:()=>j});n(7294);var r=n(512),i=n(9690),s=n(3692),o=n(8824),a=n(3919),c=n(5999),l=n(1498);const u={cardContainer:"cardContainer_fWXF",cardTitle:"cardTitle_rnsV",cardDescription:"cardDescription_PWke"};var d=n(5893);function h(e){let{href:t,children:n}=e;return(0,d.jsx)(s.Z,{href:t,className:(0,r.Z)("card padding--lg",u.cardContainer),children:n})}function p(e){let{href:t,icon:n,title:i,description:s}=e;return(0,d.jsxs)(h,{href:t,children:[(0,d.jsxs)(l.Z,{as:"h2",className:(0,r.Z)("text--truncate",u.cardTitle),title:i,children:[n," ",i]}),s&&(0,d.jsx)("p",{className:(0,r.Z)("text--truncate",u.cardDescription),title:s,children:s})]})}function m(e){let{item:t}=e;const n=(0,i.LM)(t),r=function(){const{selectMessage:e}=(0,o.c)();return t=>e(t,(0,c.I)({message:"1 item|{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:t}))}();return n?(0,d.jsx)(p,{href:n,icon:"\ud83d\uddc3\ufe0f",title:t.label,description:t.description??r(t.items.length)}):null}function f(e){let{item:t}=e;const n=(0,a.Z)(t.href)?"\ud83d\udcc4\ufe0f":"\ud83d\udd17",r=(0,i.xz)(t.docId??void 0);return(0,d.jsx)(p,{href:t.href,icon:n,title:t.label,description:t.description??r?.description})}function x(e){let{item:t}=e;switch(t.type){case"link":return(0,d.jsx)(f,{item:t});case"category":return(0,d.jsx)(m,{item:t});default:throw new Error(`unknown item type ${JSON.stringify(t)}`)}}function g(e){let{className:t}=e;const n=(0,i.jA)();return(0,d.jsx)(j,{items:n.items,className:t})}function j(e){const{items:t,className:n}=e;if(!t)return(0,d.jsx)(g,{...e});const s=(0,i.MN)(t);return(0,d.jsx)("section",{className:(0,r.Z)("row",n),children:s.map(((e,t)=>(0,d.jsx)("article",{className:"col col--6 margin-bottom--lg",children:(0,d.jsx)(x,{item:e})},t)))})}},8824:(e,t,n)=>{n.d(t,{c:()=>l});var r=n(7294),i=n(2263);const s=["zero","one","two","few","many","other"];function o(e){return s.filter((t=>e.includes(t)))}const a={locale:"en",pluralForms:o(["one","other"]),select:e=>1===e?"one":"other"};function c(){const{i18n:{currentLocale:e}}=(0,i.Z)();return(0,r.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:o(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),a}}),[e])}function l(){const e=c();return{selectMessage:(t,n)=>function(e,t,n){const r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${r.length}: ${e}`);const i=n.select(t),s=n.pluralForms.indexOf(i);return r[Math.min(s,r.length-1)]}(n,t,e)}}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>o});var r=n(7294);const i={},s=r.createContext(i);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a65f7afd.28f3a787.js b/assets/js/a65f7afd.28f3a787.js new file mode 100644 index 00000000..1b2331aa --- /dev/null +++ b/assets/js/a65f7afd.28f3a787.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[63],{1353:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var r=n(5893),i=n(1151),s=n(7922);const o={sidebar_position:1,description:"Get Started with the Tutorials"},a="Getting Started with the Tutorials",c={id:"tutorials/index",title:"Getting Started with the Tutorials",description:"Get Started with the Tutorials",source:"@site/docs/tutorials/index.mdx",sourceDirName:"tutorials",slug:"/tutorials/",permalink:"/docs/tutorials/",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/tutorials/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,description:"Get Started with the Tutorials"},sidebar:"tutorialSidebar",previous:{title:"Code Examples",permalink:"/docs/libraries/examples"},next:{title:"Getting started with the payments app",permalink:"/docs/tutorials/first-steps/"}},l={},u=[];function d(e){const t={a:"a",admonition:"admonition",h1:"h1",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"getting-started-with-the-tutorials",children:"Getting Started with the Tutorials"})}),"\n",(0,r.jsx)(t.p,{children:"Nevermined payments infrastructure enables the registration, subscription and monetization of AI agents."}),"\n",(0,r.jsx)(t.p,{children:"In the following tutorials, we explain how the Nevermined App can be used."}),"\n",(0,r.jsx)(t.p,{children:"These tutorials are a detailed guide for each of the different steps."}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["If you need further help or you miss a tutorial, feel free to let us know via ",(0,r.jsx)(t.a,{href:"https://discord.gg/GZju2qScKq",children:"Discord"})]})}),"\n","\n",(0,r.jsx)(s.Z,{})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},7922:(e,t,n)=>{n.d(t,{Z:()=>j});n(7294);var r=n(512),i=n(9690),s=n(3692),o=n(8824),a=n(3919),c=n(5999),l=n(1498);const u={cardContainer:"cardContainer_fWXF",cardTitle:"cardTitle_rnsV",cardDescription:"cardDescription_PWke"};var d=n(5893);function h(e){let{href:t,children:n}=e;return(0,d.jsx)(s.Z,{href:t,className:(0,r.Z)("card padding--lg",u.cardContainer),children:n})}function p(e){let{href:t,icon:n,title:i,description:s}=e;return(0,d.jsxs)(h,{href:t,children:[(0,d.jsxs)(l.Z,{as:"h2",className:(0,r.Z)("text--truncate",u.cardTitle),title:i,children:[n," ",i]}),s&&(0,d.jsx)("p",{className:(0,r.Z)("text--truncate",u.cardDescription),title:s,children:s})]})}function m(e){let{item:t}=e;const n=(0,i.LM)(t),r=function(){const{selectMessage:e}=(0,o.c)();return t=>e(t,(0,c.I)({message:"1 item|{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:t}))}();return n?(0,d.jsx)(p,{href:n,icon:"\ud83d\uddc3\ufe0f",title:t.label,description:t.description??r(t.items.length)}):null}function f(e){let{item:t}=e;const n=(0,a.Z)(t.href)?"\ud83d\udcc4\ufe0f":"\ud83d\udd17",r=(0,i.xz)(t.docId??void 0);return(0,d.jsx)(p,{href:t.href,icon:n,title:t.label,description:t.description??r?.description})}function x(e){let{item:t}=e;switch(t.type){case"link":return(0,d.jsx)(f,{item:t});case"category":return(0,d.jsx)(m,{item:t});default:throw new Error(`unknown item type ${JSON.stringify(t)}`)}}function g(e){let{className:t}=e;const n=(0,i.jA)();return(0,d.jsx)(j,{items:n.items,className:t})}function j(e){const{items:t,className:n}=e;if(!t)return(0,d.jsx)(g,{...e});const s=(0,i.MN)(t);return(0,d.jsx)("section",{className:(0,r.Z)("row",n),children:s.map(((e,t)=>(0,d.jsx)("article",{className:"col col--6 margin-bottom--lg",children:(0,d.jsx)(x,{item:e})},t)))})}},8824:(e,t,n)=>{n.d(t,{c:()=>l});var r=n(7294),i=n(2263);const s=["zero","one","two","few","many","other"];function o(e){return s.filter((t=>e.includes(t)))}const a={locale:"en",pluralForms:o(["one","other"]),select:e=>1===e?"one":"other"};function c(){const{i18n:{currentLocale:e}}=(0,i.Z)();return(0,r.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:o(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),a}}),[e])}function l(){const e=c();return{selectMessage:(t,n)=>function(e,t,n){const r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${r.length}: ${e}`);const i=n.select(t),s=n.pluralForms.indexOf(i);return r[Math.min(s,r.length-1)]}(n,t,e)}}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>o});var r=n(7294);const i={},s=r.createContext(i);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dc016e2d.ef47dc56.js b/assets/js/dc016e2d.554cfe1e.js similarity index 97% rename from assets/js/dc016e2d.ef47dc56.js rename to assets/js/dc016e2d.554cfe1e.js index bf3882eb..1cb19ecf 100644 --- a/assets/js/dc016e2d.ef47dc56.js +++ b/assets/js/dc016e2d.554cfe1e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[5635],{1205:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),o=s(9948);const i={sidebar_position:1,description:"Blog Posts"},a="The last 10 posts of Nevermined Medium",c={permalink:"/blog/index",editUrl:"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md",source:"@site/blog/index.md",title:"The last 10 posts of Nevermined Medium",description:"Blog Posts",date:"2024-10-30T13:50:51.000Z",tags:[],readingTime:.025,hasTruncateMarker:!1,authors:[],frontMatter:{sidebar_position:1,description:"Blog Posts"},unlisted:!1},l={authorsImageUrls:[]},d=[];function u(e){return(0,n.jsx)(o.Z,{})}function m(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u()}},9948:(e,t,s)=>{s.d(t,{Z:()=>l});var n=s(7294),r=s(6154);var o=s(6798),i=s(1446),a=s(5893);const c=(0,o.CY)("blog",{blog__title:"blog__title_Smim",blog__content:"blog__content_zw9B","blog__pub-data":"blog__pub-data_YBEj"}),l=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)((()=>{(async()=>{const e=(await r.Z.get("https://api.rss2json.com/v1/api.json",{params:{rss_url:"https://medium.com/feed/nevermined-io"}})).data.items.map((e=>{const t={...e};return t.content=(0,i.e)(e.content),t}));t([...e])})()}),[]),(0,a.jsx)("div",{children:e.map((e=>(0,a.jsxs)("div",{className:c("content"),children:[(0,a.jsx)(o.II,{type:"h1",className:c("title"),children:e.title}),(0,a.jsx)(o.II,{dangerouslySetInnerHTML:{__html:e.content},className:c("content")}),(0,a.jsxs)(o.II,{type:"small",className:c("pub-data"),children:[(0,a.jsx)("strong",{children:"Published:"})," ",e.pubDate]})]},e.title)))})}},1446:(e,t,s)=>{s.d(t,{e:()=>n,w:()=>r});const n=e=>{const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("a").forEach((e=>{if(e.hasAttribute("href")&&e.getAttribute("href").includes("/href")){const t=e.getAttribute("href"),s=document.createElement("img");e.parentElement.replaceChild(s,e),s.setAttribute("src",t),s.setAttribute("alt","Gift")}})),t.documentElement.innerHTML},r=(e,t)=>{const s=`script[src='${e}']`;if(document.querySelectorAll(s).length>0)return;const n=document.createElement("script");n.src=e,n.defer=!0,t.parentNode?.insertBefore(n,t)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[5635],{1205:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),o=s(9948);const i={sidebar_position:1,description:"Blog Posts"},a="The last 10 posts of Nevermined Medium",c={permalink:"/blog/index",editUrl:"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md",source:"@site/blog/index.md",title:"The last 10 posts of Nevermined Medium",description:"Blog Posts",date:"2024-10-31T10:35:40.000Z",tags:[],readingTime:.025,hasTruncateMarker:!1,authors:[],frontMatter:{sidebar_position:1,description:"Blog Posts"},unlisted:!1},l={authorsImageUrls:[]},d=[];function u(e){return(0,n.jsx)(o.Z,{})}function m(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u()}},9948:(e,t,s)=>{s.d(t,{Z:()=>l});var n=s(7294),r=s(6154);var o=s(6798),i=s(1446),a=s(5893);const c=(0,o.CY)("blog",{blog__title:"blog__title_Smim",blog__content:"blog__content_zw9B","blog__pub-data":"blog__pub-data_YBEj"}),l=()=>{const[e,t]=(0,n.useState)([]);return(0,n.useEffect)((()=>{(async()=>{const e=(await r.Z.get("https://api.rss2json.com/v1/api.json",{params:{rss_url:"https://medium.com/feed/nevermined-io"}})).data.items.map((e=>{const t={...e};return t.content=(0,i.e)(e.content),t}));t([...e])})()}),[]),(0,a.jsx)("div",{children:e.map((e=>(0,a.jsxs)("div",{className:c("content"),children:[(0,a.jsx)(o.II,{type:"h1",className:c("title"),children:e.title}),(0,a.jsx)(o.II,{dangerouslySetInnerHTML:{__html:e.content},className:c("content")}),(0,a.jsxs)(o.II,{type:"small",className:c("pub-data"),children:[(0,a.jsx)("strong",{children:"Published:"})," ",e.pubDate]})]},e.title)))})}},1446:(e,t,s)=>{s.d(t,{e:()=>n,w:()=>r});const n=e=>{const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("a").forEach((e=>{if(e.hasAttribute("href")&&e.getAttribute("href").includes("/href")){const t=e.getAttribute("href"),s=document.createElement("img");e.parentElement.replaceChild(s,e),s.setAttribute("src",t),s.setAttribute("alt","Gift")}})),t.documentElement.innerHTML},r=(e,t)=>{const s=`script[src='${e}']`;if(document.querySelectorAll(s).length>0)return;const n=document.createElement("script");n.src=e,n.defer=!0,t.parentNode?.insertBefore(n,t)}}}]); \ No newline at end of file diff --git a/assets/js/f131da57.68ec4143.js b/assets/js/f131da57.68ec4143.js new file mode 100644 index 00000000..dc5ee396 --- /dev/null +++ b/assets/js/f131da57.68ec4143.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[9721],{4780:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),a=s(599),i=s(2983);const o={sidebar_position:8,description:"How AI Builders can process AI Tasks?"},l="How AI Builders can process AI Tasks?",c={id:"libraries/process-tasks",title:"How AI Builders can process AI Tasks?",description:"How AI Builders can process AI Tasks?",source:"@site/docs/libraries/08-process-tasks.md",sourceDirName:"libraries",slug:"/libraries/process-tasks",permalink:"/docs/libraries/process-tasks",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/libraries/08-process-tasks.md",tags:[],version:"current",sidebarPosition:8,frontMatter:{sidebar_position:8,description:"How AI Builders can process AI Tasks?"},sidebar:"tutorialSidebar",previous:{title:"How Subscribers can query AI Agents?",permalink:"/docs/libraries/query-agents"},next:{title:"Code Examples",permalink:"/docs/libraries/examples"}},u={},d=[{value:"Benefits of delegating the API to Nevermined AI Infrastructure",id:"benefits-of-delegating-the-api-to-nevermined-ai-infrastructure",level:2},{value:"How to process AI Tasks?",id:"how-to-process-ai-tasks",level:2},{value:"AI Tasks and Steps",id:"ai-tasks-and-steps",level:3}];function p(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"how-ai-builders-can-process-ai-tasks",children:"How AI Builders can process AI Tasks?"})}),"\n",(0,n.jsx)(t.admonition,{type:"note",children:(0,n.jsxs)(t.p,{children:["This feature is specific for AI Agents Services using the ",(0,n.jsx)("ins",{children:"Nevermined AI Hub"}),"."]})}),"\n",(0,n.jsx)(t.h2,{id:"benefits-of-delegating-the-api-to-nevermined-ai-infrastructure",children:"Benefits of delegating the API to Nevermined AI Infrastructure"}),"\n",(0,n.jsx)(t.p,{children:"When a AI Builder creates an AI Agent and delegates the maintenance and execution of the HTTP API to Nevermined, they can just focus in the AI piece. This has several benefits for them:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Focus on the AI"}),": The AI Builder can focus on the AI model and the AI Agent logic. Nevermined will take care of the execution of the API, authorization, etc."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Generic Interface"}),": The AI Agent will be accessible via a generic interface, the ",(0,n.jsx)(t.a,{href:"https://docs.nevermined.io/docs/protocol/query-protocol",children:"Nevermined Query Protocol"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Availability"}),": Nevermined will take care of having the AI Agent API available 24/7."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Scalability"}),": Nevermined will take care of the scaling of the AI Agent HTTP API."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"how-to-process-ai-tasks",children:"How to process AI Tasks?"}),"\n",(0,n.jsx)(t.p,{children:"The AI Builders can create simple worker AI process subscribing to Nevermined to retrieving the AI tasks sent by the users."}),"\n",(0,n.jsxs)(a.Z,{defaultValue:"python",values:[{label:"Python",value:"python"},{label:"Typescript",value:"typescript"}],children:[(0,n.jsx)(i.Z,{value:"python",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-python",children:"import asyncio\n\nasyncio.create_task(builder.ai_protocol.subscribe(callback_function, join_account_room=True, join_agent_rooms=[], subscribe_event_types=['step-updated'], get_pending_events_on_subscribe=True))\n\ncallback_function = (step) => {\n print('Step received', step)\n await payments.ai_protocol.update_step(did=step['did'], \n task_id=step['task_id'], \n step_id=step['step_id'], \n step={'step_id': step['step_id'],\n 'task_id': step['task_id'], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': 'success',\n 'is_last': True,\n 'cost': 1\n })\n}\n"})})}),(0,n.jsx)(i.Z,{value:"typescript",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typescript",children:"const opts = {\n joinAccountRoom: true, // To subscribe to all the events related to the account\n joinAgentRooms: [], // To which agents the agent wants to subscribe. This is useful for AI developers who want to process several agents tasks in parallel\n subscribeEventTypes: ['step-updated'], // To which events the agent wants to subscribe\n getPendingEventsOnSubscribe: true // To get the pending events when the agent connects\n}\n\nawait paymentsBuilder.query.subscribe(callbackFunction, opts)\n\nconst callbackFunction = (data: any) => {\n console.log('Step received', data)\n const step = JSON.parse(data)\n await paymentsBuilder.query.updateStep(step.did, {\n step_id: step.step_id,\n task_id: step.task_id,\n step_status: AgentExecutionStatus.Completed,\n is_last: true,\n output: 'LFG!',\n cost: 1\n })\n}\n"})})})]}),"\n",(0,n.jsx)(t.p,{children:"Using this, create an AI Agent is as simple as calling a subscribe and resolving the steps part of the tasks."}),"\n",(0,n.jsx)(t.p,{children:"As you can see in the above code, the agent can subscribe to the events related with AI tasks created by the users and process them. For doing that it just needs to implement a callback function that will get the AI task input parameters and process it."}),"\n",(0,n.jsx)(t.h3,{id:"ai-tasks-and-steps",children:"AI Tasks and Steps"}),"\n",(0,n.jsx)(t.p,{children:"The AI tasks are composed by several steps. Each step is a part of the task that the AI Agent needs to process. The steps are processed sequentially and the agent can update the status of the step and the output of the step. You can see the steps as a workflow that the AI Agent needs to process to be completed."}),"\n",(0,n.jsxs)(t.p,{children:["The AI Agent only needs to process the steps and update the status of the step and the output of the step. The rest of the logic is managed by ",(0,n.jsx)(t.strong,{children:"Nevermined AI Hub"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["When a user requests a task to an AI Agent, by default is created one task with one step. This first step has the ",(0,n.jsx)(t.strong,{children:'"init"'})," name. When the AI agent receives the ",(0,n.jsx)(t.strong,{children:"init"})," step can:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["If the AI task is simple and ",(0,n.jsx)(t.strong,{children:"doesn't require several steps"}),", it can process the step and update the status of the step to ",(0,n.jsx)(t.strong,{children:"Completed"})," and the ",(0,n.jsx)(t.strong,{children:"is_last"})," attribute as ",(0,n.jsx)(t.strong,{children:"true"}),". This will mark the whole task as completed."]}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["If the AI task requires ",(0,n.jsx)(t.strong,{children:"multiple steps"}),", the AI Agent can create more steps and setup the order of execution and configuration of them. This can be done by defining the ",(0,n.jsx)(t.strong,{children:"name"}),", ",(0,n.jsx)(t.strong,{children:"order"})," and ",(0,n.jsx)(t.strong,{children:"predecessor"})," step."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"We will see different code examples about how to do this in the following section."})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},2983:(e,t,s)=>{s.d(t,{Z:()=>i});s(7294);var n=s(512);const r={tabItem:"tabItem_Ymn6"};var a=s(5893);function i(e){let{children:t,hidden:s,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.Z)(r.tabItem,i),hidden:s,children:t})}},599:(e,t,s)=>{s.d(t,{Z:()=>k});var n=s(7294),r=s(512),a=s(2466),i=s(6550),o=s(469),l=s(1980),c=s(7392),u=s(812);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:s}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:s,attributes:n,default:r}}=e;return{value:t,label:s,attributes:n,default:r}}))}(s);return function(e){const t=(0,c.lx)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,s])}function h(e){let{value:t,tabValues:s}=e;return s.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:s}=e;const r=(0,i.k6)(),a=function(e){let{queryString:t=!1,groupId:s}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:t,groupId:s});return[(0,l._X)(a),(0,n.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(r.location.search);t.set(a,e),r.replace({...r.location,search:t.toString()})}),[a,r])]}function f(e){const{defaultValue:t,queryString:s=!1,groupId:r}=e,a=p(e),[i,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=s.find((e=>e.default))??s[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:a}))),[c,d]=b({queryString:s,groupId:r}),[f,m]=function(e){let{groupId:t}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,a]=(0,u.Nk)(s);return[r,(0,n.useCallback)((e=>{s&&a.set(e)}),[s,a])]}({groupId:r}),g=(()=>{const e=c??f;return h({value:e,tabValues:a})?e:null})();(0,o.Z)((()=>{g&&l(g)}),[g]);return{selectedValue:i,selectValue:(0,n.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),m(e)}),[d,m,a]),tabValues:a}}var m=s(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=s(5893);function x(e){let{className:t,block:s,selectedValue:n,selectValue:i,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.o5)(),u=e=>{const t=e.currentTarget,s=l.indexOf(t),r=o[s].value;r!==n&&(c(t),i(r))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=l.indexOf(e.currentTarget)+1;t=l[s]??l[0];break}case"ArrowLeft":{const s=l.indexOf(e.currentTarget)-1;t=l[s]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},t),children:o.map((e=>{let{value:t,label:s,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:u,...a,className:(0,r.Z)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":n===t}),children:s??t},t)}))})}function A(e){let{lazy:t,children:s,selectedValue:a}=e;const i=(Array.isArray(s)?s:[s]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:(0,r.Z)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function I(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...t,...e}),(0,v.jsx)(A,{...t,...e})]})}function k(e){const t=(0,m.Z)();return(0,v.jsx)(I,{...e,children:d(e.children)},String(t))}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>i});var n=s(7294);const r={},a=n.createContext(r);function i(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f131da57.ef609d0c.js b/assets/js/f131da57.ef609d0c.js deleted file mode 100644 index 2b41a245..00000000 --- a/assets/js/f131da57.ef609d0c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[9721],{4780:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var n=s(5893),r=s(1151),a=s(599),i=s(2983);const o={sidebar_position:8,description:"How AI Builders can process AI Tasks?"},l="How AI Builders can process AI Tasks?",c={id:"libraries/process-tasks",title:"How AI Builders can process AI Tasks?",description:"How AI Builders can process AI Tasks?",source:"@site/docs/libraries/08-process-tasks.md",sourceDirName:"libraries",slug:"/libraries/process-tasks",permalink:"/docs/libraries/process-tasks",draft:!1,unlisted:!1,editUrl:"https://github.com/nevermined-io/app_docs/tree/main/docs/libraries/08-process-tasks.md",tags:[],version:"current",sidebarPosition:8,frontMatter:{sidebar_position:8,description:"How AI Builders can process AI Tasks?"},sidebar:"tutorialSidebar",previous:{title:"How Subscribers can query AI Agents?",permalink:"/docs/libraries/query-agents"},next:{title:"Examples",permalink:"/docs/libraries/examples"}},u={},d=[{value:"Benefits of delegating the API to Nevermined AI Infrastructure",id:"benefits-of-delegating-the-api-to-nevermined-ai-infrastructure",level:2},{value:"How to process AI Tasks?",id:"how-to-process-ai-tasks",level:2},{value:"AI Tasks and Steps",id:"ai-tasks-and-steps",level:3}];function p(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"how-ai-builders-can-process-ai-tasks",children:"How AI Builders can process AI Tasks?"})}),"\n",(0,n.jsx)(t.admonition,{type:"note",children:(0,n.jsxs)(t.p,{children:["This feature is specific for AI Agents Services using the ",(0,n.jsx)("ins",{children:"Nevermined AI Hub"}),"."]})}),"\n",(0,n.jsx)(t.h2,{id:"benefits-of-delegating-the-api-to-nevermined-ai-infrastructure",children:"Benefits of delegating the API to Nevermined AI Infrastructure"}),"\n",(0,n.jsx)(t.p,{children:"When a AI Builder creates an AI Agent and delegates the maintenance and execution of the HTTP API to Nevermined, they can just focus in the AI piece. This has several benefits for them:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Focus on the AI"}),": The AI Builder can focus on the AI model and the AI Agent logic. Nevermined will take care of the execution of the API, authorization, etc."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Generic Interface"}),": The AI Agent will be accessible via a generic interface, the ",(0,n.jsx)(t.a,{href:"https://docs.nevermined.io/docs/protocol/query-protocol",children:"Nevermined Query Protocol"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Availability"}),": Nevermined will take care of having the AI Agent API available 24/7."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Scalability"}),": Nevermined will take care of the scaling of the AI Agent HTTP API."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"how-to-process-ai-tasks",children:"How to process AI Tasks?"}),"\n",(0,n.jsx)(t.p,{children:"The AI Builders can create simple worker AI process subscribing to Nevermined to retrieving the AI tasks sent by the users."}),"\n",(0,n.jsxs)(a.Z,{defaultValue:"python",values:[{label:"Python",value:"python"},{label:"Typescript",value:"typescript"}],children:[(0,n.jsx)(i.Z,{value:"python",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-python",children:"import asyncio\n\nasyncio.create_task(builder.ai_protocol.subscribe(callback_function, join_account_room=True, join_agent_rooms=[], subscribe_event_types=['step-updated'], get_pending_events_on_subscribe=True))\n\ncallback_function = (step) => {\n print('Step received', step)\n await payments.ai_protocol.update_step(did=step['did'], \n task_id=step['task_id'], \n step_id=step['step_id'], \n step={'step_id': step['step_id'],\n 'task_id': step['task_id'], \n 'step_status': AgentExecutionStatus.Completed.value,\n 'output': 'success',\n 'is_last': True,\n 'cost': 1\n })\n}\n"})})}),(0,n.jsx)(i.Z,{value:"typescript",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typescript",children:"const opts = {\n joinAccountRoom: true, // To subscribe to all the events related to the account\n joinAgentRooms: [], // To which agents the agent wants to subscribe. This is useful for AI developers who want to process several agents tasks in parallel\n subscribeEventTypes: ['step-updated'], // To which events the agent wants to subscribe\n getPendingEventsOnSubscribe: true // To get the pending events when the agent connects\n}\n\nawait paymentsBuilder.query.subscribe(callbackFunction, opts)\n\nconst callbackFunction = (data: any) => {\n console.log('Step received', data)\n const step = JSON.parse(data)\n await paymentsBuilder.query.updateStep(step.did, {\n step_id: step.step_id,\n task_id: step.task_id,\n step_status: AgentExecutionStatus.Completed,\n is_last: true,\n output: 'LFG!',\n cost: 1\n })\n}\n"})})})]}),"\n",(0,n.jsx)(t.p,{children:"Using this, create an AI Agent is as simple as calling a subscribe and resolving the steps part of the tasks."}),"\n",(0,n.jsx)(t.p,{children:"As you can see in the above code, the agent can subscribe to the events related with AI tasks created by the users and process them. For doing that it just needs to implement a callback function that will get the AI task input parameters and process it."}),"\n",(0,n.jsx)(t.h3,{id:"ai-tasks-and-steps",children:"AI Tasks and Steps"}),"\n",(0,n.jsx)(t.p,{children:"The AI tasks are composed by several steps. Each step is a part of the task that the AI Agent needs to process. The steps are processed sequentially and the agent can update the status of the step and the output of the step. You can see the steps as a workflow that the AI Agent needs to process to be completed."}),"\n",(0,n.jsxs)(t.p,{children:["The AI Agent only needs to process the steps and update the status of the step and the output of the step. The rest of the logic is managed by ",(0,n.jsx)(t.strong,{children:"Nevermined AI Hub"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["When a user requests a task to an AI Agent, by default is created one task with one step. This first step has the ",(0,n.jsx)(t.strong,{children:'"init"'})," name. When the AI agent receives the ",(0,n.jsx)(t.strong,{children:"init"})," step can:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["If the AI task is simple and ",(0,n.jsx)(t.strong,{children:"doesn't require several steps"}),", it can process the step and update the status of the step to ",(0,n.jsx)(t.strong,{children:"Completed"})," and the ",(0,n.jsx)(t.strong,{children:"is_last"})," attribute as ",(0,n.jsx)(t.strong,{children:"true"}),". This will mark the whole task as completed."]}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["If the AI task requires ",(0,n.jsx)(t.strong,{children:"multiple steps"}),", the AI Agent can create more steps and setup the order of execution and configuration of them. This can be done by defining the ",(0,n.jsx)(t.strong,{children:"name"}),", ",(0,n.jsx)(t.strong,{children:"order"})," and ",(0,n.jsx)(t.strong,{children:"predecessor"})," step."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"We will see different code examples about how to do this in the following section."})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},2983:(e,t,s)=>{s.d(t,{Z:()=>i});s(7294);var n=s(512);const r={tabItem:"tabItem_Ymn6"};var a=s(5893);function i(e){let{children:t,hidden:s,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.Z)(r.tabItem,i),hidden:s,children:t})}},599:(e,t,s)=>{s.d(t,{Z:()=>k});var n=s(7294),r=s(512),a=s(2466),i=s(6550),o=s(469),l=s(1980),c=s(7392),u=s(812);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:s}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:s,attributes:n,default:r}}=e;return{value:t,label:s,attributes:n,default:r}}))}(s);return function(e){const t=(0,c.lx)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,s])}function h(e){let{value:t,tabValues:s}=e;return s.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:s}=e;const r=(0,i.k6)(),a=function(e){let{queryString:t=!1,groupId:s}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:t,groupId:s});return[(0,l._X)(a),(0,n.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(r.location.search);t.set(a,e),r.replace({...r.location,search:t.toString()})}),[a,r])]}function f(e){const{defaultValue:t,queryString:s=!1,groupId:r}=e,a=p(e),[i,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=s.find((e=>e.default))??s[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:a}))),[c,d]=b({queryString:s,groupId:r}),[f,m]=function(e){let{groupId:t}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,a]=(0,u.Nk)(s);return[r,(0,n.useCallback)((e=>{s&&a.set(e)}),[s,a])]}({groupId:r}),g=(()=>{const e=c??f;return h({value:e,tabValues:a})?e:null})();(0,o.Z)((()=>{g&&l(g)}),[g]);return{selectedValue:i,selectValue:(0,n.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),m(e)}),[d,m,a]),tabValues:a}}var m=s(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=s(5893);function x(e){let{className:t,block:s,selectedValue:n,selectValue:i,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.o5)(),u=e=>{const t=e.currentTarget,s=l.indexOf(t),r=o[s].value;r!==n&&(c(t),i(r))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=l.indexOf(e.currentTarget)+1;t=l[s]??l[0];break}case"ArrowLeft":{const s=l.indexOf(e.currentTarget)-1;t=l[s]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},t),children:o.map((e=>{let{value:t,label:s,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:u,...a,className:(0,r.Z)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":n===t}),children:s??t},t)}))})}function A(e){let{lazy:t,children:s,selectedValue:a}=e;const i=(Array.isArray(s)?s:[s]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:(0,r.Z)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function I(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...t,...e}),(0,v.jsx)(A,{...t,...e})]})}function k(e){const t=(0,m.Z)();return(0,v.jsx)(I,{...e,children:d(e.children)},String(t))}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>i});var n=s(7294);const r={},a=n.createContext(r);function i(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f81c1134.00dff4d0.js b/assets/js/f81c1134.6091c7f1.js similarity index 90% rename from assets/js/f81c1134.00dff4d0.js rename to assets/js/f81c1134.6091c7f1.js index 2f39d007..97c94dde 100644 --- a/assets/js/f81c1134.00dff4d0.js +++ b/assets/js/f81c1134.6091c7f1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[4031],{4108:e=>{e.exports=JSON.parse('{"archive":{"blogPosts":[{"id":"/index","metadata":{"permalink":"/blog/index","editUrl":"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md","source":"@site/blog/index.md","title":"The last 10 posts of Nevermined Medium","description":"Blog Posts","date":"2024-10-30T13:50:51.000Z","tags":[],"readingTime":0.025,"hasTruncateMarker":false,"authors":[],"frontMatter":{"sidebar_position":1,"description":"Blog Posts"},"unlisted":false},"content":"import Blog from \'@site/src/components/blog\'\\n\\n\\n"}]}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkapp_docs=self.webpackChunkapp_docs||[]).push([[4031],{4108:e=>{e.exports=JSON.parse('{"archive":{"blogPosts":[{"id":"/index","metadata":{"permalink":"/blog/index","editUrl":"https://github.com/nevermined-io/docs/tree/main/blog/blog/index.md","source":"@site/blog/index.md","title":"The last 10 posts of Nevermined Medium","description":"Blog Posts","date":"2024-10-31T10:35:40.000Z","tags":[],"readingTime":0.025,"hasTruncateMarker":false,"authors":[],"frontMatter":{"sidebar_position":1,"description":"Blog Posts"},"unlisted":false},"content":"import Blog from \'@site/src/components/blog\'\\n\\n\\n"}]}}')}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.446f10fc.js b/assets/js/runtime~main.3820f96e.js similarity index 93% rename from assets/js/runtime~main.446f10fc.js rename to assets/js/runtime~main.3820f96e.js index 384e386f..52b8852c 100644 --- a/assets/js/runtime~main.446f10fc.js +++ b/assets/js/runtime~main.3820f96e.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,d,c,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(a,d,c,f)=>{if(!d){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[d,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({63:"a65f7afd",247:"3c9c17d2",291:"7207d74b",389:"f80e2372",560:"a577ebb3",693:"6ec39002",864:"2ddd6fbe",1004:"c141421f",1615:"74fadb6d",2076:"a424efa6",2334:"858d5bff",2535:"814f3328",2644:"ef8b811a",3041:"dea0208e",3055:"6d9b6a5a",3063:"bc32bcc3",3085:"1f391b9e",3089:"a6aa9e1f",3119:"d373d261",3237:"1df93b7f",3300:"38d46fd3",3331:"3c8c6129",3608:"9e4087bc",3629:"aba21aa0",3685:"da3258be",3802:"b6411edf",3940:"621db11d",4031:"f81c1134",4076:"df7def65",4088:"0058b4c6",4368:"a94703ab",4478:"3cd5d413",4487:"2dbc02d3",4495:"f831d4f1",4876:"b5983b37",5635:"dc016e2d",5980:"a7456010",6103:"ccc49370",6244:"3d78d92d",6386:"4251ab3c",6474:"7afef3c8",6534:"3bc23d46",6585:"726218d9",6642:"c15d9823",6664:"731fd987",6682:"b925cc90",6802:"40463571",6890:"8351d233",6924:"103cc76e",7094:"44129a2e",7104:"6471d683",7213:"3d7d3b3a",7223:"6948ba69",7393:"acecf23e",7414:"393be207",7520:"9d6e3b59",7869:"3bfec896",7918:"17896441",7920:"1a4e3797",7977:"426e2a8b",8071:"12286e25",8284:"156c0d84",8338:"15d99295",8518:"a7bd4aaa",8574:"0b8acbe3",8704:"7814abbf",8956:"9f887a94",8962:"e04b2c0d",9075:"6dd03e4b",9186:"1a07946f",9208:"36994c47",9320:"8a87d575",9476:"8ad336ef",9607:"05a5603c",9615:"cc4637c6",9661:"5e95c892",9666:"afc2d06d",9680:"329b34bf",9721:"f131da57",9761:"cf15052a",9781:"62c56792",9861:"bb14d73a"}[e]||e)+"."+{63:"0ec16059",247:"d0fc5afd",291:"9a4fec6e",389:"b9c68b72",560:"ebadb1ce",625:"d3e74d3a",693:"7b6e4a19",715:"68f669ee",864:"225cea44",1004:"dd871650",1024:"f3d3a91b",1426:"8f70080f",1615:"7c373237",1702:"56a328e9",1772:"47898930",2076:"17153b7e",2334:"284d62f9",2535:"338bbe3b",2644:"04fab2fb",3041:"91bb90b8",3055:"fa435552",3063:"65b0846c",3085:"f0dbec8f",3089:"4c06bc61",3119:"102e58ea",3237:"e8e2f1a0",3300:"b04dee1e",3331:"ff35f665",3608:"e006838d",3629:"59dcce29",3685:"93a173a0",3802:"fbcfc282",3940:"40633cca",4031:"00dff4d0",4076:"cce2a457",4088:"aa29e756",4368:"481107d0",4478:"dee58d89",4487:"388feba3",4495:"8665a50d",4876:"81c0ab18",5635:"ef47dc56",5980:"195a599f",6103:"56fbd5df",6244:"9098b32e",6386:"d9933535",6474:"c5653412",6534:"ea47aa90",6585:"6ef26516",6642:"3d96721c",6664:"e854ee6e",6682:"6aef9e5d",6798:"bc599093",6802:"c0ca31c6",6890:"6e2f8b76",6924:"63cfb291",6945:"f5dc62a8",7094:"1978c84e",7104:"03748270",7213:"f7e23560",7223:"ff420ebb",7393:"3082c2e3",7414:"55a67c5f",7520:"cd58548b",7869:"78443be5",7918:"ca283cf5",7920:"6fb43fdf",7977:"e06444e2",8071:"14aab5a6",8284:"828fde0a",8338:"576e6162",8518:"27a85759",8574:"4c0f3b87",8704:"c089dde3",8956:"ff0959e5",8962:"76019eb6",9075:"79b2f33d",9186:"870ff31b",9208:"f74d431f",9320:"b055ed7a",9476:"2f63f78e",9607:"75864b38",9615:"dc944c91",9661:"1a2f8076",9666:"42224303",9680:"67be0dd6",9721:"ef609d0c",9761:"00a84a09",9781:"945480a3",9861:"c915b4f2"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="app_docs:",r.l=(e,a,d,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(d))),a)return a(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"7918",40463571:"6802",a65f7afd:"63","3c9c17d2":"247","7207d74b":"291",f80e2372:"389",a577ebb3:"560","6ec39002":"693","2ddd6fbe":"864",c141421f:"1004","74fadb6d":"1615",a424efa6:"2076","858d5bff":"2334","814f3328":"2535",ef8b811a:"2644",dea0208e:"3041","6d9b6a5a":"3055",bc32bcc3:"3063","1f391b9e":"3085",a6aa9e1f:"3089",d373d261:"3119","1df93b7f":"3237","38d46fd3":"3300","3c8c6129":"3331","9e4087bc":"3608",aba21aa0:"3629",da3258be:"3685",b6411edf:"3802","621db11d":"3940",f81c1134:"4031",df7def65:"4076","0058b4c6":"4088",a94703ab:"4368","3cd5d413":"4478","2dbc02d3":"4487",f831d4f1:"4495",b5983b37:"4876",dc016e2d:"5635",a7456010:"5980",ccc49370:"6103","3d78d92d":"6244","4251ab3c":"6386","7afef3c8":"6474","3bc23d46":"6534","726218d9":"6585",c15d9823:"6642","731fd987":"6664",b925cc90:"6682","8351d233":"6890","103cc76e":"6924","44129a2e":"7094","6471d683":"7104","3d7d3b3a":"7213","6948ba69":"7223",acecf23e:"7393","393be207":"7414","9d6e3b59":"7520","3bfec896":"7869","1a4e3797":"7920","426e2a8b":"7977","12286e25":"8071","156c0d84":"8284","15d99295":"8338",a7bd4aaa:"8518","0b8acbe3":"8574","7814abbf":"8704","9f887a94":"8956",e04b2c0d:"8962","6dd03e4b":"9075","1a07946f":"9186","36994c47":"9208","8a87d575":"9320","8ad336ef":"9476","05a5603c":"9607",cc4637c6:"9615","5e95c892":"9661",afc2d06d:"9666","329b34bf":"9680",f131da57:"9721",cf15052a:"9761","62c56792":"9781",bb14d73a:"9861"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,d)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((d,f)=>c=e[a]=[d,f]));d.push(c[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var c,f,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(d);n{"use strict";var e,a,d,c,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(a,d,c,f)=>{if(!d){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[d,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,d({}),d([]),d(d)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({63:"a65f7afd",247:"3c9c17d2",291:"7207d74b",389:"f80e2372",560:"a577ebb3",693:"6ec39002",864:"2ddd6fbe",1004:"c141421f",1615:"74fadb6d",2076:"a424efa6",2334:"858d5bff",2535:"814f3328",2644:"ef8b811a",3041:"dea0208e",3055:"6d9b6a5a",3063:"bc32bcc3",3085:"1f391b9e",3089:"a6aa9e1f",3119:"d373d261",3237:"1df93b7f",3300:"38d46fd3",3331:"3c8c6129",3608:"9e4087bc",3629:"aba21aa0",3685:"da3258be",3802:"b6411edf",3940:"621db11d",4031:"f81c1134",4076:"df7def65",4088:"0058b4c6",4368:"a94703ab",4478:"3cd5d413",4487:"2dbc02d3",4495:"f831d4f1",4876:"b5983b37",5635:"dc016e2d",5980:"a7456010",6103:"ccc49370",6244:"3d78d92d",6386:"4251ab3c",6474:"7afef3c8",6534:"3bc23d46",6585:"726218d9",6642:"c15d9823",6664:"731fd987",6682:"b925cc90",6802:"40463571",6890:"8351d233",6924:"103cc76e",7094:"44129a2e",7104:"6471d683",7213:"3d7d3b3a",7223:"6948ba69",7393:"acecf23e",7414:"393be207",7520:"9d6e3b59",7869:"3bfec896",7918:"17896441",7920:"1a4e3797",7977:"426e2a8b",8071:"12286e25",8284:"156c0d84",8338:"15d99295",8518:"a7bd4aaa",8574:"0b8acbe3",8704:"7814abbf",8956:"9f887a94",8962:"e04b2c0d",9075:"6dd03e4b",9186:"1a07946f",9208:"36994c47",9320:"8a87d575",9476:"8ad336ef",9607:"05a5603c",9615:"cc4637c6",9661:"5e95c892",9666:"afc2d06d",9680:"329b34bf",9721:"f131da57",9761:"cf15052a",9781:"62c56792",9861:"bb14d73a"}[e]||e)+"."+{63:"28f3a787",247:"d0fc5afd",291:"9a4fec6e",389:"b9c68b72",560:"ebadb1ce",625:"d3e74d3a",693:"7b6e4a19",715:"68f669ee",864:"225cea44",1004:"dd871650",1024:"f3d3a91b",1426:"8f70080f",1615:"7c373237",1702:"56a328e9",1772:"47898930",2076:"67485a6c",2334:"284d62f9",2535:"338bbe3b",2644:"04fab2fb",3041:"91bb90b8",3055:"fa435552",3063:"65b0846c",3085:"f0dbec8f",3089:"4c06bc61",3119:"102e58ea",3237:"e8e2f1a0",3300:"b04dee1e",3331:"ff35f665",3608:"e006838d",3629:"59dcce29",3685:"93a173a0",3802:"fbcfc282",3940:"40633cca",4031:"6091c7f1",4076:"cce2a457",4088:"dfad8fe3",4368:"481107d0",4478:"dee58d89",4487:"388feba3",4495:"8665a50d",4876:"81c0ab18",5635:"554cfe1e",5980:"195a599f",6103:"56fbd5df",6244:"9098b32e",6386:"d9933535",6474:"c5653412",6534:"ea47aa90",6585:"6ef26516",6642:"3d96721c",6664:"e854ee6e",6682:"6aef9e5d",6798:"bc599093",6802:"c0ca31c6",6890:"6e2f8b76",6924:"63cfb291",6945:"f5dc62a8",7094:"1978c84e",7104:"03748270",7213:"f7e23560",7223:"ff420ebb",7393:"3082c2e3",7414:"55a67c5f",7520:"cd58548b",7869:"78443be5",7918:"ca283cf5",7920:"6fb43fdf",7977:"e06444e2",8071:"14aab5a6",8284:"828fde0a",8338:"576e6162",8518:"27a85759",8574:"4c0f3b87",8704:"c089dde3",8956:"ff0959e5",8962:"76019eb6",9075:"79b2f33d",9186:"870ff31b",9208:"f74d431f",9320:"b055ed7a",9476:"343653ae",9607:"75864b38",9615:"dc944c91",9661:"1a2f8076",9666:"42224303",9680:"67be0dd6",9721:"68ec4143",9761:"00a84a09",9781:"945480a3",9861:"c915b4f2"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="app_docs:",r.l=(e,a,d,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(d))),a)return a(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"7918",40463571:"6802",a65f7afd:"63","3c9c17d2":"247","7207d74b":"291",f80e2372:"389",a577ebb3:"560","6ec39002":"693","2ddd6fbe":"864",c141421f:"1004","74fadb6d":"1615",a424efa6:"2076","858d5bff":"2334","814f3328":"2535",ef8b811a:"2644",dea0208e:"3041","6d9b6a5a":"3055",bc32bcc3:"3063","1f391b9e":"3085",a6aa9e1f:"3089",d373d261:"3119","1df93b7f":"3237","38d46fd3":"3300","3c8c6129":"3331","9e4087bc":"3608",aba21aa0:"3629",da3258be:"3685",b6411edf:"3802","621db11d":"3940",f81c1134:"4031",df7def65:"4076","0058b4c6":"4088",a94703ab:"4368","3cd5d413":"4478","2dbc02d3":"4487",f831d4f1:"4495",b5983b37:"4876",dc016e2d:"5635",a7456010:"5980",ccc49370:"6103","3d78d92d":"6244","4251ab3c":"6386","7afef3c8":"6474","3bc23d46":"6534","726218d9":"6585",c15d9823:"6642","731fd987":"6664",b925cc90:"6682","8351d233":"6890","103cc76e":"6924","44129a2e":"7094","6471d683":"7104","3d7d3b3a":"7213","6948ba69":"7223",acecf23e:"7393","393be207":"7414","9d6e3b59":"7520","3bfec896":"7869","1a4e3797":"7920","426e2a8b":"7977","12286e25":"8071","156c0d84":"8284","15d99295":"8338",a7bd4aaa:"8518","0b8acbe3":"8574","7814abbf":"8704","9f887a94":"8956",e04b2c0d:"8962","6dd03e4b":"9075","1a07946f":"9186","36994c47":"9208","8a87d575":"9320","8ad336ef":"9476","05a5603c":"9607",cc4637c6:"9615","5e95c892":"9661",afc2d06d:"9666","329b34bf":"9680",f131da57:"9721",cf15052a:"9761","62c56792":"9781",bb14d73a:"9861"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,d)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((d,f)=>c=e[a]=[d,f]));d.push(c[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(d=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var c,f,b=d[0],t=d[1],o=d[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(d);n