Development Documents
AI Model API
LLaMA 3 API Usage Guide
9 min
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 2\ initialize ai instance 3\ prepare input data example 4\ call the ai model 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