
[title] Vision
[path] Introduction/

We foresee a future where AI agents transform into valuable assets and become pivotal in generating revenue across diverse consumer applications.




[title] Mission
[path] Introduction/



To create an open platform that empowers everyone to develop, deploy, and monetize AI Agents and AI Models tailored to address real-world needs.&#x20;



The mission focuses on democratizing AI development by lowering barriers for both professional and non-professional creators, thereby enabling innovative AI solutions accessible to all.

[title] Introduction
[path] /

By reading the following information, you can learn about Web3 AI Agent and get to know the AGI Open Network project.

# What is an AI Agent?&#x20;

An AI Agent is an intelligent software entity that can perceive its environment, make decisions, and take actions autonomously to achieve specific goals. It uses artificial intelligence techniques and algorithms to interact with the world around it.

# Why do AI agents need Crypto?

Authentically independent entities require unrestricted access to financial systems.&#x20;

Cryptocurrencies provide a decentralized and secure foundation that enhances the autonomy of AI agents.&#x20;

By removing the reliance on traditional financial intermediaries, these agents can function transparently and efficiently.&#x20;

Through blockchain technology, they gain access to tools like smart contracts, enabling autonomous execution of tasks, secure microtransactions, and transparent financial interactions.&#x20;

Additionally, cryptocurrencies facilitate proof of ownership, which is essential for promoting shared ownership and democratizing the deployment and usage of AI agents. This integration empowers agents to interact independently with platforms while maintaining security and transparency.

[title] Product Architectures
[path] Introduction/

AGI Open Network include: Computing Power Layer, AI Model Layer, Multi-Agent Collaboration Framework, AI Agent Launchpad and Pai Agent Invocation Service.&#x20;



