Loading…

AI writing

```javascript WXAPI.volcesArkCreateChatCompletion('Help me write a diary of about 200 words') ``` 1. First go to the left menu, Factory settings, Module management, enable the AI module, and purchase tokens 2. Call this interface directly and let AI help you create. ```json { "code": 0, "msg": "Call successfully, call later", "data": "753bfb9b-2b79-419d-8b9c-a777bb9113ea" } ``` If the interface call is successful, the AI assistant will help you create, but this will take a few seconds, so this interface returns asynchronously. The data field returns the temporary KEY created by this AI. This KEY will be used later to read the results. For example: ```javascript WXAPI.volcesArkChatCompletionResult('753bfb9b-2b79-419d-8b9c-a777bb9113ea') ``` After the AI creation is completed, the interface will return the following data: ```json { "code": 0, "msg": "success", "data": { "totalTokens": 418, "result": [ { "title": "App upgrade announcement", "keywords": "App, upgrade, announcement", "descript": "Publish relevant information announcements about App upgrades", "content": "Dear users, we are pleased to announce that our App is about to undergo an important upgrade. This upgrade is designed to provide you with more stable performance, richer functions, and a better user experience.\n\nDuring the upgrade process, you may encounter some temporary inconveniences, such as the temporary unavailability of the application or the temporary adjustment of some functions. Please wait patiently. After the upgrade is completed, you will enjoy the brand new App experience. \n\nWe will complete the upgrade as soon as possible and notify you as soon as possible. If you encounter any problems during the upgrade process, please feel free to contact our customer service team, we will serve you wholeheartedly. \n\nThank you for your continued support and attention to our App, and we will continue to work hard to provide you with better services." } ] } } ``` + totalTokens The number of tokens consumed for this creation will be deducted from the token you purchased. + result is the result set created by AI. Generally, just take the first set of results in the array, which is the most accurate. - title The title of this creative content - keywords Keywords for this creative content - descript A summary of the content of this creation - content This creative content If this interface returns code = 700, it means that the AI creation has not been completed. It is recommended to use `setTimeout` to call this interface again after 1 second to read the AI creation results.