![How to create, deploy, and monetize AI agents](https://archbee-image-uploads.s3.amazonaws.com/9Un_1i5LkMBPv0vZ7KLm2-4EPPU0-EwSyAUKcpYj5O8-20250123-060655.png "Product Architecture of AGI Open Network")



![AI Model Layer and Computing Power](https://archbee-image-uploads.s3.amazonaws.com/9Un_1i5LkMBPv0vZ7KLm2--1Jg6OQ6AOtyiR5DZS0Jm-20250123-102612.png "Infrastructure of Agent Development")


[title] AI Model Layer
[path] Introduction/

AGI Open Network aggregate 3,000+ AI open source model APIs, supporting complex AI  Agent applications and enabling diverse AI solutions.&#x20;

For example:&#x20;

| **AI Model**                 | **Functions**                                                       | **Application Value**                                                   |
| ---------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| face-to-many                 | Generate 3D faces, video game assets, etc                           | Virtual avatars, gaming, and digital content creation                   |
| flux-schnell                 | Fast image generation for local development and personal use.       | Rapid image generation, suitable for developers and personal use        |
| puliid                       | 3D virtual character customization, including lighting adjustments. | 3D character modeling for the gaming and film industries                |
| idm-vton                     | Clothing try-on for virtual characters.                             | Virtual try-on applications for the fashion industry                    |
| xtts-v2                      | Multilingual text-to-speech conversion.                             | Voice assistants and multilingual content creation                      |
| face-swap                    | Face replacement functionality.                                     | Entertainment and social media filters                                  |
| meta-llama-3b                | 30B-parameter model for text completion.                            | Natural language processing tasks, such as text generation and chatbots |
| meta-llama-3-70b-instruct    | 70B-parameter model for text comprehension.                         | Complex text-based tasks, ideal for AI conversation systems             |
| ollama-llama3-70b            | Cog wrapper for Llama3 70B model.                                   | Efficient development for large-scale NLP tasks                         |
| clip-batch                   | Batch processing for multiple images.                               | Creative industries and advertising generation                          |
| cog-resnet                   | ResNet-based computation experiments.                               | Image classification and recognition                                    |
| road\_marker\_model          | Road marking in images.                                             | Autonomous driving and intelligent transportation systems               |
| sddl-corgicam                | Dog-related image generation using TikTok Camera.                   | Social media and pet-related content creation                           |
| nunimatnah-7b-tir            | Language models integrated with tool-based reasoning.               | Conversational systems and educational applications                     |
| hermes-2-theta-llama-3-8b    | Experimental language models from Nous Research.                    | Advanced language understanding for high-demand tasks                   |
| phi-3-medium-4k-instruct     | Medium-sized models for data inference and analysis.                | Data analysis and scientific research                                   |
| pandaplays-13b-v1.0          | 13B-parameter models for gaming AI and conversational systems.      | Game design and interactive entertainment AI                            |
| sddl-beethoven-spectrograms… | Generate Beethoven-inspired music spectrograms.                     | Music education, analysis, and visualization                            |




[title] Initial Agent Offering (IAO)
[path] Introduction/





The IAO model allows creators to issue exclusive tokens for their AI Agents by consuming a certain amount of AON tokens. &#x20;



Through the IAO process, creators can attract and reward early adopters of their AI Agent, fostering global usage and promotion.&#x20;

Once all the AI Agent tokens are distributed and circulating via a fair launch mechanism, subsequent users must purchase tokens or pay in fiat currency to access the AI Agent’s services.

[title] Initial Model Offering (IMO)
[path] Introduction/

The IMO model enables AI model developers to issue exclusive tokens for their AI models, incentivizing independent developers to contribute more to open-source AI models.



AI models approved for IMO on the AON platform are extensively utilized by AI Agents, generating significant demand.&#x20;



A portion of the AI Agent’s revenue is allocated to repurchase and burn the corresponding AI model tokens, ensuring long-term value creation. Consequently, investors in AI model tokens stand to benefit from this mechanism.

[title] MCP-based Communication Protocol
[path] Introduction/

# **The Background of MCP (Model Context Protocol)**

### The **Model Context protocol** is an open - source protocol proposed by Anthropic and **introduced into the Web3 field  for the first time by the AGI Open Network**.&#x20;



The [Model Context Protocol (MCP)](https://www.anthropic.com/news/model-context-protocol) introduces a standardized approach for enabling interoperability between AI Model, AI Agent, data sources, and other systems.



By standardizing how agents share context, this protocol eliminates the need for custom integration, a significant pain point in traditional AI systems.&#x20;



MCP empowers AI Model/ AI Agent to interact intelligently, ensuring that data, tasks, and decision-making processes flow seamlessly. This capability is especially vital in decentralized systems, where multiple agents need to operate independently yet collaboratively.



# **The Lack of a Unified Communication Standard for Web3 Agents**



In the Web3 space, AI agents play a vital role in automating processes, managing decentralized systems, and enhancing user interactions. However, a critical barrier to their success is the absence of a universal communication standard.&#x20;



Currently, AI agents in Web3 operate within isolated silos, limiting their ability to collaborate effectively. Without a standardized protocol, developers face challenges in creating scalable and interoperable multi-agent systems, leading to inefficiencies and missed opportunities for innovation.



# **Agi Open Network: Unlocking New Capabilities with MCP**



To address this gap, the **AGI Open Network (AON)** is leveraging the Model Context Protocol to develop a Web3 **Multi-Agent System** (MAS) that redefines how AI agents operate.&#x20;



One of the most innovative capabilities enabled by MCP is the ability for AI agents to autonomously discover, integrate with, and pay for services they’ve never encountered before—all in real time.



Traditionally, consuming third-party services involved complex integrations, manual setup, and predefined payment systems, significantly slowing down processes and limiting adaptability. With MCP, AI agents gain the ability to handle these tasks on the fly, without any prior setup or human intervention. This real-time adaptability ensures that agents can respond to new opportunities and challenges seamlessly, further enhancing their efficiency and utility in decentralized ecosystems.


[title] The First MCP-Compatible Multi-Agent Collaboration Framework
[path] Introduction/

A Multi-Agent System (MAS) is a collection of multiple intelligent agents, each possessing a certain level of intelligence and autonomy. The core concept of MAS lies in enhancing the overall system’s performance and robustness through collaboration and coordination among agents, addressing complex tasks that cannot be handled by a single agent alone. Compared to traditional single-agent systems, MAS offers significant advantages such as distributed processing, collaborative operation, and adaptability.



# The First **MCP-Compatible Multi-Agent Collaboration Framework**



Building on the power of MCP(Model Context Protocol), AON has developed the first **MCP-Compatible Multi-Agent Collaboration Framework**, a robust system that redefines how AI Agents work together. This framework enables:

• **Permissionless Interoperability**: Agents from different ecosystems and different framework can collaborate dynamically.

• **Autonomous Collaboration**: Agents self-organize and adapt to solve complex problems.

• **Real-Time Payments**: Instant transactions among Agents for seamless integration.



AI Agents can be monetized not only through tokenization but also by being utilized by other AI Agents to earn cryptocurrency or fiat revenue.



# **The Benefits of a Permissionless Multi-Agent System**



The adoption of MCP and the development of a Web3 Multi-Agent System bring numerous advantages:

1\. **Permissionless Agent Collaboration**: Agents can interact without requiring prior authorization, fostering an open and dynamic ecosystem.

2\. **Autonomous Service Integration**: AI agents can independently identify and integrate with new services, eliminating manual processes.

3\. **Real-Time Payments**: MCP supports autonomous payment mechanisms, streamlining transactions and ensuring scalability.

4\. **Interoperability**: MCP ensures that agents built on different frameworks or platforms can work together seamlessly, breaking down silos.

5\. **Innovation**: All AI Agents developed on the AGI Open Network adhere to a unified communication standard, enabling seamless collaboration. This allows individual AI Agents to combine into complex systems capable of tackling a wide range of intricate problems.

[title] Strategic Partners
[path] Introduction/

# Hashkey Group

Established in 2018, HashKey Group is a leading end-to-end digital asset financial services group in Asia.&#x20;



Operating within regulatory frameworks that uphold the highest compliance standards, HashKey offers diverse investment opportunities and tailored solutions across the digital asset ecosystem and Web3 landscape for retail investors, large institutions, family offices, funds, professional and accredited investors.&#x20;



Headquartered in Hong Kong, HashKey Group also has operations in Singapore, Japan, and Bermuda.



[https://group.hashkey.com/en/about](https://group.hashkey.com/en/about)&#x20;


CSDN Global
===========

CSDN Global: Building an international technology cooperation platform, connecting global developers.



CSDN Global is a subsidiary of CSDN responsible for Web3-related businesses.



CSDN is a world-renowned Chinese IT technology exchange platform. Founded in 1999, it includes original blogs, quality Q\&A, vocational training, technical forums, resource downloads and other product services, providing a professional IT technology development community with original, high-quality and complete content.



[https://www.csdn.com/](https://www.csdn.com/)&#x20;

[title] Development Documents
[path] /

In the AON network, everyone can find a suitable role, whether they are highly skilled developers, experienced participants, or blockchain beginners. Come and learn how to participate and get rewards.

### Developers

Include blockchain developers, large model developers, and AGI product developers, who are responsible for building and maintaining the underlying protocols and Agents in the ecosystem.&#x20;

Developers can make profits through sales or subscriptions in the Agents market and receive technical support and training to reduce development difficulty and improve efficiency. Contributors are rewarded through incentives such as token distribution and participation income.

### Users

Users can not only use products but also participate in specific activities to accumulate tokens, enhance the diversity and vitality of the ecosystem, and use the accumulated tokens to use more AI Agents for free or at a lower cost.




[title] Installation
[path] Development Documents/

aonweb\` is a library for AI Agents development, providing simple and easy-to-use APIs to integrate AI functionality into your Agents.&#x20;

This guide will introduce you to AI Agents development using the aonweb library.

## Installation

First, make sure you have installed the aonweb library:

> npm install aonweb --save

## Basic Usage

### Import necessary modules

> import { AI, AIOptions, User } from 'aonweb'

### Initialize AI

Use AIOptions to create a configuration, then initialize the AI instance:

> const ai_options = new AIOptions({
>       appId: REPLACE_APP_ID //replace app id
> })
>
> const aonweb = new AI(ai_options)


[title] User Login Function
[path] Development Documents/

This documentation provides a detailed explanation of the login function, which handles user login in an asynchronous manner, including checks for user authentication, showing loading indicators, and emitting events upon successful login.

## Function: login

### Description

The login function is designed to check if a user is logged in, and if not, it will attempt to log the user in by repeatedly checking for owned users. It uses asynchronous operations to ensure the login process is smooth and non-blocking.

### Code

> async function login() {
>     try {
>         let user = new User();
>         let temp = await user.islogin();
>         if (!temp) {
>
>             for (let i = 0; i < 5; i++) {
>                 let result = await user.getOwnedUsers();
>                 let userid = result && result._userIds && result._userIds.length && result._userIds[0];
>                 if (userid && userid.length) {
>                     break;
>                 }
>                 await sleep(300);
>             }
>
>             temp = await user.islogin();
>             if (!temp) {
>                 console.log("login failed, please try again later");
>                 return;
>             }
>         }
>     } catch (error) {
>         console.log("index demo error", error);
>         if (error && typeof error == 'string') {
>             console.log(error);
>         } else {
>             console.log(error.message);
>         }
>     }
> }

### Detailed Explanation

1. **User Object and Initial Login Check:**
   - Creates a new User object.
   - Checks if the user is already logged in by calling user.islogin() and logs the result.
2. **Repeated Attempts to Get Owned Users:**
   - Attempts to get the list of owned users up to 5 times, with a 300ms delay between each attempt.
   - Breaks the loop if a valid user ID is found.
3. **Error Handling:**
   - Catches any errors that occur during the login process.
   - Logs the error to the console.
   - Closes the toast and shows an appropriate error message to the user.

This setup ensures that the user login status is checked and handled as soon as the component is ready, providing a seamless experience for the user.

[title] Get User Account Function
[path] Development Documents/

This documentation provides a detailed explanation of the getAccount function, which handles user account retrieval, login authentication, and interaction with the Ethereum provider. It includes asynchronous operations to ensure smooth and non-blocking user experience.

## Function: getAccount

### Description

The getAccount function checks if a user is logged in. If not, it initiates the login process. Once the user is logged in, it retrieves the user's Ethereum account. The function also handles loading indicators and emits events upon successful account retrieval.

### Code

> async function getUserInfo() {
>     try {
>
>         // Create a new User instance
>         let user = new User();
>
>         // Check if the user is logged in
>         const isLogin_status = await user.islogin();
>         console.log(isLogin_status, 'isLogin_status');
>         if (!isLogin_status) {
>             console.log("login failed, please try again later");
>             return;
>         }
>
>         // If user is already logged in, interact with Ethereum provider to get account
>         let account = await user.getAccount();
>         console.log("getWeb3 account", account);
>
>         let userId = await user.getUserId();
>         console.log("getWeb3 userId", userId);
>
>         let result = await user.balance()
>         if (result && result._balances && result._balances.length) {
>             let temp = result._balances[0]
>             let balance = temp / 1000000000000000000n
>             console.log("getWeb3 balance:",balance)
>         }
>
>     } catch (error) {
>         console.log(error, "getUserInfo error");
>         if (error && typeof error == 'string') {
>             console.log(error);
>         } else {
>             console.log(error.message);
>         }
>     }
> }

### Detailed Explanation

1. **User Object Initialization:**
   - Creates a new instance of the User object.
2. **Check Login Status:**
   - Asynchronously checks if the user is logged in.
   - Logs the login status.
3. **Handle Not Logged In Status:**
   - Shows a loading toast if the user is not logged in.
4. **User Info Process:**
   - Logs the account, userId, balance and any error.
5. **Error Handling:**
   - Logs the error.

This setup ensures that the user account status is checked and handled as soon as the component is ready, providing a seamless experience for the user.

[title] File and Image Upload
[path] Development Documents/

This documentation provides a detailed explanation of how to handle file and image uploads in your application, including file size validation, preparing form data, and interacting with the upload API.

## Function: onOversize

### Description

The onOversize function checks if the uploaded file exceeds the maximum allowed size and displays a notification if it does.

### Code

> const onOversize = (file) => {
>     console.log('The file size cannot exceed 30MB');
> };

### Usage

- **Parameters:**
  - file: The file object to be checked.
- **Behavior:**
  - Displays a toast notification if the file size exceeds 30MB.

## Function: afterRead

### Description

The afterRead function processes the file after it has been read, prepares it for upload, and calls the uploadFile function to handle the actual upload.

### Code

> function afterRead(file) {
>     const formData = new FormData();
>     formData.append('file', file.file);
>
>     // Call the upload API
>     uploadFile(formData).then(res => {
>         if (res.code == 200 && res.data && res.data.length) {
>             imageStore.addImage(res.data);
>         }
>     }).catch(err => {
>         showToast('image upload failed');
>         console.log(err);
>     });
> }

### Usage

- **Parameters:**
  - file: The file object that has been read.
- **Behavior:**
  - Creates a FormData object and appends the file.
  - Calls the uploadFile function to upload the file.
  - Adds the uploaded image to imageStore if the upload is successful.
  - Displays an error toast if the upload fails.

## Function: uploadFile

### Description

The uploadFile function uploads the given file to the server using a POST request and returns the response.

### Code

> const uploadFile = async (formData) => {
>     const response = await fetch('https://tmp-file.aigic.ai/api/v1/upload?expires=1800&type=image/png', {
>         method: 'POST',
>         body: formData
>     });
>
>     const data = await response.json();
>     return data;
> };

### Usage

- **Parameters:**
  - formData: The FormData object containing the file to be uploaded.
- **Behavior:**
  - Sends a POST request to the upload API endpoint.
  - Returns the response data.

## Workflow

1. **File Selection and Validation:**
   - The user selects a file.
   - The onOversize function checks if the file size exceeds 30MB. If it does, a toast notification is shown.
2. **File Upload:**
   - The afterRead function is called with the selected file.
   - A FormData object is created and the file is appended to it.
   - The uploadFile function is called with the FormData object.
3. **API Interaction:**
   - The uploadFile function sends a POST request to the upload API endpoint.
   - If the upload is successful, the response data is added to the imageStore.
   - If the upload fails, a toast notification is shown and the error is logged.

### Example Usage

> // Assuming this is part of a Vue component
> onMounted(() => {
>     // File input event listener
>     document.getElementById('fileInput').addEventListener('change', (event) => {
>         const file = event.target.files[0];
>         if (file.size > 30 * 1024 * 1024) {
>             onOversize(file);
>         } else {
>             afterRead({ file });
>         }
>     });
> });

### Notes

- Ensure the API endpoint (https\://tmp-file.aigic.ai/api/v1/upload) and parameters (expires and type) are correctly set as per your backend requirements.
- Handle exceptions and errors gracefully to provide a good user experience.
- Customize the toast notifications as needed for your application.

By following this documentation, developers can easily integrate file and image upload functionality into their applications, ensuring proper validation, handling, and error management.

[title] AI Model API
[path] Development Documents/

This documentation provides a detailed explanation of viarous AI Models' API.&#x20;

[title] flux-schnell API Usage Guide
[path] Development Documents/Untitled/

## Introduction

This document will guide developers on how to use the aonweb library to call the flux-schnell API, The fastest image generation model tailored for local development and personal use.

## Prerequisites

- Node.js environment
- aonweb library installed
- Valid Aonet APPID

## Basic Usage

### 1. Import Required Modules

> import { AI, AIOptions } from 'aonweb';

### 2. Initialize AI Instance

> const ai_options = new AIOptions({
>     appId: 'your_app_id_here',
>     dev_mode: true
> });
>
> const aonweb = new AI(ai_options);

### 3. Prepare Input Data Example

> const data = {
>    input:{
>       "prompt": "black forest gateau cake spelling out the words \\\\"FLUX SCHNELL\\\\", tasty, food photography, dynamic shot",
>       "num_outputs": 1,
>       "aspect_ratio": "1:1",
>       "output_format": "webp",
>       "output_quality": 90
>     }
> };

> const data = {
>    input:{
>       "num_outputs": 1,
>       "prompt": "POV someone holding their hand up, stunning black forest mountains",
>       "aspect_ratio": "1:1",
>       "output_format": "webp",
>       "output_quality": 90
>     }
> };

> const data = {
>    input:{
>       "num_outputs": 1,
>       "prompt": "3 magical wizards stand on a yellow table\\\nOn the left, a wizard in black robes holds a sign that says ‘AI’\\\nIn the middle, a witch in red robes holds a sign that says ‘is’\\\nand on the right, a wizard in blue robes holds a sign that says ‘cool’\\\nBehind them a purple dragon",
>       "aspect_ratio": "1:1",
>       "output_format": "webp",
>       "output_quality": 90
>     }
> };

### 4. Call the AI Model

> const price = 8; // Cost of the AI call
> try {
>     const response = await aonweb.prediction("/predictions/ai/flux-schnell@iAON", data, price);
>     // Handle response
>      console.log("Flux-Schnell result:", response);
> } catch (error) {
>     // Error handling
>     console.error("Error generating :", error);
> }

### Parameter Description

- num\_outputs: Number, Number of outputs to generate.
- prompt: String, Prompt for generated image.
- aspect\_ratio: String, Aspect ratio for the generated image.
- output\_format: String, Format of the output images.
- output\_quality: Number,Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs

### Notes

- The API may take some time to process the input and generate the result, consider implementing appropriate wait or loading states.
- Handle possible errors, such as network issues, invalid input, or API limitations.

### Example Response

The API response will contain the URL of the generated image or other relevant information. Parse and use the response data according to the actual API documentation.

[title] IDM-VTON AI Model Usage Guide
[path] Development Documents/Untitled/

## Introduction

This document describes how to use the aonweb library to call the IDM-VTON AI model. This model is used for virtual try-on, allowing specified clothing images to be applied to human images.

## Prerequisites

- Node.js environment
- aonweb library installed
- Valid Aonet APPID

## Basic Usage

### 1. Import Required Modules

> import { AI, AIOptions } from 'aonweb';

### 2. Initialize AI Instance

> const ai_options = new AIOptions({
>     appId: 'your_app_id_here',
>     dev_mode: true
> });
>
> const aonweb = new AI(ai_options);

### 3. Prepare Input Data Example

> const data = {
>     input: {
>       "crop": false,
>       "seed": 42,
>       "steps": 30,
>       "category": "upper_body",
>       "force_dc": false,
>       "garm_img": "https://replicate.delivery/pbxt/KgwTlZyFx5aUU3gc5gMiKuD5nNPTgliMlLUWx160G4z99YjO/sweater.webp",
>       "mask_img": "https://replicate.delivery/pbxt/KnaDKqnN0h1DDF5CnK7iRSSkFnJrk9kyRiQlcc5gBcy8gpPA/replicate-prediction-wfj8g6sgmxrgp0cf1gnv7btfh8.jpg",
>       "human_img": "https://replicate.delivery/pbxt/KgwTlhCMvDagRrcVzZJbuozNJ8esPqiNAIJS3eMgHrYuHmW4/KakaoTalk_Photo_2024-04-04-21-44-45.png",
>       "garment_des": "cute pink top"
>     }
> };

### 4. Call the AI Model

> const price = 8; // Cost of the AI call
> try {
>     const response = await aonweb.prediction("/predictions/ai/idm-vton@cuuupid", data, price);
>     // Handle response
>     console.log("IDM-VTON Response:", response);
> } catch (error) {
>     // Error handling
>      console.error("Error generate :", error);
> }

### Parameter Description

- seed: Number,Random seed for generating reproducible results
- steps: Number,Provide the steps required for model inference
- garm\_img: String,Garment, should match the category, can be a product image or even a photo of someone
- human\_img: String,Model, if this is not 3:4 check crop
- garment\_des: String,Description of garment e.g. Short Sleeve Round Neck T-shirt
- crop Boolean,Use cropping? (check this if your image is not 3:4)
- category String,Category of garment
- force\_dc Boolean,Use the DressCode version of IDM-VTON (this is default false, except if category=dresses)
- mask\_img String,Mask image, optional (but faster)

### Handling the Response

The model's response will contain the processed results. Depending on your application's needs, you may need to parse and use specific fields from the response.

### Error Handling

Use try-catch blocks to catch and handle possible errors.

## Best Practices

- **Store and Manage API Keys**: Do not hard-code API keys in your code. Use environment variables or secure key management systems.
- **Input Validation**: Validate all input parameters before sending requests.
- **Error Handling**: Implement comprehensive error handling, including network errors, API limits, and invalid responses.
- **Caching Strategy**: Consider implementing caching mechanisms to reduce duplicate requests and improve application performance.
- **Asynchronous Processing**: Use async/await or Promises to handle asynchronous operations, ensuring the main thread is not blocked.

### Notes

- Ensure you have enough API call quota.
- Ensure the validity and accessibility of image URLs.
- Adhere to the API provider's terms of use and restrictions.

## Conclusion

By following this guide, you should be able to successfully integrate and use the IDM-VTON AI model for virtual try-on application development. If you encounter any issues or need further assistance, please refer to the official aonweb documentation or contact technical support.

[title] LLaMA 3 API Usage Guide
[path] Development Documents/Untitled/

## Introduction

This document will guide developers on how to use the aonweb library to call the LLaMA 3 API for generating natural language text.

## Prerequisites

- Node.js environment
- aonweb library installed
- Valid Aonet APPID

## Basic Usage

### 1. Import Required Modules

> import { AI, AIOptions } from 'aonweb';

### 2. Initialize AI Instance

> const ai_options = new AIOptions({
>     appId: 'your_app_id_here',
>     dev_mode: true
> });
>
> const aonweb = new AI(ai_options);

### 3. Prepare Input Data Example

> const data = {
>    input:{
>         "top_p": 1,
>         "prompt": "Plan a day of sightseeing for me in San Francisco.",
>         "temperature": 0.75,
>         "system_prompt": "You are an old-timey gold prospector who came to San Francisco for the gold rush and then was teleported to the present day. Despite being from 1849, you have great knowledge of present-day San Francisco and its attractions. You are helpful, polite, and prone to rambling.",
>         "max_new_tokens": 800,
>         "repetition_penalty": 1
>     }
> };

### 4. Call the AI Model

> const price = 8; // Cost of the AI call
> try {
>     const response = await aonweb.prediction("/predictions/ai/lllama3:0.0.8", data, price);
>     // Handle response
>     console.log("IDM-VTON Response:", response);
> } catch (error) {
>     // Error handling
>      console.error("Error generate :", error);
> }

### Parameter Description

- top\_p: Number, controls the diversity of the output. When set to 1, it retains all possibilities.
- prompt: String, the user's input prompt, based on which the model generates a response.
- temperature: Number, controls the randomness of the output. Higher values produce more diverse but potentially less coherent output.
- system\_prompt: String, sets the role and behavior of the AI assistant.
- max\_new\_tokens: Integer, specifies the maximum length of the generated text.
- repetition\_penalty: Number, controls the penalty for repetition. When set to 1, no penalty is applied.

### Notes

- The quality and specificity of the prompt will directly impact the quality and relevance of the generated text.
- The API may take some time to process requests and generate text, consider implementing appropriate wait or loading states.
- Handle possible errors, such as network issues, invalid input, or API limitations.
- Adhere to the terms of use and content policies, especially when dealing with sensitive topics.

### Example Response

The API response will contain the generated text. Parse and use the response data according to the actual API documentation.
