diff --git a/.env.overseas.example b/.env.overseas.example new file mode 100644 index 0000000000000000000000000000000000000000..b44a620b83582ec04422c9d5af30dc134d247409 --- /dev/null +++ b/.env.overseas.example @@ -0,0 +1,9 @@ +# 生产环境 +DOCS_CDN_PREFIX=https://moark.ai/docs +DOCS_API_URL=https://moark.ai +DOCS_SITE_URL=https://moark.ai + +# 开发环境 +#DOCS_CDN_PREFIX=/docs +#DOCS_SITE_URL=https://moark.ai +#DOCS_API_URL=https://moark.ai \ No newline at end of file diff --git a/.gitignore b/.gitignore index 92bfaf4897bbab3db5f02d467cdc6dc9cdce3193..d90f91d32833ebeb40ba02209cf747d00c068111 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,6 @@ yarn-error.log* # local env files .env +.env.overseas /static/test.yml \ No newline at end of file diff --git a/docs_overseas/appendix/_category_.json b/docs_overseas/appendix/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..971bdf8e5f339c1191f46879fca7c3b92c27784c --- /dev/null +++ b/docs_overseas/appendix/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "附录", + "position": 100, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/appendix/contact.md b/docs_overseas/appendix/contact.md new file mode 100644 index 0000000000000000000000000000000000000000..7cefaa814d0ba468aa4429de4e5405a6b6bec344 --- /dev/null +++ b/docs_overseas/appendix/contact.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 5 +--- + +# Contact Us + +To facilitate communication with us, Moark offers multiple contact methods. + +X: https://x.com/moark2025 + +Reddit:https://www.reddit.com/user/MoArk-Ai/ + +Discord:https://discord.gg/hGGWhSDm3U \ No newline at end of file diff --git a/docs_overseas/appendix/glossary.md b/docs_overseas/appendix/glossary.md new file mode 100644 index 0000000000000000000000000000000000000000..08c2532390310b688a19aaaae6c4932f2b5e57a0 --- /dev/null +++ b/docs_overseas/appendix/glossary.md @@ -0,0 +1,42 @@ +--- +sidebar_position: 1 +hide_table_of_contents: true +--- + +# Glossary + +The glossary provides you with core terms covering AI technologies and related fields, serving as a foundational reference for understanding product features and technical principles. + +| Term Category | Term Name/Abbreviation | Definition | +| ---------------- | ------------------------------------- | ---------------------------------------------------------------------------------- | +| Model & Algorithm Technology | LoRA(Low-Rank Adaptation) | A lightweight model fine-tuning technique that reduces fine-tuning parameters through low-rank matrix factorization, applicable to text-to-image, large language models, and other scenarios. | +| | LLM(Large Language Model) | Large-scale language models trained on massive text data, supporting tasks such as text generation and question answering, e.g., Qwen2.5, GLM-4. | +| | SFT(Supervised Fine-Tuning) | Optimizing pre-trained models using labeled data to improve performance on specific tasks, suitable for small dataset scenarios. | +| | DPO(Direct Preference Optimization) | Optimizing models based on human preference data to enhance the conversational quality of large language models. | +| | Transformers | An architecture based on self-attention mechanisms, used for NLP tasks and one of the core architectures of LLMs. | +| | Diffusers | A generative image model library supporting text-to-image and image-to-image generation, such as Stable Diffusion. | +| | Function Calling/Tool Calling | The capability of large models to invoke preset functions/tools, enabling cross-tool collaboration (e.g., calling a weather API). | +| Data & Training Related | Dataset | A structured collection of data used for model training, divided into public and private, supporting multiple formats. | +| | Dataset Card | A file (README.md) that records dataset metadata (license, language, etc.) to help understand the dataset. | +| | Model Card | A document describing model information, including use cases and limitations, hosted as the README.md in the model repository. | +| | Token | The basic unit for models to process text, used for calculating length and billing. | +| API & Service Technology | Serverless API | API services that eliminate the need for server management, billed by the number of calls, supporting functions such as text generation. | +| | API Workflow | A visual workflow engine that connects multiple model APIs to automate tasks (e.g., "text→image" generation). | +| | Access Token | Identity credentials for API calls, divided into full-resource and partial authorization, with permission controlled by binding resource packages. | +| | Model Context Protocol (MCP) | A protocol that defines how models request tools to perform operations, interact with the environment, and obtain results from external systems. | +| | Temporary Token | Short-term valid tokens, suitable for client-side calls with higher security. | +| | Failover Mechanism | Automatic switching to other compute resources when the primary resource fails, enabled via the request header `X-Failover-Enabled`. | +| 图像与多媒体技术 | Text-to-Image | 根据文本生成图像,如FLUX.1模型,可通过参数控制效果。 | +| | Image-to-Image | 基于原图生成新图像,支持风格迁移、局部重绘。 | +| | OCR (Optical Character Recognition) | Technology for extracting text from images, supporting multi-language, table, and formula recognition. | +| | TTS (Text-to-Speech) | Converting text to speech with voiceprint customization, such as the ChatTTS model. | +| | ASR (Automatic Speech Recognition) | Converting speech to text, supporting multiple languages and dialects. | +| Deployment & Computing Related | Model Engine | A managed model deployment service that supports custom computing power, suitable for production environments. | +| | Edge Device | Edge devices (e.g., mobile phones) that support the deployment of lightweight models for low-latency inference. | +| | GPU | Parallel computing hardware suitable for model training and inference, such as NVIDIA A10. | +| | vllm | A high-performance LLM inference library that optimizes the concurrency and latency of conversational models. | +| | Docker | A containerization tool that packages applications and their environments, supporting custom configurations. | +| Parameter & Configuration Related | Temperature | Controls generation randomness (0-1); lower values result in stable output, while higher values lead to more creative results. | +| | Top_p | Controls diversity (0-1), used in conjunction with temperature. | +| | Guidance Scale | A parameter in image generation that controls the influence of text prompts. | +| | JSON Schema | A specification that constrains the output format of models to ensure structured data generation. | diff --git a/docs_overseas/appendix/privacy.md b/docs_overseas/appendix/privacy.md new file mode 100644 index 0000000000000000000000000000000000000000..bf298eec9e01797c198751ca1b0cbefcfa77f6b2 --- /dev/null +++ b/docs_overseas/appendix/privacy.md @@ -0,0 +1,119 @@ +--- +sidebar_position: 3 +--- + +# Privacy Policy + +Thank you for using Moark! + +At Moark, Inc. ("Moark", "we", "us", or "our"), we are committed to protecting your personal information and your right to privacy. We want you to be fully informed about the information we collect, how it is used, shared, and protected, and the choices you have with it and explain the privacy and data practices at Moark. + +This privacy policy (the "Policy") applies to all information collected through our website located at https://moark.ai/ (the "Website") and/or any related services, sales, marketing or events (we refer to all of these collectively in this Policy as the (collectively, "Services"). + +## Contact Us + +If you want to contact us with specific queries or concerns in relation to this Privacy Policy, or if you have any questions or complaints as to how your personal data is collected, used, disclosed and/or processed by us, please contact us at moark2025@gmail.com. + +## Table of Contents + +1. [Types of Personal Information We Collect](#types-of-personal-information-we-collect) +2. [How We Collect and Use Your Personal Data](#how-we-collect-and-use-your-personal-data) +3. [How We Share Your Personal Data](#how-we-share-your-personal-data) +4. [Use of Cookies and Similar Technologies](#use-of-cookies-and-similar-technologies) +5. [Your Rights And How To Exercise Them](#your-rights-and-how-to-exercise-them) +6. [Protection of Personal Data](#protection-of-personal-data) +7. [Personal Data relating to children](#personal-data-relating-to-children) +8. [Privacy Policy Updates](#privacy-policy-updates) +9. [No Right of Enforcement by Third Parties](#no-right-of-enforcement-by-third-parties) + +## Types of Personal Information We Collect + +### Personal Data You Provide to Us Directly + +We gather Personal Data when you create an account to use our Services or interact with us, as follows: + +- **Account Information**: We collect details you provide during account creation, including your date of birth (where required), username (where applicable), email address, and password. +- **User Content**: When you engage with our Services, we may collect your text inputs, prompts, uploaded files, feedback (e.g., via thumbs up/thumbs down icons, which stores the associated conversation), chat history, or other content you submit to our model and Services ("Prompts" or "Inputs"). We generate responses ("Outputs") based on your Inputs. If your Inputs include personal data or reference external content, we will collect that information, and it may appear in your Outputs. +- **Communication Information**: When you contact us, we collect the information you provide, such as proof of identity or age, contact details, feedback, inquiries, and the content of any messages you send. + +### Personal Data We Collect from Your Use of the Services + +We automatically collect certain information when you use our Services, including internet or network activity data such as your IP address, unique device identifiers, and cookies. + +- **Device and Network Information**: Depending on your device or browser permissions, we automatically receive information about how you install, access, or use our Services. This may include your device type, operating system, browser data, referring web pages, mobile network and connection details, mobile carrier or internet service provider (ISP), time zone settings, IP address (including inferred location data), and various identifiers (e.g., device, advertising, or other unique personal or online identifiers). +- **Usage Information**: We collect data about your interactions with the Services, including access dates and times, browsing history, searches, clicked links, viewed pages, and other details about your use of the Services and the technology on devices used to access them. +- **Log Information**: We gather data on how our Services perform during your use, including log files. If an error occurs on your device or during your use, we may collect details about the error, its timing, the feature in use, the application's state at the time, and any communications or content involved. +- **Cookies & Similar Technologies**: We utilize cookies and similar tracking technologies to operate and enhance our Services. For example, cookies help us remember your language preferences and support security measures. We will seek your consent for cookie use where required by law. For more details on cookies and how to manage them, visit www.allaboutcookies.org. + +### Personal Data We Obtain from Other Sources + +We may receive the information outlined in this Privacy Policy from other sources, including: + +- **Log-in, Sign-up, or Linked Services**: If available, when you sign up or log in to the Services using a third-party service like Google or GitHub, or link your account to such services, we may collect information from those services, such as an access token. +- **Security Information**: We receive data from trusted partners, such as security providers, to safeguard our Services against fraud, abuse, and other security risks. +- **Public Information**: We may collect publicly available data from internet sources to train our models and deliver our services. + +## How We Collect and Use Your Personal Data + +### Information You Provide Directly + +- **Account Registration and Login**: To access the Platform, you must register and log in using a third-party platform account. By logging in via a third-party platform, you permit us to collect relevant details from that account, such as your name, profile picture, and other information you authorize from platforms like Google or GitHub. +- **Purchases and Subscriptions**: When you subscribe to paid Services or make purchases on our Platform, we collect transaction-related information, either directly from you or through our third-party payment processors (e.g., Stripe). This may include your credit card details, bank account information, billing address, payment history, order details, and other information related to services purchased via the Platform, to verify and process your transactions. +- **Surveys and Online Activities**: If you participate in surveys or promotional events on our Platform, we may collect details such as your account ID, name, address, phone number, job title, and Service usage data. This information helps us contact you, verify your identity, and provide rewards (if applicable) based on the activity's rules. +- **Contract-Related Information**: For offline delivery requests or product testing, please reach out to [moark2025@gmail.com]. We will collect necessary contract-related details based on your specific needs. + +### Information We Collect Automatically + +- **Service Security and Operations**: To ensure the secure and reliable functioning of our Services, protect you and other users, and prevent network threats or intrusions, we collect essential data for operational and security purposes. This includes device details (e.g., screen resolution, time zone, language settings), network connection type, and browsing records. +- **Service Enhancement**: To improve user experience and maintain security, we may gather network logs, usage frequency, crash reports, usage scenarios, and performance metrics. This data helps us optimize the Platform and enhance service quality. +- **Issue Resolution**: We collect records of user inquiries, issue reports, and troubleshooting processes (e.g., communication or call logs) generated during your use of our Services. This information enables us to address your support requests promptly and improve our offerings. +- **Notifications and Marketing**: We may send you promotional messages about services, features, or events via text or phone calls. If you prefer not to receive these, you can opt out via text message, email, or by contacting us directly. + +### Information from Third-Party Sources + +To deliver improved, tailored, and secure services, or to collaborate with partners in offering services or detecting fraud, our affiliates and trusted partners may share your information with us, subject to legal requirements, agreements, or your consent. We adhere to industry-standard practices and make every reasonable effort to safeguard your Personal Data in compliance with applicable laws and regulations, particularly for identity verification purposes. + +## How We Share Your Personal Data +We may share your personal data with the following categories of recipients: + +- **Affiliates**: Our affiliated entities within the Moark and/or their designated service providers, who perform data processing necessary to deliver our Services to you. +- **Vendors and Service Providers**: Third-party vendors and service provider partners who process data to support the delivery, improvement, and optimization of our products, services, websites, and platforms, or who handle personal data for purposes outlined in this Privacy Policy. +- **Business Transfers**: Any business partner, investor, assignee or transferee (actual or prospective) to facilitate business asset transactions (which may extend to any merger, acquisition or any debt or asset sale) involving any of the Companies. +- **Government Authorities or Other Third Parties**: Competent law enforcement bodies, regulatory or government agencies, courts, or other third parties (e.g., our professional advisors) where disclosure is deemed necessary (i) to comply with applicable laws or regulations, (ii) to exercise, establish, or defend our legal rights or those of a third party, or (iii) to safeguard your vital interests or those of others. +- **With Your Consent**: Any other individual or entity, provided you have given your consent for the disclosure. + +## Use of Cookies and Similar Technologies + +Cookies and similar technologies are common and widely used in the Internet. When you use our Platform, we may use relevant technologies to send one or more cookies or anonymous identifiers to your device to collect and store your account information, search history information, and login status information. Cookies and similar technologies can help you skip the steps and processes of repeatedly filling in account information and entering search content. They can also help us improve service efficiency and enhance login and response speeds. + +You have the ability to accept or decline cookies by modifying the setting in your browser. However, please note that if you disable cookies, you may not be able to enjoy the best service experience, and the availability of certain functions may be affected. + +## Your Rights And How To Exercise Them + +You have the following rights regarding your personal information: + +- **Access** the personal information we maintain about you. +- **Delete** the personal information we maintain about you, unless such information is necessary for compliance with our legal or regulatory obligations. +- **Correct** inaccurate personal information we maintain about you. +- **Opt-Out** of certain uses of your personal information. You can opt out of: + - **Email marketing**: you may unsubscribe to our commercial email list by following the instructions provided in the email. + +You can exercise these rights by contacting us at moark2025@gmail.com. + +## Protection of Personal Data + +We implement appropriate administrative, physical, and technical safeguards to protect your Personal Data from unauthorized access, collection, use, disclosure, copying, alteration, disposal, or similar risks, as well as the loss of any storage medium or device containing Personal Data. + +Please note that no method of data transmission over the Internet or electronic storage is entirely secure. Although absolute security cannot be guaranteed, we are committed to safeguarding your Personal Data and continuously review and improve our security measures to enhance protection. + +## Personal Data relating to children + +We do not intentionally collect any personal information from children under the age of 16. If you believe we have obtained personal information associated with children under the age of 16, please contact us at moark2025@gmail.com + +## Privacy Policy Updates + +We may revise this policy from time to time. We recommend that you review the Privacy Policy each time you access our Services to stay informed of our privacy practices. We will put the effective date of the latest version at the top of each policy. + +## No Right of Enforcement by Third Parties + +Individuals who are not parties to this Privacy Policy have no authority to enforce any of its terms or provisions. diff --git a/docs_overseas/appendix/qa.md b/docs_overseas/appendix/qa.md new file mode 100644 index 0000000000000000000000000000000000000000..cb18dfda813ad8ed9a8cef7f03726172dea1cbc6 --- /dev/null +++ b/docs_overseas/appendix/qa.md @@ -0,0 +1,92 @@ +--- +sidebar_position: 4 +--- + +# Frequently Asked Questions + +Welcome to the compilation of frequently asked questions about ModelArk. Below are solutions to common issues across various sections: + +## Common Token Issues + +### Access Token Issues + +- If you receive a "token invalid" prompt, please check if the "token" is correct or if it has been deleted and is no longer usable. + +- If you receive a "token has no available resources" prompt, please verify whether the "token" is authorized to access purchased resources, or check if the authorized resources have expired or been fully utilized. + +### Temporary Token Issues + +- If you see a "token invalid" message, please confirm that the "token" is correct, or check if the bound "access token" has been deleted or if the token itself has expired. + +- If you get a "token has no available resources" notification, please verify whether the bound "access token" is authorized to access purchased resources, or check if the authorized resources have expired or been fully used. + +### API Call Issues + +| Status Code | Error Message (English) | Notes | +|-------------|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 400 | Service not found | The request path is incorrect. Please re-copy the URL from the experience interface. | +| 400 | Today's free API access limit has been exceeded. Please purchase resources to continue using the API. | The access token for the current API call is a "**free trial access token**", which has a daily limit on the number of API calls. You have reached the maximum number of calls. You can purchase a resource package and configure a paid access token to continue using the API. | +| 400 | The access token cannot access any resources. Please purchase or authorize resources to use the access token. | Please verify if the "access token" is authorized to access purchased resource packages and if the resource package is applicable for calling this API. You can reconfigure it in the "[**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens)" interface. | +| 400 | Resources are not purchased or authorized. Please purchase or authorize resources before using them. | Please check if you have purchased a resource package, if the resource package has been exhausted or expired, and if the access credential is authorized for the resource. You can reconfigure it in the "[**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens)" interface or renew the "[**Resource Packages**]({{SITE_URL}}/dashboard/serverless)". | + +## Model Marketplace Issues + +### How much concurrency does the Serverless API support? + +Currently, the Serverless API is backed by a unified computing resource pool with flexible scheduling. There is no limit on concurrency for the Serverless API. If you encounter concurrency issues, feel free to [contact us](./contact.md) to add resources. + +### Can I try before purchasing? + +Before making a purchase, you can try all featured models for free in the [AI Model Marketplace]({{SITE_URL}}/serverless-api). + +![Free trial of models](/img/base/serverless-api-flux-1-schnell.png) + +Select the "Free Trial Access Token" to enjoy the free experience. Each user is entitled to 100 free calls per day: + +![Number of calls](/img/base/counts.png) + +### How to view and manage purchased resources? + +After placing and paying for a Serverless API or application order, we will prepare the corresponding service for you. Once ready, you can view your purchased resources on the relevant resource page in the workbench. + +![Input image description](/img/base/serverless-api.png) + +### How to manage resources under an organization? + +Switch to the organization workbench: + +- Organization creators and administrators can manage created resources, orders, and expenses in the workbench. +- Organization members can view purchased model engines and Serverless APIs in the workbench, and manage models and datasets they have created. + +### How to view resource usage and consumption? + +In the Workbench - Statistics and Logs section, you can view usage statistics and logs for all resources. + +![Input image description](/img/base/usage-statistics.png) + +### Can purchased resources be refunded? + +- For model engines, if there is remaining usage time, deleting the resource will result in a refund. The amount will be calculated based on the unused duration and returned to your account balance. +- Used Serverless API resources are not eligible for refunds. + +### How to withdraw funds from the account balance? + +Currently, we do not support online withdrawals. If you need to withdraw funds, please [contact us]({{SITE_URL}}/about). + +### Payment successful, but the payment page prompts "Order still unpaid" + +If you have completed the payment but see the prompt "Order still unpaid" when clicking the **I have completed payment** button on the return payment page, please contact us by sending an email to gitee-ai@oschina.cn. + +In the email, you need to provide the **order number of the order and a screenshot of the payment from the corresponding payment software**. + +### API Upgrade + +The API has been fully upgraded. It is recommended to use the new OpenAI-compatible interface for better compatibility and long-term support. + +🔗 **New API Documentation**: [Documentation Link](../openapi/v1) + +🚀 **Upgrade Highlights** + +- Compatible with OpenAI API, facilitating migration and integration. + +If you still need to use the old interface, please refer to the above documentation, but it is recommended to migrate to the new interface as soon as possible for an optimal experience. \ No newline at end of file diff --git a/docs_overseas/appendix/terms.md b/docs_overseas/appendix/terms.md new file mode 100644 index 0000000000000000000000000000000000000000..56346e9395ce083103abe1ed896ec0bb13e1a795 --- /dev/null +++ b/docs_overseas/appendix/terms.md @@ -0,0 +1,64 @@ +--- +sidebar_position: 2 +--- + +# Terms of service + +Welcome to the website for Moark, which is owned and operated by Moark Inc., a Delaware corporation (the "Company," "we," or "us"). The Company has developed and makes available programmatic APIs and web interfaces to host, use, fine tune and train large AI models (the "Services"). The Company may also provide training, migration or other professional services to you ("Professional Support"). + +These Terms of Service (the "Agreement") govern your use of https://moark.ai (the "Website"), the Services, and Supplemental Support. Additionally, you may enter into an addendum to this Agreement with the Company, or an order form with the Company, both of which incorporate this Agreement by reference. By using the Services, the Supplemental Support, or this Website, you agree to be bound by this Agreement. This Agreement is effective when you commence using the Services, the Supplemental Support, or the Website (the "Effective Date"). This Agreement may be subject to change in the future. + +# Services + - Subject to this Agreement, the Company hereby grants you a non-exclusive right to access and use the Services. As part of the Services, the Company may provide you with certain application programming interfaces (APIs), API access tokens, HTML scripts, data import tools, or other software as applicable (collectively, “APIs”). You are entirely responsible for provisioning and managing your user’s accounts and your user’s compliance with this Agreement. + + - The Services are subject to modification and change. No guarantees are made with respect to the Services’ quality, stability, uptime or reliability, unless otherwise agreed between the parties in an Order Form. + + - The Company will maintain a security program in accordance with industry standards that is designed to (i) ensure the security and integrity of Customer Data; (ii) protect against threats or hazards to the security or integrity of Customer Data; and (iii) prevent unauthorized access to Customer Data. “Customer Data” means any data, content or materials that you or your users submit to the Services. + + - The Company may monitor your use of the Services to assess compliance with this Agreement and the quality of operations of the Services and to make improvements to the Services. + +# Your Responsibilities + - By accessing the Website or the Services, you confirm that you are at least 13 years old and meet the minimum age of digital consent in your country. If you are old enough to access the Website or the Services in your country, but not old enough to have authority to consent to our terms, your parent or guardian must agree to our terms on your behalf. + + - By using the Website or Services, you may provide the Company with personal information like your email address, user name, billing information, or other data you upload to the Service. Please read our Privacy Policy which explains how we use your data. + + - You will (i) use commercially reasonable efforts to prevent unauthorized access to or use of the Services and notify the Company promptly of any such unauthorized access or use or any other known or suspected breach of security or misuse of the Services and (ii) be responsible for obtaining and maintaining any equipment, software and ancillary services needed to connect to, access or otherwise use the Services. + + - You will not use the Services to transmit or provide to the Company any financial or medical information of any nature, or any sensitive personal data (e.g., social security numbers, driver’s license numbers, birth dates, personal bank account numbers, passport or visa numbers and credit card numbers). You shall be responsible for the content of all communications sent by your users via the Services. You agrees not to use the Services to communicate any message or material that (i) is libelous, harmful to minors, obscene or constitutes pornography; (ii) infringes the intellectual property rights of any third party or is otherwise unlawful; or (iii) constitutes or encourages conduct that could constitute a criminal offense. + +# Professional Services + - The Company may perform Professional Services as described in an order form, which may identify additional terms or milestones. In such cases you will give the Company timely access to any materials reasonably needed to render the Professional Services, and the Company will use your materials only for purposes of providing Professional Services. + +# Fees + - In addition to any fees set forth in an applicable order form, you will pay the Company all fees charged to your account according to the prices and terms on the applicable pricing page, or as otherwise agreed in writing (collectively, “Fees”). You will provide complete and accurate billing information including a valid and authorized payment method. Your account will be charged an initial prepaid balance. You authorize the Company to replenish your account by charging a minimum or the higher average monthly usage to Customer’s payment instrument each time Customer’s account balance falls below the replenishment threshold. You authorize the Company and its affiliates, and its third-party payment processor(s), to charge your payment method for the Fees. Except as otherwise specified herein or in such Order Form, payment obligations are non-cancelable and non-pro-ratable for partial months, and fees paid are non-refundable. + + - The Company may suspend your access to the Services immediately upon notice if you fail to pay any amounts hereunder past the applicable due date. + +# IP + - The Company exclusively owns all right, title and interest in and to the Website, the Services, the Professional Services deliverables, and all related data. You exclusively own all right, title and interest in your data. Subject to this Agreement, the Company hereby grants you a non-exclusive, non-sublicensable right and license to use the Professional Services deliverables solely as part of its permitted use of the Services. + + - Model Licenses. The Company may grant you infrastructure on which you access, modify, or otherwise use models trained by third parties, and/or with third party data. Such models may come with their own terms and conditions. It is your responsibility to comply with the terms and conditions of those models. In case of any conflict between this Agreement and such terms, the model terms govern. + +# Confidentiality Restrictions + The parties will have no confidentiality obligations to each other unless otherwise agreed in writing. + You will not directly or indirectly: (a) reverse engineer, decompile, disassemble, modify, create derivative works of or otherwise create, attempt to create or derive, or permit or assist any third party to create or derive, the source code underlying the Services; (b) attempt to probe, scan or test the vulnerability of the Services, breach the security or authentication measures of the Services without proper authorization or wilfully render any part of the Services unusable; (c) use or access the Services to develop a product or service that is competitive with the Company’s products or services or engage in competitive analysis or benchmarking; (d) transfer, distribute, resell, lease, license, or assign the Services or otherwise offer the Services on a standalone basis; (e) make calls through the API that exceed limitson the number and frequency of such calls, or take any action that imposes an unreasonable or disproportionately heavy load on the API or the Services or that negatively affects the ability of others to access or use the API or Services; (viii) introduce any virus, worm, Trojan horse, malware, or other malicious code through the API or to the Services; (e) otherwise use the Services in violation of applicable law (including any export law) or outside the scope expressly permitted hereunder or in the applicable order form. + +# Warranties and Disclaimers + The Company warrants that (a) the Services will perform materially as described in the standard usage documentation for the Services and will not materially decrease the overall functionality of the Services during the applicable subscription term (the “Performance Warranty”), and (b) any Professional Services will be provided in a professional and workmanlike manner (the “Professional Services Warranty”). + The Company will use reasonable efforts to correct a verified breach of the Performance Warranty or Professional Services Warranty reported by Customer. These procedures are Customer’s exclusive remedies and the Companies sole liability for breach of the Performance Warranty or Professional Services Warranty. + EXCEPT AS EXPRESSLY SET FORTH HEREIN, EACH PARTY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. CUSTOMER’S USE OF THE SERVICES IS AT CUSTOMER’S SOLE RISK. THE SERVICES IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS. MOARK SHALL NOT BE LIABLE FOR THE RESULTS OF ANY COMMUNICATIONS SENT OR ANY COMMUNICATIONS THAT WERE FAILED TO BE SENT USING THE MOARK SOFTWARE, AND CUSTOMER ACKNOWLEDGES THAT THE INSIGHTS OR COMMUNICATIONS PROVIDED BY THE SERVICES DO NOT CONSTITUTE PROFESSIONAL ADVICE OR COUNSEL. MOARK IS NOT RESPONSIBLE OR LIABLE FOR ANY THIRD PARTY PLATFORMS, DOES NOT GUARANTEE THE CONTINUED AVAILABILITY THEREOF OR ANY INTEGRATION THEREWITH, AND MAY CEASE MAKING ANY SUCH INTEGRATION AVAILABLE IN ITS DISCRETION. MOARK MAKES NO WARRANTY THAT (I) THE SERVICES WILL MEET CUSTOMER’S REQUIREMENTS, (II) THE SERVICES WILL BE UNINTERRUPTED, TIMELY, SECURE, OR ERROR-FREE, (III) THE RESULTS THAT MAY BE OBTAINED FROM THE USE OF THE SERVICES WILL BE ACCURATE OR RELIABLE, OR (IV) THE QUALITY OF ANY PRODUCTS, SERVICES, INFORMATION, OR OTHER MATERIAL PURCHASED OR OBTAINED BY YOU THROUGH THE SERVICE WILL MEET YOUR EXPECTATIONS. + +# Limitation of Liability + Except for a party's indemnification obligations, gross negligence, willful misconduct or infringement or misappropriation of the other party's intellectual property rights, to the maximum extent permitted under applicable law, under no legal theory, whether in tort, contract, or otherwise, will either party be liable to the other under this agreement for (a) any indirect, special, incidental, consequential or punitive damages, including damages for loss of use, lost profits or interruption of business, even if informed of their possibility in advance. + +# General Terms + - The term of this Agreement will commence on the Effective Date and continue until your use of this Website, the Services, or Professional Support stops, or until terminated by the Company. + - Upon expiration or termination of this Agreement (a) all rights and obligations will immediately terminate except that any terms or conditions that by their nature should survive such expiration or termination will survive, including the terms and conditions relating to payment, proprietary rights and confidentiality, technology restrictions, disclaimers, indemnification, limitations of liability and termination and the general provisions below. + - The Company will not use your name or trademarks in any publicity (e.g., use of Customer name and/or logo in marketing materials, press releases, customer references and case studies) without your prior written consent. + - Neither party hereto may assign this Agreement without the other party’s prior written consent, except that either party may assign this Agreement without consent to a successor to all or substantially all of its assets or business related to this Agreement. Any attempted assignment by either party in violation hereof will be null and void. Subject to the foregoing, this Agreement will be binding on the parties and their successors and assigns. + - No amendment or modification to this Agreement, nor any waiver of any rights hereunder, will be effective unless assented to in writing by both parties. Any such waiver will be only to the specific provision and under the specific circumstances for which it was given, and will not apply with respect to any repeated or continued violation of the same provision or any other provision. Failure or delay by either party to enforce any provision of this Agreement will not be deemed a waiver of future enforcement of that or any other provision. + - Nothing contained herein will in any way constitute any association, partnership, agency, employment or joint venture between the parties hereto, or be construed to evidence the intention of the parties to establish any such relationship. Neither party will have the authority to obligate or bind the other in any manner, and nothing herein contained will give rise or is intended to give rise to any rights of any kind to any third parties. + - If a court of competent jurisdiction determines that any provision of this Agreement is invalid, illegal, or otherwise unenforceable, such provision will be enforced as nearly as possible in accordance with the stated intention of the parties, while the remainder of this Agreement will remain in full force and effect and bind the parties according to its terms. + - This Agreement will be governed by the laws of the State of California, exclusive of its rules governing choice of law and conflict of laws. This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods. + - This Agreement comprises the entire agreement between you and the Company with respect to its subject matter, and supersedes all prior and contemporaneous proposals, statements, sales materials or presentations and agreements (oral and written). No oral or written information or advice given by the Company, its agents or employees will create a warranty or in any way increase the scope of the warranties in this Agreement. + - Neither party will be deemed in breach hereunder for any cessation, interruption or delay in the performance of its obligations due to causes beyond its reasonable control (“Force Majeure Event”), including earthquake, flood, or other natural disaster, act of God, labor controversy, civil disturbance, terrorism, war (whether or not officially declared), cyber attacks (e.g., denial of service attacks), or the inability to obtain sufficient supplies, transportation, or other essential commodity or service required in the conduct of its business, or any change in or the adoption of any law, regulation, judgment or decree. diff --git a/docs_overseas/billing/_category_.json b/docs_overseas/billing/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..c52ec8c0d3ce771c53d294808fc984b54b276904 --- /dev/null +++ b/docs_overseas/billing/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "资源包与计费", + "position": 7, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/billing/coupons.md b/docs_overseas/billing/coupons.md new file mode 100644 index 0000000000000000000000000000000000000000..9d4411c5ebf59cf842374203df9bfa8a9c98bfd4 --- /dev/null +++ b/docs_overseas/billing/coupons.md @@ -0,0 +1,77 @@ +--- +sidebar_position: 4 +--- + +# Coupon Usage Guide + +Molifangzhou currently offers three types of coupons: **Cash Vouchers**, **Discount Vouchers**, and **Computing Power Vouchers**. They are applicable to different payment scenarios. The following are specific usage rules and operation instructions: + +## Cash Vouchers + +**Definition**: Platform-wide vouchers that can be used in all paid scenarios. + +### Usage Rules + +- **Payment Priority**: Cash vouchers take priority over cash balances. Multiple eligible cash vouchers can be used simultaneously. +- **Usage Frequency**: Can be used multiple times until the validity period expires or the balance is exhausted. +- **Restrictions**: Cannot be withdrawn, transferred, or used for invoicing; invalid when status is "expired" or "used up" (balance is 0); cannot offset arrears. +- **Refund Rules**: The portion paid with cash vouchers will be returned to the cash voucher account. + +### Redemption Method + +After obtaining the cash voucher redemption code issued by the platform, go to [Billing Center - Cash Vouchers]({{SITE_URL}}/dashboard/billing/coupons/cash) and click "Redeem" in the upper right corner. + +![alt text](../../static/img/billing/image.png) + +The redemption page displays details of the cash voucher (such as face value, effective/expiry dates). If the input format is incorrect, invalid, or already redeemed, a corresponding error message will be prompted. + +### Usage Steps + +When purchasing resources (e.g., Serverless API), the order page will automatically check available cash vouchers by default. + +After payment is completed, the cash voucher balance will be deducted automatically. You can view usage records and remaining balance on the [Cash Vouchers page]({{SITE_URL}}/dashboard/billing/coupons/cash). + +## Discount Vouchers + +**Definition**: Discount vouchers are certificates that can deduct part of the amount or provide discounts during settlement, helping users obtain goods or services at a lower price. + +### Usage Rules + +- **Usage Frequency**: Only one discount voucher can be used per order, and it cannot be combined with computing power vouchers or cash vouchers. +- **Restrictions**: The portion deducted by discount vouchers does not support invoicing; invalid when status is "expired" or "used"; cannot offset arrears. +- **Refund Rules**: Discount vouchers cannot be returned after order payment, and they are only valid within the specified period. + +### Redemption Method + +After obtaining the discount voucher redemption code issued by the platform, go to [Billing Center - Discount Vouchers]({{SITE_URL}}/dashboard/billing/coupons/discount) and click "Redeem" in the upper right corner. + +The redemption page displays details of the discount voucher (such as discount rate, effective/expiry dates). If the input format is incorrect, invalid, or already redeemed, a corresponding error message will be prompted. + +### Usage Steps + +When purchasing resources (e.g., Serverless API), the order page will automatically check available discount vouchers by default. + +After payment is completed, the discount voucher will be consumed automatically. You can view usage records on the [Discount Vouchers page]({{SITE_URL}}/dashboard/billing/coupons/discount). + +## Computing Power Vouchers + +**Definition**: Computing power vouchers are related to computing power types and are special vouchers only used for purchasing computing power resources. They need to match the computing power provider (e.g., MaxXIntel, Muxi, etc.). + +### Usage Rules + +- **Payment Priority**: When making payments, computing power vouchers take priority over cash vouchers and cash balances. Multiple eligible computing power vouchers can be used simultaneously. +- **Usage Frequency**: Can be used multiple times until the validity period expires or the balance is exhausted. +- **Restrictions**: The portion paid with computing power vouchers does not support invoicing; invalid when status is "expired" or "used up" (balance is 0); cannot offset arrears. +- **Refund Rules**: When refunding, the portion paid with computing power vouchers will be returned to the computing power voucher account. + +### Redemption Method + +After obtaining the 16-digit unique redemption code for the computing power voucher issued by the platform, go to [Billing Center - Computing Power Vouchers]({{SITE_URL}}/dashboard/billing/coupons/compute), click the "Redeem" button in the upper right corner, and enter the redemption code to complete the redemption. + +The redemption page displays details of the computing power voucher (such as face value, effective/expiry dates, applicable providers). If the input format is incorrect, invalid, or already redeemed, a corresponding error message will be prompted. + +### Usage Steps + +When purchasing computing power resources (e.g., "Muxi - Model Resource Package"), you need to select the resource package of the computing power provider that matches the computing power voucher (selecting other resource packages will make the computing power voucher unavailable). + +The order page will automatically check available computing power vouchers by default. After payment is completed, the computing power voucher balance will be deducted automatically. You can view usage records and remaining balance on the [Computing Power Vouchers page]({{SITE_URL}}/dashboard/billing/coupons/compute). diff --git a/docs_overseas/billing/intro.md b/docs_overseas/billing/intro.md new file mode 100644 index 0000000000000000000000000000000000000000..7bc9cb039db0fbe9b86049f215bbd9404506cf3e --- /dev/null +++ b/docs_overseas/billing/intro.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 1 +--- + +# Introduction to Resource Packages + +This chapter covers content related to MoArk's resource packages, billing methods, how to view bills, and usage logs. + +## Resource Packages + +Model resource packages are prepaid model call service packages provided by MoArk for users, including: + +### Full Model Resource Package + +The Full Model Resource Package is a prepaid model API call package that allows users to use the APIs of all deployed models on the Model Plaza. It is suitable for users who need to call multiple types of models. The system will automatically deduct the corresponding fees from the resource package according to the pricing standards of different models. + +When users use the Full Model Resource Package, the system will automatically schedule and allocate computing power to ensure that users can efficiently call the required models. Since models are deployed on more than one computing cluster, if a computing cluster fails, the system will automatically switch to other available computing clusters to ensure the stability and reliability of model calls. + +**It is recommended that users choose the Full Model Resource Package first.** + +### Compute Resource Package + +Different from the Full Model Resource Package, the Computing Power Resource Package refers to a model service package on a single computing cluster. For example, if 50 models are deployed on the `沐曦集群`, then when you purchase the Muxi Computing Power Resource Package, you can only use these 50 models. + +## Billing Points + +MoArk's billing points include model resource packages . + +## Statistics and Logs + +In MoArk's workbench, you can view resource usage and call logs: + +- **Usage Statistics**: View macro data statistics of Serverless API calls to understand the distribution of core indicators of resource usage. [查看用量统计]({{SITE_URL}}/dashboard/statistics/usage-statistics) +- **Usage Logs**: Provide detailed behavior records of resource calls, supporting conditional filtering to accurately locate detailed information of each API call. [查看使用日志]({{SITE_URL}}/dashboard/statistics/usage-logs) \ No newline at end of file diff --git a/docs_overseas/billing/invoice.md b/docs_overseas/billing/invoice.md new file mode 100644 index 0000000000000000000000000000000000000000..5c8b7c993ef1d5903f4a6c5892d9514442ae73e6 --- /dev/null +++ b/docs_overseas/billing/invoice.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 3 +--- + +# Invoice Application Guide + +## Prerequisites + +- **Order Status Requirements**: Invoices can only be issued for the cash amount paid in completed orders. Orders with statuses such as pending payment, pending review, or cancelled cannot be invoiced. Orders with refunds are not eligible for invoicing, and orders for which invoices have been issued cannot be refunded. +- **Amount Type Requirements**: Invoices can only be issued for completed orders. Invoicing is not allowed for uncompleted transactions or orders with statuses like pending payment, in preparation, or pending review. Only electronic versions of VAT ordinary invoices and VAT special invoices are available for application. +- **Information Preparation**: Before applying for an invoice, you need to confirm the invoice information (such as invoice title, email address, etc.) in "Invoice Information Management". For VAT special invoices, you need to upload the business license and general taxpayer certificate. + +## Operation Steps + +1. **Select an Order**: Go to the [Invoice Management Homepage]({{SITE_URL}}/dashboard/billing/invoices) and click [Apply for Invoice]({{SITE_URL}}/dashboard/billing/invoices/apply) in the upper right corner. + + Select a qualified completed order (you can view information such as order number, service, product, deduction time, and payment amount). + + ![invoice01](/img/billing/invoice01.jpg) + +2. **Apply for Invoice**: After selecting the order and submitting the application, you will enter the "Apply for Invoice" page (you can also enter this page when modifying invoice information). The form will read the content from "Invoice Information Management". You can modify the information on the page without affecting the originally stored information. You need to verify the invoice type and information with the finance department (once the invoice is issued, it cannot be changed). + + ![invoice02](/img/billing/invoice02.jpg) + +3. **Submit and Send**: After confirming that the information is correct, submit the application. The electronic invoice will be sent to the email address filled in during submission within 7-15 working days. You can search for "Shenzhen Aosi" in your email to check it. + +## Other Notes + +- For invoicing records that are pending review or rejected, you can modify the information and apply for re-issuance. +- The invoice management page allows you to check the remaining invoice amount, historical invoicing records (including statuses such as in progress, issued, refund pending, etc.), and view invoice details. + + ![invoice03](/img/billing/invoice03.jpg) \ No newline at end of file diff --git a/docs_overseas/billing/purchase.md b/docs_overseas/billing/purchase.md new file mode 100644 index 0000000000000000000000000000000000000000..aed24797e3827691281d5d909f7bf02d11f1724e --- /dev/null +++ b/docs_overseas/billing/purchase.md @@ -0,0 +1,91 @@ +--- +sidebar_position: 2 +--- + +# Purchasing Model Resource Packages + +## Introduction + +MoArk model resource packages are prepaid model call service packages provided by the platform to meet users' needs for using models in various scenarios. They can be used in paid scenarios such as Serverless API calls, supporting full model coverage and specific computing power scenarios. They take effect immediately after purchase, automatically deduct call fees, and remain valid until the resource package is used up or expires. + +Types of resource packages include: + +- **Full Model Resource Package**: Covers all available models on the platform, automatically matches the optimal computing power during calls, no manual selection required, suitable for most general scenarios; +- Computing Power Resource Packages: Such as Muxi Resource Package, Iluvatar CoreX Resource Package, etc., which only support the computing power and models of corresponding manufacturers and need to be manually bound to tokens for use. + +## Full Model Resource Package + +### Core Advantages + +- **Full Model Coverage**: Supports all Serverless API models on the platform (such as text generation, image recognition, video generation, etc.), no need to purchase multiple resource packages separately; +- **Automatic Computing Power Selection**: Automatically matches the optimal computing power (such as Muxi·Xiyun C Series, Iluvatar CoreX·Tian gai Series, etc.) according to model type and task complexity during calls, no manual specification required; +- **Flexible Deduction**: Regardless of the model or computing power used, fees are uniformly deducted from the balance of the Full Model Resource Package, simplifying management. + +### Purchase Entry + +Visit directly: [全模型资源包购买页]({{SITE_URL}}/serverless-api/order?package=1910) , select the purchaser (individual/organization) and the purchase amount + +![image](/img/purchase/purchase03.png) + +Click Next, and deductions will be made in order of payment priority + +![image](/img/purchase/purchase05.png) + +### Create Order and Make Payment + +After the payment is successful, you can view the order details in [Order Management]({{SITE_URL}}/dashboard/billing/orders), including order number, purchase time, payment amount, resource package information, etc. + +## Computing Power Resource Package + +### Select Resource Package + +Visit [AI 模型广场]({{SITE_URL}}/serverless-api) , you can learn about inference effects through online experience, and select resource packages that suit your needs by trying out effects on different APIs and computing power. + +![image](/img/purchase/purchase04.png) + +### Purchase Resource Package + +After being satisfied with the experience, click the "Purchase" button at the top right of the page, select the resource package ownership (individual or organization) and the purchase amount, and custom amounts are supported. + +![image](/img/purchase/purchase02.png) + +### Create Order and Make Payment + +After successful payment, you can view order details in [订单管理]({{SITE_URL}}/dashboard/billing/orders) , including order number, purchase time, payment amount, resource package information, etc. + +## Token Management and Calling + +Access tokens are identity credentials for calling MoArk APIs, closely related to resource package authorization and calls. For detailed rules, please refer to the **[访问令牌文档](/docs/organization/access-token)** + +## Resource Package Renewal and Selection Strategy + +### Resource Package Renewal Process + +Users can enter the [**模型资源包管理页面**]({{SITE_URL}}/dashboard/serverless) to view the call details and remaining days of the corresponding model resource package. If renewal is needed, click the "Renew" button of the corresponding resource package, reselect the amount according to the purchase process, and complete the payment. After renewal, the validity period will be reset. + +### Resource Package Selection Strategy + +Different resource packages correspond to **different manufacturers' computing power**, with differences in supported model ranges and prices. The selection suggestions are as follows: + +#### Priority Recommendation: Full Model Resource Package + +- **Core Advantages**: Covers **all available models** on the platform, automatically matches the optimal computing power during calls (no manual specification required), one purchase can meet multiple scenario needs, with the highest flexibility. +- **Purchase Entry**: Click directly [**Purchase Full Model Resource Package**]({{SITE_URL}}/serverless-api/order?package=1910) to place an order quickly. + +#### Optional for Specific Scenarios: Manufacturer-specific Resource Packages + +It is recommended to choose only when **holding corresponding computing power coupons** (such as "Muxi Computing Power Coupon", "Iluvatar CoreX Computing Power Coupon"): + +- **Value**: Computing power coupons can deduct resource package fees (e.g., a 100-yuan computing power coupon directly deducts 100 yuan for the corresponding manufacturer's resource package), reducing costs; +- **Limitations**: Without computing power coupons, exclusive resource packages only support a single manufacturer's computing power, which will **limit the range of models used**, and their flexibility is far lower than that of the Full Model Resource Package. It is not recommended to purchase them separately. + +### Reference Documents + +- **Correspondence between Models and Computing Power**: Check [Model Hub)](../products/apis) to learn about the models supported by different manufacturers' resource packages; +- **Resource Package Price Details**: Visit [Model Hub]({{SITE_URL}}/serverless-api) to compare the prices and benefits of each resource package. + +## Other Notes + +- The default validity period of model resource packages is one year. If you need to extend the validity period, you can renew according to the [资源包续费流程](/billing/purchase.md#资源包续费流程) . +- Please keep your account information properly to avoid unauthorized use of resource packages due to account theft. +- If you need to issue an invoice for purchasing model resource packages, you can apply according to the platform's [发票开具流程](invoice.md) . \ No newline at end of file diff --git a/docs_overseas/getting-started.md b/docs_overseas/getting-started.md new file mode 100644 index 0000000000000000000000000000000000000000..741fea574b2c9e9c508e23fc33149931749c3112 --- /dev/null +++ b/docs_overseas/getting-started.md @@ -0,0 +1,64 @@ +--- +title: Getting Started +description: This document will guide you through the process of registering an account, logging in, and successfully calling an open-source large model through the API. It will help you quickly get started with MoArk and experience the power of AI. +sidebar_position: 2 +hide_table_of_contents: true +--- + +# Getting Started —— Quick Experience with Open-Source Large Models + +Welcome to MoArk! This document will guide you through the process of registering an account, logging in, and successfully calling an open-source large model through the API. It will help you quickly get started with MoArk and experience the power of AI. + +## Step 1: Register and Log in to an Account + +To use the features of MoArk, you first need an account. + +1. Visit [**MoArk**]({{SITE_URL}}) and click on the "Login" button in the top-right corner. +2. You will be redirected to the Gitee login page. If you don't have a Gitee account, please [register](https://gitee.com/signup) first. +3. After logging in, you will be directed to the console. Each account is free to call various models daily, with a total of **100** times. + +## Step 2: Experience Models Online + +We provide a "Model Square" where you can directly interact with over 100+ popular open-source large models in your browser without any programming. + +1. In the top navigation bar of the page, find and click on [**Model Square**]({{SITE_URL}}/serverless-api). +2. In the Model Square, you can see various types of models, such as `DeepSeek`、 `Qwen`、`Stable Diffusion` and so on. +3. Select a text generation model you are interested in, for example, **DeepSeek-R1**, and click to enter [Model Experience]({{SITE_URL}}/serverless-api?model=DeepSeek-R1&tab=info). +4. On the model detail page, you will first see the basic introduction, interface, pricing, and other information of the model. Click the **Online Experience** button to see a conversation interface. In the input box, enter your question or instruction, for example: "Please write a five-word quatrain about spring," and then click "Send." +5. Wait a moment for the model to generate a response. Congratulations! You have successfully interacted with a large model! + +![Model Online Experience](../static/img/serverless-api/use.jpg) + +## Step 3: Use API to Call Models + +Although online experience is very convenient, for developers, directly calling models through the API is more flexible. MoArk provides OpenAI-compatible interfaces, allowing you to integrate model capabilities into your own applications. + +1. In the model experience page, find the **API** section, and you will see a sample code snippet. + ![Model Online Experience](../static/img/serverless-api/api.jpg) +2. Copy the sample code and replace `api_key` with your own token ([Create Token](/docs/organization/access-token)). Next, you can run the code in your own Python environment. +3. For more details about the API, you can refer to the [API Documentation](/docs/openapi/v1). +4. A simple Python example of calling a large model: + +```python showLineNumbers title="python" +import requests + +url = "{{SITE_URL}}/v1/chat/completions" +headers = { + "Authorization": "Bearer ", + "Content-Type": "application/json" +} +data = { + "model": "DeepSeek-R1", # Model name + "messages": [ + {"role": "user", "content": "请帮我写一首关于春天的五言绝句"} + ], + "max_tokens": 100, # Maximum number of tokens to generate + "temperature": 0.7 # Control the randomness of the generated text +} +response = requests.post(url, headers=headers, json=data) +if response.status_code == 200: + result = response.json() + print("Model Response:", result['choices'][0]['message']['content']) +else: + print("Request Failed, Status Code:", response.status_code, "Error Message:", response.text) +``` diff --git a/docs_overseas/index.md b/docs_overseas/index.md new file mode 100644 index 0000000000000000000000000000000000000000..2f2436488251c5070258911b97319b2f22861d9e --- /dev/null +++ b/docs_overseas/index.md @@ -0,0 +1,151 @@ +--- +title: Documentation Center +sidebar_label: Quick Navigation +description: MoArk is a collaborative AI application platform designed for developers, end users, and industry scenarios. It provides highly available Model API services, API workflows, and model fine-tuning capabilities, empowering developers to build production-ready AI applications and establish commercial closed loops with users and real-world use cases. +sidebar_position: 1 +hide_table_of_contents: true +--- + +import { FaRocket } from 'react-icons/fa'; +import { MdDataset } from 'react-icons/md'; +import { FaDatabase } from 'react-icons/fa'; +import { PiGearFineBold } from 'react-icons/pi'; +import { IoStorefront } from 'react-icons/io5'; +import { FaRunning } from 'react-icons/fa'; +import { FaQuestionCircle } from 'react-icons/fa'; +import { MdFeedback } from 'react-icons/md'; +import { MdContactPhone } from 'react-icons/md'; +import { FaStream } from 'react-icons/fa'; // API Pipeline +import { FaEdit } from 'react-icons/fa'; // Text Generation +import { IoIosImage } from 'react-icons/io'; // ✅ 正确的 Image 图标 + +# MoArk Documentation Center + +MoArk is a collaborative AI application platform designed for developers, end users, and industry scenarios. It provides highly available Model API services, API workflows, and model fine-tuning capabilities, empowering developers to build production-ready AI applications and establish commercial closed loops with users and real-world use cases. + +
+ + +
+

+ + Quick Start +

+
+
+ Sign up and instantly access MoLi Ark’s core features—get started with AI in seconds. +
+
+ + +
+

+ + Model Online Experience +

+
+
+ Explore 100+ models online—ready-to-use, zero setup required. +
+
+ + +
+

+ + Integrations +

+
+
+ Quickly integrate MoArk’s models—seamless onboarding to deployment. +
+
+ + + +
+

+ + API Pipeline +

+
+
+ Orchestrate models and services into reusable, production-ready AI workflows. +
+
+ + + +
+

+ + Text Generation & Completion +

+
+
+ Generate high-quality text for content creation, coding, and dialogue. +
+
+ + + +
+

+ + Image & Vision +

+
+
+ Enable image understanding, object detection, and generation. +
+
+ +
+ +## Community Communication + +
+ + +
+

+ + Common Questions +

+
+
+ This section lists common questions users encounter while using MoArk and provides solutions to these issues. +
+
+ + +
+

+ + Feedback +

+
+
+ If you encounter any issues or have suggestions for improvement during use, we welcome your feedback via our community or support ticket system. +
+
+ + +
+

+ + Contact Us +

+
+
+ Shenzhen Austudy Research & Engineering Co., Ltd.
+ Address: 22F, Nanshan Cloud Technology Building, Xili, Nanshan District, Shenzhen +
+
+ +
+ +:::info Contribute to Our Docs +Welcome to contribute to our documentation! If you find any errors or have suggestions for improvement, feel free to submit a pull request. We will reward you with a voucher for your contribution. +**Contribution Method**: Click the `Edit this page` link at the bottom of the documentation page you want to improve. +::: \ No newline at end of file diff --git a/docs_overseas/integrations/Browser-Tools/_category_.json b/docs_overseas/integrations/Browser-Tools/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..d888021aba79e1527c6cda4b0ffb29012a9301fc --- /dev/null +++ b/docs_overseas/integrations/Browser-Tools/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "浏览器插件", + "position": 5, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/integrations/Browser-Tools/immersive.md b/docs_overseas/integrations/Browser-Tools/immersive.md new file mode 100644 index 0000000000000000000000000000000000000000..4b7da40a8e79a81571f2300cd4081c43df7c1c3a --- /dev/null +++ b/docs_overseas/integrations/Browser-Tools/immersive.md @@ -0,0 +1,37 @@ +--- +sidebar_position: 1 +--- + + +# Immersive Translate + +[Immersive Translate](https://immersivetranslate.com/) is a cutting-edge AI bilingual translation tool that excels in cross-lingual comprehension. It has served over 1 million users and is perfectly adapted for web bilingual comparisons, PDF translations, EPUB book interpretations, and video subtitle generation. It supports multi-browser plugin deployments. + +By integrating MoArk's translation services, you can further enhance translation speed and accuracy, unlocking more diverse large model application scenarios. + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Install and Open the Plugin +1. Go to [Immersive Translate Official Website](https://immersivetranslate.com/) and download the plugin for your browser. +2. Click on the plugin icon in your browser toolbar to open the Immersive Translate interface. + +## Configure Translation Services + +1. In the Immersive Translate extension, go to **"Translation Services" -> "Add Custom Translation Service"**. + + ![Add Custom Translation Service](/img/serverless-api/integrated/integrate5.png) + +2. On the settings page, input the following key information: + +- Custom API Interface Address: _Enter the complete call address of the Serverless API here_ +- APIKEY: Paste the previously copied access token +- Maximum Requests per Second: 1 +- Maximum Text Length per Request: 1200 +- Maximum Segments per Request: 8 + +3. Click the "Test Service" button above the page. If the configuration is successful, you will see "Verification Successful". + + ![Test Service](/img/serverless-api/integrated/integrate6.png) diff --git a/docs_overseas/integrations/Development-Tools/Cline.md b/docs_overseas/integrations/Development-Tools/Cline.md new file mode 100644 index 0000000000000000000000000000000000000000..685ef2ba8f28456d6d961eab943179edd93da7a0 --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/Cline.md @@ -0,0 +1,37 @@ +--- +sidebar_position: 3 +--- + +# Cline + +Cline is a powerful, open-source AI coding assistant designed to boost developer productivity within the VS Code environment. It leverages the intelligence of large language models to enable developers to perform complex tasks directly in their local VS Code workspace. + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Configure Cline Plugin +1. Open the VS Code Extensions Marketplace, search for Cline, and click **Install**. + + ![Install Cline Plugin](/img/serverless-api/integrated/cline01.png) + +2. After installation, open the VS Code command palette (`Ctrl+Shift+P`), type `Cline` : Configure Cline Plugin, and select the command. + + ![Configure Cline Plugin](/img/serverless-api/integrated/cline02.png) + +3. Enter the required configuration details. + + ![Enter Configuration](/img/serverless-api/integrated/cline03.png) + +- **API Provider**: Select "OpenAI Compatible Service". +- **Base URL**: Retrieve the base URL from the [**AI Model Hub**]({{SITE_URL}}/serverless-api). +- **API Key**: Paste the access token copied from [**Dashboard -> Settings -> Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +- **Model ID**: Copy the desired model's ID from the [**AI Model Hub**]({{SITE_URL}}/serverless-api). + +4. After configuration, you can return to the conversation page to start using Cline. + + ![Install Cline Plugin](/img/serverless-api/integrated/cline04.png) + + + diff --git a/docs_overseas/integrations/Development-Tools/Cursor.md b/docs_overseas/integrations/Development-Tools/Cursor.md new file mode 100644 index 0000000000000000000000000000000000000000..937eb1efadb8351303e706502e16de1991814ef6 --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/Cursor.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 4 +--- + +# Cursor +Cursor is an AI-powered integrated development environment (IDE) designed specifically for developers. It seamlessly integrates artificial intelligence to help you write, understand, and optimize code more efficiently. Leveraging advanced AI capabilities, Cursor enables features like intelligent code completion, code explanation, and rapid snippet generation, significantly boosting productivity—especially for managing complex logic or prototyping projects quickly. By integrating MoArk resource packages into Cursor, developers can further enhance their workflow by leveraging Gitee's ecosystem. + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Configuration Guide +1. In Cursor, click the settings icon in the top-right corner and add a model from your MoArk resource package. + + ![Add Model](/img/serverless-api/integrated/cursor01.png) + +2. Enter the Model ID, API Key (Access Token), and Base URL as prompted. + + ![Enter Information](/img/serverless-api/integrated/cursor02.png) + +- **Model ID**:Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) and copy the Model ID of the required model. +- **API Key**:Go to [**Dashboard->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) to obtain your access token. +- **Base URL**:Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) to get the Base URL. + +3. Click the `Verify` button to complete the configuration. You should now be able to use the model from your MoArk resource package in Cursor. + + ![Verify Success](/img/serverless-api/integrated/cursor03.png) diff --git a/docs_overseas/integrations/Development-Tools/RooCode.md b/docs_overseas/integrations/Development-Tools/RooCode.md new file mode 100644 index 0000000000000000000000000000000000000000..659c385b0314f9cf7184dde9c87fba88821f3adb --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/RooCode.md @@ -0,0 +1,37 @@ +--- +sidebar_position: 5 +--- +# RooCode + +RooCode is an intelligent coding assistant designed to enhance code collaboration efficiency and automate development workflows. It provides development teams with a smart platform that simplifies coding, code review, and maintenance, making software development faster and more efficient. + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Configure RooCode Plugin +1. Open the VS Code Extensions Marketplace, search for RooCode, and click **Install**. + + ![Install RooCode Plugin](/img/serverless-api/integrated/roocode01.png) + +2. After installation, open the VS Code Command Palette (Ctrl+Shift+P), input RooCode: Configure RooCode Plugin, and click **Configure**. + + ![Configure RooCode Plugin](/img/serverless-api/integrated/roocode02.png) + +3. After configuration, the RooCode icon will appear in the left sidebar of VS Code. Click the icon to access the configuration page, where you can input the necessary configuration information. + + ![Configure RooCode Plugin](/img/serverless-api/integrated/roocode03.png) + +- **API Provider**:Select OpenAI Compatible Service +- **OpenAI Base URL**:Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) to get the Base URL +- **API Key**:Paste the access token you previously copied from [**Dashboard->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) +- **Model**:Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) to select the required model + +4. After configuration, you can return to the conversation page to start using RooCode. The left-bottom corner of the chat window provides several working modes. + + ![Install RooCode Plugin](/img/serverless-api/integrated/roocode04.png) + + You can also switch modes directly using the /cmd command: + + ![Switch RooCode Mode](/img/serverless-api/integrated/roocode05.png) diff --git a/docs_overseas/integrations/Development-Tools/Trae.md b/docs_overseas/integrations/Development-Tools/Trae.md new file mode 100644 index 0000000000000000000000000000000000000000..96edc806a92ab6808e0d6bf20fea16055ba80af5 --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/Trae.md @@ -0,0 +1,44 @@ +--- +sidebar_position: 2 +--- + +# Trae + +[Trae](https://www.trae.ai/ja/) is an AI IDE developed by ByteDance, which features multiple high-quality models and supports one-click switching. Users can integrate **MoArk**'s model resources using API keys (access tokens) in Trae Chat mode, enabling personalized configuration and usage. + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## How to Switch Models + In the bottom-right corner of the input box, click the current model name to open the model list, and select the target model to switch. + + Hover your mouse over a model name to view its specific capabilities. + ![alt text](/img/serverless-api/integrated/trae02.png) + +## Call Built-in Models +1. Click the model name in the bottom-right corner of the input box to open the model list window. +2. In the model list window, scroll to the bottom and click the **Add Model** button. + + ![alt text](/img/serverless-api/integrated/trae01.png) + +3. Follow the prompts in the pop-up window to select the service provider "gitee" and the desired model, then enter the previously copied access token as the API key. Click **Add** to complete the process. + + ![alt text](/img/serverless-api/integrated/trae03.png) + +## Add Other Models + +You can also add other models that are not built-in in Trae: + +1. In the Add Model pop-up window, select **Use Other Models**. + + ![alt text](/img/serverless-api/integrated/trae04.png) + +2. Enter the ID of the target model and fill in the corresponding API key. Click **Add** to complete the process. + + ![alt text](/img/serverless-api/integrated/trae05.png) + +3. Return to the Trae main interface. In the conversation window, you will see the newly added model. You can now select the model to start conversations or generate code. + + ![alt text](/img/serverless-api/integrated/trae06.png) diff --git a/docs_overseas/integrations/Development-Tools/_category_.json b/docs_overseas/integrations/Development-Tools/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..a0829344bcd4692a3dc0c24e4936400d530f490d --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "开发工具", + "position": 3, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/integrations/Development-Tools/claude-code.md b/docs_overseas/integrations/Development-Tools/claude-code.md new file mode 100644 index 0000000000000000000000000000000000000000..0d6ff6d389de1e34337d8a85be5e9c4e5bf0ef09 --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/claude-code.md @@ -0,0 +1,110 @@ +--- +sidebar_position: 7 +--- + +# Claude Code + +Claude Code is Anthropic's AI programming assistant. We provide a complete integration solution for Claude Code, allowing you to seamlessly connect with various model providers and experience flexible AI programming assistant. By our integration solution, you can enjoy the latest updates from Anthropic while maintaining complete control over the model interaction way. + +### Configuration Guide + +Serverless API supports calling in Claude Code. The steps are as follows: + +1. Install Claude Code and Integration Tools + + First, ensure that you have installed Claude Code in your development environment: + + ```bash + npm install -g @anthropic-ai/claude-code + ``` + + Then, install Claude Code Router as the integration tool: + + ```bash + npm install -g @musistudio/claude-code-router + ``` + +2. Get MoArk Access Token + + Developers need to first access [**Workbench->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) to get the access token. Developers without Serverless API purchased can use the free experience access token (for experience only, with limited daily call times), just copy the token they want to use. + + ![](/img/serverless-api/integrated/integrate14.png) + +3. Configure Integration File + + Create a configuration file `~/.claude-code-router/config.json` in your home directory and replace `your-api-key` with your access token: + + ```json showLineNumbers title="config.json" + { + "Providers": [ + { + "name": "gitee", + "api_base_url": "https://ai.gitee.com/v1/chat/completions", + "api_key": "your-api-key", + "models": ["kimi-k2-instruct"], + "transformer": { + "use": [ + [ + "maxtoken", + { + "max_tokens": 131072 + } + ] + ] + } + } + ], + "Router": { + "default": "gitee,kimi-k2-instruct", + "background": "gitee,kimi-k2-instruct", + "think": "gitee,kimi-k2-instruct", + "longContext": "gitee,kimi-k2-instruct" + }, + "APIKEY": "your-secret-key", + "LOG": true, + "HOST": "0.0.0.0" + } + ``` + +4. Start Integration Service + + Start Claude Code through our integration solution: + + ```bash + ccr code + ``` + + ![](/img/serverless-api/integrated/claude-code-integrate.png) + +5. Use MoArk in Claude Code + + At this point, developers can call models from MoArk in Claude Code. You can also switch models in real-time during development: + + ``` + /model gitee,kimi-k2-instruct + ``` + + ![](/img/serverless-api/integrated/claude-code-checkout-model.png) + +### Configuration Parameters + +- **APIKEY** (optional): Set the key to verify requests +- **PROXY_URL** (optional): Set the proxy for API requests +- **LOG** (optional): Enable logging, the log file will be located at `$HOME/.claude-code-router.log` +- **HOST** (optional): Set the host address of the server + +### Intelligent Routing Configuration + +Routing configuration defines the models used in different scenarios: + +- **default**: Default model, used for all requests if no other routes are configured +- **background**: Model used for background tasks +- **think**: Model used for thinking tasks +- **longContext**: Model used for long context tasks + +### More Resources + + +- [平台 API 文档](/docs/openapi/v1) +- [Claude Code 官方文档](https://docs.anthropic.com/claude/docs) +- [集成工具 GitHub 仓库](https://github.com/musistudio/claude-code-router) diff --git a/docs_overseas/integrations/Development-Tools/continue.md b/docs_overseas/integrations/Development-Tools/continue.md new file mode 100644 index 0000000000000000000000000000000000000000..be3db592266f76be506da2183047626b68b0a21d --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/continue.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 6 +--- + +# Continue + +[Continue](https://github.com/continuedev/continue) is the leading open-source AI code assistant. You can connect any model and any context, and build custom autocomplete and chat experiences in VS Code and JetBrains. + +### Configuration Guide + +After installing the continue extension in VS Code and JetBrains, follow the steps below: +serverless API provides [OpenAI compatible API ](https://docs.continue.dev/customize/model-providers/openai#openai-compatible-servers--apis), using the deepseek model as an example, you can replace it with the corresponding configuration for other models + +```json +# config.json + +{ + "completionOptions": { + "BaseCompletionOptions": { + "temperature": 0.0, + "maxTokens": 256 + } + }, + "models": [ + { + "title": "DeepSeek-33b", + "model": "deepseek-33b", + "apiKey": "#{APIKEY}", + "apiBase": "{{SITE_URL}}/v1/", + "provider": "openai" + } + ], + "tabAutocompleteModel": { + "title": "DeepSeek-33b", + "model": "deepseek-33b", + "apiKey": "#{APIKEY}", + "apiBase": "{{SITE_URL}}/v1/", + "provider": "openai" + }, +... +``` diff --git a/docs_overseas/integrations/Development-Tools/dify.md b/docs_overseas/integrations/Development-Tools/dify.md new file mode 100644 index 0000000000000000000000000000000000000000..6e06cc449089fa138914aee822c29b7d4bf38762 --- /dev/null +++ b/docs_overseas/integrations/Development-Tools/dify.md @@ -0,0 +1,59 @@ +--- +sidebar_position: 1 +--- + +# Dify + +Dify is an open-source LLM (Large Language Model) application development platform that combines Backend-as-a-Service (BaaS) and [LLMOps](https://docs.dify.ai/v/zh-hans/learn-more/extended-reading/what-is-llmops) principles, enabling developers to rapidly build production-ready generative AI applications. Even non-technical users can participate in defining AI applications and managing data operations. + +You can integrate MoArk's Serverless API with Dify by following the steps below: + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Integrate MoArk Models into Dify Applications +MoArk provides a range of models that can be seamlessly integrated into Dify's application orchestration process. Whether it's calling built-in models or adding custom models, developers have the flexibility to combine model capabilities in various ways to build generative AI applications that meet business requirements. Here's how to do it: + +### Call Built-in Models + +For commonly used MoArk models, Dify has pre-configured integration settings, allowing developers to enable these models with just a few simple steps, quickly start building applications. + +1. Log in to [Dify](https://cloud.dify.ai) , click **Settings** in the top-right corner, and select [**Model Providers**]({{SITE_URL}}/dashboard/settings/model-providers). + + ![Install MoArk](/img/serverless-api/integrated/dify01.png) + +2. Select MoArk and install it, then input the previously copied access token, and click "Save". + + ![Add MoArk Token](/img/serverless-api/integrated/dify02.png) + +3. Now, you can call MoArk models in Dify application orchestration. + + **MoArk provides 53 models for developers to call**, covering various application domains such as text generation, text completion, text embedding, re-ranking, speech-to-text, and text-to-speech. + + ![Model](/img/serverless-api/integrated/dify03.png) + + After orchestration, click **Publish** to release the application, and now you have an application based on MoArk models and computational resources. + +### Add Custom Models + +If you need to use MoArk's special models that are not built-in to Dify, you can add them to the Dify environment through custom configuration, extending the range of models available for application development. + +1. Log in to [Dify](https://cloud.dify.ai) , click **Settings** in the top-right corner, and select [**Model Providers**]({{SITE_URL}}/dashboard/settings/model-providers). + + ![Install MoArk](/img/serverless-api/integrated/dify01.png) + +2. Select the installed MoArk models in the model list, input the corresponding access tokens, and click "Add Model". + + ![Add Model](/img/serverless-api/integrated/dify05.png) + +3. In the pop-up window, **Select Model Type->Enter Model Name->Input Access Token**. + + ![Input Information](/img/serverless-api/integrated/dify06.png) + +- **Model Type**:Select the model type based on your requirements +- **Model Name**:Choose from [**AI Model Square**]({{SITE_URL}}/serverless-api) +- **API Key**:Obtain from [**Workbench->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) + +4. After configuration, you can see the newly added model in the model list. diff --git a/docs_overseas/integrations/IM-Assistant/_category_.json b/docs_overseas/integrations/IM-Assistant/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..9aca9689141dc237e013e1c1fe6ccc093f3afb0c --- /dev/null +++ b/docs_overseas/integrations/IM-Assistant/_category_.json @@ -0,0 +1,5 @@ +{ + "label": " AI 助手", + "position": 4, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/integrations/IM-Assistant/chatbox.md b/docs_overseas/integrations/IM-Assistant/chatbox.md new file mode 100644 index 0000000000000000000000000000000000000000..20b9d4c0b392ba7e79b3b8f610003d86c91e60f7 --- /dev/null +++ b/docs_overseas/integrations/IM-Assistant/chatbox.md @@ -0,0 +1,48 @@ +--- +sidebar_position: 3 +--- + +# Chatbox Al + +[Chatbox AI](https://chatboxai.app/zh) is a full-featured, cross-platform large language model chat client that excels in functionality and ease of deployment. It supports multi-device synchronization (computer, phone, web), can connect to various large language models, and has multiple unique features: +- **Artifact Preview**:Directly run AI-generated code (such as web pages, games) and view the results in real-time. +- **Chart Creation**:Generate mind maps, flowcharts, and statistical charts. +- **Multi-modal Interaction**:Supports document parsing, image analysis, and discussion on web links. +- **Cross-platform Compatibility**:Supports Windows, MacOS, Linux, iOS, Android, and web browsers. + +## Installation and Configuration Steps + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Install Chatbox Al +- Visit [Chatbox Al's official website](https://chatboxapp.xyz/) and download the installation package for your operating system (Windows, MacOS, Linux, iOS, Android). +- Follow the on-screen instructions to complete the installation, or use the [web version](https://web.chatboxai.app/settings/provider/chatbox-ai). + + ![Page Screenshot](/img/serverless-api/integrated/chatbox01.png) + +## Configure MoArk Service in Chatbox Al +1. Open [Chatbox Al](https://chatboxapp.xyz/) (or the [web version](https://web.chatboxai.app/settings/provider/chatbox-ai)). +2. Click **Settings** in the bottom-left corner, then **+ Add** at the bottom. + + ![Home Page](/img/serverless-api/integrated/chatbox02.png) + +3. Enter the required information as prompted, then click **+ New** to create the model. + + ![Enter Corresponding Information](/img/serverless-api/integrated/chatbox03.png) +- **API Key**:Go to [**Workbench->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) to get your API key. +- **API Host and API Path**:Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) and find the corresponding model's API call to get the API host and API path. + + ![Enter API Host and API Path](/img/serverless-api/integrated/chatbox06.png) + +3. Go to [**AI Model Square**]({{SITE_URL}}/serverless-api) and copy the corresponding model ID. Click **Save** to save the model. + + ![Add Model](/img/serverless-api/integrated/chatbox04.png) + +4. Click on **New Conversation** on the left side, select the model you just added, and start interacting. You can send text, images, documents, or web links to experience multi-modal dialogue capabilities. + + ![Chatbox Al](/img/serverless-api/integrated/chatbox05.png) + +By following the above steps, you can fully leverage the capabilities of the MoArk model in Chatbox AI, enjoy efficient and convenient AI interaction experiences. diff --git a/docs_overseas/integrations/IM-Assistant/cherry-studio.md b/docs_overseas/integrations/IM-Assistant/cherry-studio.md new file mode 100644 index 0000000000000000000000000000000000000000..59708b804dbbf5fbf22039323a1348db79cdf83b --- /dev/null +++ b/docs_overseas/integrations/IM-Assistant/cherry-studio.md @@ -0,0 +1,69 @@ +--- +sidebar_position: 4 +--- +# Cherry Studio + +## About Cherry Studio +Cherry Studio is a multi-model service desktop client that is compatible with Windows, Mac, and Linux. It does not require complex setup and integrates mainstream LLM cloud services, AI Web services, supports local model running, and provides personalized features such as Markdown rendering, agent creation, translation, etc. The interface is user-friendly and flexible, bringing efficient AI interaction experiences. + +Follow the installation and configuration steps below: +## Installation and Configuration Steps +You can install Cherry Studio in the following two ways: +- [Download from the official website](https://www.cherry-ai.com/) +- [Download from the open source repository](https://github.com/CherryHQ/cherry-studio/releases/tag/v1.5.3) + +## Obtain Your Access Token +1. Log in to the MoArk official website (or register an account if you don't have one). +2. Navigate to the Dashboard, click **Settings** in the top-right corner, and select [**Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +3. Generate a new token and copy it for later use. + +## Configuration Guide + +1. Click on the settings icon in the lower left corner and then click `+ Add` to add the MoArk model service. + + ![Add Model](/img/serverless-api/integrated/cherry01.png) + +2. Enter the previously copied access token and API address. + + ![Enter Information](/img/serverless-api/integrated/cherry02.png) + +3. Click `+ Add` to add the model, and you can view existing models in [**AI Model Square**]({{SITE_URL}}/dashboard/models). + + ![Add Model](/img/serverless-api/integrated/cherry03.png) + +4. After adding, you can return to the conversation page to start conversation, and you can also switch models by clicking on the model name in the top menu. + + ![Conversation Page](/img/serverless-api/integrated/cherry04.png) + +## Using Embedding Model Service + +### Creating a Knowledge Base +1. In CherryStudio's left toolbar, click the knowledge base icon to enter the management page; +2. Click `+ Add` to start creating a knowledge base; +3. Enter the name of the knowledge base, select the pre-added embedding models, and complete the creation. For example, using bge-m3 and Qwen3-Embedding-8B. + + ![Creating a Knowledge Base](/img/serverless-api/integrated/cherry06.png) + +### Adding Files and Vectorization +1. Select supported file formats, such as pdf, docx, pptx, xlsx, txt, md, mdx, etc., and drag and drop them into the file list; +2. After uploading, the system will automatically perform vectorization processing. When the display is complete (green ✓), it means vectorization is complete. + + ![Adding Files and Vectorization](/img/serverless-api/integrated/cherry07.png) + +### Adding Multiple Data Sources +CherryStudio supports multiple ways to add data: +- Folder Directory: Add the entire folder directory, and the files in the directory that support the format will be automatically vectorized; +- Website Link: Support website urls, such as https://docs.molifangzhou.com/introduction; +- Sitemap: Support xml format sitemaps, such as https://docs.molifangzhou.com/sitemap.xml; +- Plain Text Notes: Support custom content input in plain text. + + ![Adding Multiple Data Sources](/img/serverless-api/integrated/cherry09.png) + +### Searching the Knowledge Base +After vectorization is complete, you can start querying: +- Click the search knowledge base button at the bottom of the page; +- Enter the query content; +- Present the search results; +- Display the matching score of that result. + + ![Searching the Knowledge Base](/img/serverless-api/integrated/cherry08.png) diff --git a/docs_overseas/integrations/_category_.json b/docs_overseas/integrations/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..1b6cf9f8ec08566aaad380c3464a0c4272bae494 --- /dev/null +++ b/docs_overseas/integrations/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "第三方应用集成指南", + "position": 5, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/integrations/intro.md b/docs_overseas/integrations/intro.md new file mode 100644 index 0000000000000000000000000000000000000000..1bf0786a16772ef0778ec995b53e0d8e2995ebdc --- /dev/null +++ b/docs_overseas/integrations/intro.md @@ -0,0 +1,62 @@ +--- +title: Integration Guide +sidebar_position: 1 +--- + +# Integrating Serverless API with Applications + +The [AI Model Hub]({{SITE_URL}}/serverless-api) offers a wide range of model APIs, allowing you to seamlessly integrate their powerful capabilities into your applications via simple API calls. This guide introduces popular applications that support Serverless API integration, along with general configuration instructions. + +## Supported Applications + +These applications run on platforms you use daily—desktop clients for Windows and Mac, web apps, browser extensions, and mobile apps. By leveraging these tools, you can unlock the full potential of Serverless API models and enhance your AI experience. Below are the application links and brief descriptions: + +| Category | Application Name | Description | +|-----------------|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Desktop Clients | [Chatbox](https://chatboxai.app/zh) | A desktop client supporting multiple popular LLMs, available for Windows, Mac, and Linux. | +| | [OpenCat](https://opencat.app/zh-Hans/) | An AI chat client for iOS and macOS devices. | +| | [Dify](https://dify.ai/) | An open-source LLM application development platform that combines backend-as-a-service and [LLMOps](https://docs.dify.ai/v/zh-hans/learn-more/extended-reading/what-is-llmops) principles, enabling developers to rapidly build production-grade generative AI applications. | +| | [Nextchat](https://nextchat.dev/) | A self-hosted chat service that can be deployed on your own server with minimal setup. | +| | [Pal Chat](https://apps.apple.com/us/app/pal-chat-ai-chat-client/id6447545085) | An AI assistant designed for iPhone and iPad. | +| | [Enconvo](https://www.enconvo.com/) | An AI launcher and intelligent assistant that serves as a unified entry point for all AI functionalities on macOS. | +| | [Cherry Studio](https://www.cherrystudios.com/) | A desktop AI assistant built for creators. | +| Browser Plugins | [Immersive Translate](https://immersivetranslate.com/zh-Hans/) | A clean and efficient browser extension for side-by-side bilingual web page translation. | +| | [ChatGPT Box](https://github.com/josStorer/chatGPTBox) | Integrates LLMs as a personal assistant directly into your browser. | +| | [HuaCi Translate](https://hcfy.app/) | A browser translation plugin that combines multiple translation APIs and LLM services. | +| | [Oulu Translate](https://chromewebstore.google.com/detail/%E6%AC%A7%E8%B7%AF%E7%BF%BB%E8%AF%91-%E7%BD%91%E9%A1%B5%E5%88%92%E8%AF%8D%E7%BF%BB%E8%AF%91%E5%B7%A5%E5%85%B7/djbfechcnkppbknmlhfcaoifgnicolin) | A feature-rich translation tool offering mouse-highlight search, paragraph-level side-by-side translation, and PDF document translation, supporting engines like DeepSeek AI, Bing, GPT, and Google. | +| IM Assistants | [HuixiangDou](https://github.com/InternLM/HuixiangDou/blob/main/README_zh.md) | A domain-specific knowledge assistant integrated into WeChat or Feishu groups, focused on answering questions without casual chatter. | +| | [QChatGPT](https://github.com/RockChinQ/QChatGPT) | A highly stable, plugin-enabled, real-time web-connected LLM bot for QQ, QQ Channel, and OneBot platforms. | +| Development | [Continue](https://github.com/continuedev/continue) | An open-source IDE extension that uses LLMs as your programming copilot. | +| | [Cursor](./mcp#cursor-configuration-example) | A VS Code-based AI-powered code editor designed for developers, emphasizing "AI pair programming" where the AI acts as your coding partner. | + +All listed applications support integration with Serverless API. Configuration is straightforward: since Serverless API is compatible with the OpenAI API format, simply select **OpenAI API Compatible** when configuring the model provider. You'll typically need to provide the API endpoint and API key. Follow the steps below: + +## Integration Steps + +### Obtain the API Endpoint + +On the Serverless API page, select your desired model and click "Call" to retrieve the API endpoint: + +``` +{{SITE_URL}}/v1/chat/completions +``` + +![alt text](/img/serverless-api/integrated/integrate1.png) + +### Configure the API Endpoint + +Using the URL above, split it into the following components: + +- API Host (Domain):_{{SITE_URL}}_ +- API Path:_/v1/chat/completions_ + +![alt text](/img/serverless-api/integrated/integrate2.png) + +### Generate an Access Token +Go to [**Dashboard -> Settings -> Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) to create your access token. + +![Access Token](/img/serverless-api/integrated/integrate3.png) + +In scenarios where the client directly calls the Serverless API, you may need to pass the Access Token to the frontend. For security, we recommend storing the token on your backend and routing API calls through your server. + +If you must use the token directly on the client side, MoArk provides an API to generate temporary tokens. For details, refer to [**Create Temporary Access Token**]({{SITE_URL}}/docs/openapi/v1#tag/ai%E5%BA%94%E7%94%A8%E5%B8%82%E5%9C%BA%E6%8E%A5%E5%8F%A3/post/tokens/temporary). \ No newline at end of file diff --git a/docs_overseas/integrations/mcp.md b/docs_overseas/integrations/mcp.md new file mode 100644 index 0000000000000000000000000000000000000000..e0a06e308c0f3105d0d6f9a72df6d59077ad97d5 --- /dev/null +++ b/docs_overseas/integrations/mcp.md @@ -0,0 +1,164 @@ +--- +title: MCP integration +description: 用于模力方舟的模型上下文协议服务,提供文本生成图片和语音合成功能 +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Using MoArk's Model API via MCP + +MoArk MCP Service is a Model Context Protocol (MCP) service for MoArk. It provides powerful multimedia generation capabilities, including text-to-image and text-to-speech functions, enabling AI assistants to create rich visual and audio content. + +:::tip Quick Start + +1. Visit [{{SITE_URL}}/dashboard/settings/tokens]({{SITE_URL}}/dashboard/settings/tokens) to get your Access Token. + +2. Configure the MCP service in your client (e.g., Cursor).
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=gitee-ai&config=eyJ1cmwiOiJodHRwczovL2FpLmdpdGVlLmNvbS9tY3Avc3NlIiwiaGVhZGVycyI6eyJBdXRob3JpemF0aW9uIjoiQmVhcmVyIDx5b3VyX2FjY2Vzc190b2tlbj4ifX0%3D) + ::: + +## Features + +- **Text-to-Image**: Supports multiple image generation models, capable of creating high-quality images from text descriptions +- **Text-to-Speech**: Converts text to natural speech with support for multiple audio formats +- Configurable API base URL, supporting different MoArk instances +- Supports multiple response formats (Base64, URL, binary stream, etc.) +- Flexible parameter configuration to meet various usage scenarios + +## Practical Scenarios: Multimedia Content Creation + +1. Generate配图 based on text descriptions
+ ![image](/img/serverless-api/mcp/text2image.png) +2. Create voice narration for documents or presentations
+ ![image](/img/serverless-api/mcp/text2speech.png) +3. Batch generate marketing materials
+ ![poster](/img/serverless-api/mcp/poster.png) + +## MCP Hosts Configuration + +:::tip Get Started +Configuring MoArk MCP Service requires a valid Access Token for authentication. +::: + +```json showLineNumbers title="config.json" +{ + "mcpServers": { + "gitee-ai": { + "url": "{{SITE_URL}}/mcp/sse", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +### Claude Desktop Configuration Example + +1. Open the Claude Desktop configuration file: + + - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json` + - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json` + +2. Add the MCP server configuration: + +```json showLineNumberstitle="claude_desktop_config.json" +{ + "mcpServers": { + "gitee-ai": { + "url": "{{SITE_URL}}/mcp/sse", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +3. Restart Claude Desktop + +### Cursor Configuration Example + +1. Open the Cursor settings page, navigate to the "MCP Servers" configuration item. + +2. Add the MCP server configuration, in the following format: + +```json showLineNumbers title="cursor-mcp-config.json" +{ + "mcpServers": { + "gitee-ai": { + "url": "{{SITE_URL}}/mcp/sse", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +3. After saving the configuration, enable the corresponding MCP service and start using it + +## Available Tools + +The server provides the following multimedia generation tools: + +### Image Generation Tools + +| Tool Name | Endpoint | Description | +| ----------------- | --------------------- | -------------------- | +| **text_to_image** | `/images/generations` | Generate images based on text descriptions | + +**Features:** + +- Supports multiple image generation models (e.g., stable-diffusion-3.5-large-turbo) +- Configurable image size (e.g., 1024x1024) +- Supports reference images (base64 or URL) +- Multiple response formats: Base64 encoded or URL links +- Supports user identifier tracking + +**Request Parameters:** + +- `model`(required):Model name +- `prompt`(required):Text description +- `size`:Image size (e.g., 1024x1024) +- `image`:Reference image (base64 or URL) +- `response_format`:Response format (b64_json or url) + +:::warning Parameter Notes + +- Model name supports namespaces, e.g., `stable-diffusion-3.5-large-turbo` or `stabilityai/stable-diffusion-3.5-large-turbo` +- Currently, the `n` parameter only supports a value of 1, i.e., only one image can be generated at a time + ::: + +### Text-to-Speech Tools + +| Tool Name | Endpoint | Description | +| ------------------ | --------------- | ---------------- | +| **text_to_speech** | `/audio/speech` | Convert text to speech | + +**Features:** + +- Supports multiple speech synthesis models (e.g., whisper-large-v3-turbo) +- Multiple audio formats output (wav, mp3) +- Flexible response options: binary stream or URL link +- Generated audio URL expires after 1 hour + +**Request Parameters:** + +- `model`(required):Model name +- `input`(required):Input text +- `response_format`:Response format (url or blob, default is blob) + +:::info Audio File Reminder +When `response_format: "url"` is selected, the generated audio file download link expires after 1 hour. Please download and save it promptly. +::: + +## Integration Instructions + +MoArk MCP Service can be easily integrated into various AI assistants and applications that support the MCP protocol, enabling users to leverage powerful multimedia content generation capabilities. With these tools, AI assistants can: + +- Quickly generate visual content based on user ideas +- Convert text content into audio, providing richer interaction experiences +- Support various application scenarios such as content creation, education, marketing promotion, etc. diff --git a/docs_overseas/organization/_category_.json b/docs_overseas/organization/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..3c5e824dd2e9e032be08c049d25484772e2a9b92 --- /dev/null +++ b/docs_overseas/organization/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "账号与组织管理", + "position": 6, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/organization/access-token.md b/docs_overseas/organization/access-token.md new file mode 100644 index 0000000000000000000000000000000000000000..a8f92c361553509b08db9f02e890e742403caea2 --- /dev/null +++ b/docs_overseas/organization/access-token.md @@ -0,0 +1,61 @@ +--- +sidebar_position: 3 +--- + + +# Access Tokens + +Access tokens are identity credentials for calling MoArk APIs, supporting fine-grained permission control, covering both personal and organizational scenarios, and are closely associated with resource package calls. The detailed description is as follows: + +## Creating Access Tokens + +1. Go to [**工作台->设置->访问令牌**]({{SITE_URL}}/dashboard/settings/tokens) +2. Click "+ New Access Token" and fill in the token name (e.g., "Personal Project Call"). +3. Select the authorization scope: + + **Authorize All Resources**: Can access all Serverless API resource packages you have purchased, including newly purchased resources in the future. If there is no need to specify fixed resource packages, this method is recommended. + + **Authorize Partial Resources**: Manually check specific resource packages (e.g., only select "Full Model Resource Package", "Muxi Resource Package"), allowing calls only to the model interfaces included in the selected resource packages. + + ![image](../../static/img/purchase/purchase07.png) + + **Prioritize Token-based Billing**: Some models support both per-call and token-based billing. After checking this option, the corresponding models called using the token will be billed by the number of tokens; otherwise, per-call billing is used by default. You can decide whether to check this based on your call situation to minimize costs. +:::warning + +1. The system will create a "**Free Trial Access Token**" by default. This token is for user experience, cannot be edited or deleted, and allows interface call experience without purchasing resources. Using this token will not incur any charges. This token has a limited number of experiences, so do not use it in production environments. For official use, please purchase resources and use a paid token. + +2. When resource usage is less than 30%, 10%, and 0, users will be notified via in-site messages and emails. It is recommended to renew as soon as possible after receiving the notification to avoid affecting subsequent use. + ::: + +## Editing Access Tokens +Created tokens can be modified: +- **Name**: Directly edit the token identifier; +- **Resource Authorization**: Switch between "All Resources/Partial Resources" and recheck the authorized resource packages; + +![image](../../static/img/purchase/purchase06.png) + +## Generating Temporary Tokens + +To enhance client usage security, short-term valid temporary tokens can be generated: + +1. Use an already created access token to call the API to generate a temporary token. For details, see [Create Temporary Access Token]({{SITE_URL}}/docs/openapi/v1#tag/ai应用市场接口). +2. Temporary tokens are valid for 1 hour by default, and the expiration time can be specified in the interface (maximum 24 hours). +3. Usage: Suitable for scenarios where front-end pages or clients call APIs directly, avoiding long-term token leakage. + +:::warning + +1. The created temporary token is bound to the "access token" used for authentication when creating the temporary token. Therefore, changes to the permissions of this "access token" and deletion operations will affect the temporary token. It is recommended to create a separate "access token" for generating temporary tokens and avoid changing this token. + ::: + +## Organization Access Tokens +Organization access tokens are used to call resources under the organization's name and are uniformly created and managed by administrators. +1. Go to the [组织工作台 > 设置 > 访问令牌]({{SITE_URL}}/dashboard/settings/tokens) page. +2. Click "+ New Organization Token" and select the authorized resource scope (same as personal tokens). +3. After the token is created, it can be shared with organization members for API calls, but can only access organizational resources. +4. Administrators can view call records in the token list or disable abnormal tokens. + +## Permission Control Description + +- Personal access tokens can only access your personal resources and cannot operate organizational resources. +- If the resource package associated with the token expires or is exhausted, calling the API will return a "Resource Unauthorized" error. +- Tokens can be disabled or deleted at any time on the "Access Tokens" page, immediately terminating their validity. \ No newline at end of file diff --git a/docs_overseas/organization/organizations.md b/docs_overseas/organization/organizations.md new file mode 100644 index 0000000000000000000000000000000000000000..8261f41824ab43fbfa90fe43a771ce47285198ef --- /dev/null +++ b/docs_overseas/organization/organizations.md @@ -0,0 +1,120 @@ +--- +sidebar_position: 2 +--- + +# Organization Collaboration Management + +The organization function supports team resource sharing and collaborative development, suitable for multi-person collaboration scenarios such as enterprises and research teams. The permission system is seamlessly synchronized with Gitee organizations. + +## Organization Creation and Synchronization + +MoArk allows users to create organizations and synchronize Gitee organizations. Organization members can jointly create models and datasets. Administrators can also create applications, model engines, and Serverless APIs, and are allowed to set user roles to control access to repositories and manage payment methods and billing information for their organizations. + +### Create a New Organization + +1. Go to [**工作台->设置->组织管理->新建组织**]({{SITE_URL}}/dashboard/settings/organizations) on MoArk, fill in the relevant information, and you can create a new organization. + + ![alt text](/img/organization/image-01.png) + +2. After entering the creation page, fill in the organization information: + + Organization Name: e.g., "XX Company AI Team". + + Organization Space Address: A unique identifier used to access the organization homepage ({{SITE_URL}}/[空间地址])。 + + Organization Description: Describe the purpose of the organization, which will be displayed on the organization homepage. + + Click "**Create Organization**" to complete the creation. The system will automatically create the organization and set you as the administrator. + + ![alt text](/img/organization/image-0.png) + +### Synchronize Gitee Organizations + +If you already have an organization on Gitee, you can directly synchronize it to MoArk: + +1. When creating an organization, select the Gitee organization you want to synchronize, and the synchronization will be completed. + + ![alt text](/img/organization/image02.png) + +2. The system will list the organizations you have on Gitee. Check the organizations you want to synchronize, click "**Sync Selected Organizations**". +3. After synchronization, the organization information (name, members, permissions) will be synchronized in real time with Gitee. + +#### Synchronization Content + +- Organization Information Synchronization: Organization information on Gitee will be synchronized in real time to MoArk. The organization information includes organization name, organization space address, organization description, website. +- Organization Member Synchronization: The first synchronization will synchronize all members. Subsequent synchronizations need to be done on the organization workspace - member management page, click "**Sync Members**". + + ![alt text](/img/organization/image03.png) + +## Organization Homepage + +In addition to personal homepages, each organization has an organization homepage. Both internal and external members can view the organization's profile, members, and public resources. You can click the organization logo on your personal homepage to view the homepage of the affiliated organization, or click the organization name when browsing resources to view its homepage. + + ![alt text](/img/organization/image-1.png) + +## Organization Workbench + +MoArk's workbench is divided into personal and organizational. If you have joined an organization, on the workbench interface, click the username to switch to the corresponding organization workbench. The organization workbench provides centralized resource management capabilities for the team. The differences from the personal workbench are: + +- **Resource Scope**: Only displays models, datasets, applications, and purchased resource packages under the organization's name. +- **Permission Control**: Administrators can view all resources, while ordinary members can only view authorized resources. +- **Exclusive Functions**: Includes functions such as organization member management, resource sharing settings, and team statistical reports. + + ![alt text](/img/organization/image.png) + +## Organization Management + +### Modify Organization Information + +Administrators can modify the following organization information in [**组织工作台->设置->组织管理->组织信息**]({{SITE_URL}}/dashboard/settings/organizations) .It also supports synchronizing organization information modified by users on Gitee. + + ![alt text](/img/organization/image-2.png) + +### Organization Member Management + +1. Administrators enter the **Organization Workbench->Organization Members** page. +2. Click "Manage Members > Add Members", select the organization permissions (Administrator/Developer) for the invited members, copy the link address or share the invitation QR code to add members. + You can also directly enter the personal space address of the Gitee user or a complete email address to add members directly. + + ![alt text](/img/organization/image04.png) + +3. Remove members: Administrators click "Manage Members", select the corresponding member and remove them. After confirmation, the member will lose access to organization resources. + + +### Organization Permission Description + +MoArk's organization roles are divided into administrators and ordinary members. For the two roles, the following permission differences exist: + +| Operation | Administrator | Ordinary Member | +| :------------------ | :------------ | --------------- | +| Create Model | ✓ | ✓ | +| Create Dataset | ✓ | ✓ | +| Create Application | ✓ | | +| Create Model Engine | ✓ | | +| Create Serverless API | ✓ | | +| Create Organization Access Token | ✓ | | +| Manage Members | ✓ | | +| Edit Organization Information | ✓ | | +| Order and Billing Management | ✓ | | + +Ordinary members can view the resources and usage logs created in the organization workbench. + +## Organization Resource Sharing + +Organization resources are private by default, and can be shared in the following ways: + +1. **Model/Dataset Sharing**: + + When creating a resource, select the organization as the resource owner. + + Enter the resource details page, in the "Settings > Permission Management" section, check "Allow all members of the organization to access". + +2. **Application Collaboration Development**: + + In the application details page, in the "Members Management" section, add organization members and assign the "Developer" role. + + The added members can clone the application repository, submit code, and participate in development. + +## Organization Access Token + +Organization access tokens are used to call resources under the organization, and are created and managed uniformly by administrators. For details, please see [Access Token](/docs/organization/access-token#%E7%BB%84%E7%BB%87%E8%AE%BF%E9%97%AE%E4%BB%A4%E7%89%8C) . diff --git a/docs_overseas/organization/workbench.md b/docs_overseas/organization/workbench.md new file mode 100644 index 0000000000000000000000000000000000000000..121a65b73615a7594fbf89082aeacf84b0f91599 --- /dev/null +++ b/docs_overseas/organization/workbench.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 1 +--- + +# Personal Workbench + +## Introduction +The Personal Workbench is your core entry point for resource management, cost viewing, and functional operations on MoArk. It integrates multi-dimensional information and operation modules to facilitate efficient use of platform services. + +After successful login, you will be automatically redirected to the workbench interface. You can also click the MoArk LOGO or the workbench button in the top navigation to enter the Personal Workbench interface. The workbench interface integrates all core function entrances: +- **Resource Management**: Includes functions such as Serverless API, Model Engine, Applications, Model Fine-tuning, Models and Datasets, allowing you to browse/manage resources you have created or favorited. +- **Cost Center**: View account balance, order management, invoice management, and coupon usage. +- **Settings Entrance**: You can click the settings icon at the bottom of the left navigation bar or access the settings interface from the drop-down menu of the avatar in the upper right corner to configure personal information, access tokens, etc. +- **Community Updates**: Real-time push of the latest platform news, such as in-depth model analysis, free resource opening notifications, popular model online experiences, etc. + +![alt text](/img/organization/personaldashboardimg1.png) + +## Personal Information Settings + +Personal information is synchronized with your Gitee account in real-time and does not require separate maintenance: + +1. After logging in, click the avatar in the upper right corner and select "Personal Settings" to enter the information page. +2. Editable content includes: + + Basic Information: Name, avatar (synchronized from Gitee account). + + Contact Information: Email (bound to Gitee account, used for receiving notifications). + + Research Fields: Custom input to help the platform recommend relevant models and resources. + +3. Click "Save" to update, and information changes will be synchronized to your Gitee account in real-time. + +## Personal Statistics and Logs + +This module provides comprehensive data tracking of your MoArk resource usage, covering usage statistics and activity logs, helping you accurately grasp resource consumption and troubleshoot call issues. + +**Usage Statistics**: Go to [工作台 > 统计与日志 > 用量统计]({{SITE_URL}}/dashboard/statistics/usage-statistics) to view macro data statistics of Serverless API calls. You can quickly understand the distribution of core indicators of resource usage, identify frequently called and time-consuming resources, and provide data support for resource optimization and cost control. + +**Call Logs**: Provide detailed behavior records of resource calls, support conditional filtering, accurately locate detailed information of each API call, and can be exported as CSV for auditing. \ No newline at end of file diff --git a/docs_overseas/products/_category_.json b/docs_overseas/products/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..93927b7b2bbb95023a6a555aa125569521b0c6f6 --- /dev/null +++ b/docs_overseas/products/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Capabilities", + "position": 3, + "collapsed": false +} \ No newline at end of file diff --git a/docs_overseas/products/apis/3d/_category_.json b/docs_overseas/products/apis/3d/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..c1bf29b4b28999b23116280c9f600036a5b13a2a --- /dev/null +++ b/docs_overseas/products/apis/3d/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "3D large model", + "position": 6, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/3d/index.md b/docs_overseas/products/apis/3d/index.md new file mode 100644 index 0000000000000000000000000000000000000000..d8c065a7dff207fced6c4cf4fc251b003778172f --- /dev/null +++ b/docs_overseas/products/apis/3d/index.md @@ -0,0 +1,204 @@ +# 3D Large Models + +## Overview + +3D large models are designed to convert input images into 3D models, featuring high fidelity, rich details, and efficient generation. They can quickly transform images into realistic 3D objects, and are widely applied in game development, film and television production, virtual reality, and other fields. + +The actual 3D effects are shown below: + +![3D](https://gitee.com/hf-models/Hunyuan3D-2/raw/main/assets/images/e2e-1.gif) + +![3D](https://gitee.com/hf-models/Hunyuan3D-2/raw/main/assets/images/e2e-2.gif) + +## Model List + +Currently, the 3D large models available in the Model Plaza include: + +| Model Name | Description | +| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| [Hunyuan3D-2 Monochrome]({{SITE_URL}}/serverless-api?model=Hunyuan3D-2) | Developed by Tencent's Hunyuan Team, Hunyuan3D-2 is a high-quality 3D generation model. It boasts high fidelity, rich details, and efficient generation capabilities, enabling rapid conversion of text or images into realistic 3D objects. | +| [Hunyuan3D-2 Colored]({{SITE_URL}}/serverless-api?model=Hunyuan3D-2) | Developed by Tencent's Hunyuan Team, Hunyuan3D-2 is a high-quality 3D generation model. It boasts high fidelity, rich details, and efficient generation capabilities, enabling rapid conversion of text or images into realistic 3D objects. | +| [Hi3DGen]({{SITE_URL}}/serverless-api?model=Hi3DGen) | Hi3DGen is an AI tool that intelligently converts your uploaded regular images into images with a "three-dimensional effect" (normal maps). It is commonly used in creating 3D effects for game modeling, virtual reality, animation production, etc. | +| [Step1X-3D]({{SITE_URL}}/serverless-api?model=Step1X-3D) | Co-developed and open-sourced by StepFun and LightIllusions, Step1X-3D is a high-fidelity 3D generation model specifically designed for high-quality, controllable 3D content creation.。 | + +## Online Experience + +Taking the `Hunyuan3D-2` model as an example, the model takes images as input and outputs corresponding 3D models. Users can utilize this model by uploading images. + +The actual 3D effects are shown below: + +![3D](/img/serverless-api/hunyuan3d.jpg) + +## Asynchronous Invocation Sample Code + +Since the model generation time may be long, the interface is invoked asynchronously. For more information about the asynchronous task API of Model Forge, please refer to [here]({{SITE_URL}}/docs/openapi/v1#tag/异步任务). + +The following is an example of using Python to call the 3D generation model: + +```python showLineNumbers title="python" +import requests +from requests_toolbelt import MultipartEncoder +import os +import time +import json +import webbrowser +import contextlib +import mimetypes + +API_URL = "{{SITE_URL}}/v1/async/image-to-3d" +API_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +headers = { + "Authorization": f"Bearer {API_TOKEN}" +} + +def query(payload): + fields = [ + ("type", payload["type"]), + ("model", payload["model"]), + ("texture", str(payload["texture"]).lower()), + ("seed", str(payload["seed"])), + ("num_inference_steps", str(payload["num_inference_steps"])), + ("octree_resolution", str(payload["octree_resolution"])), + ("guidance_scale", str(payload["guidance_scale"])), + ] + with contextlib.ExitStack() as stack: + filepath = payload["image"] + name = os.path.basename(filepath) + if filepath.startswith(("http://", "https://")): + response = requests.get(filepath, timeout=10) + response.raise_for_status() + fields.append(("image", (name, response.content, response.headers.get("Content-Type", "application/octet-stream")))) + else: + mime_type, _ = mimetypes.guess_type(filepath) + fields.append(("image", (name, stack.enter_context(open(filepath, "rb")), mime_type or "application/octet-stream"))) + encoder = MultipartEncoder(fields) + headers["Content-Type"] = encoder.content_type + response = requests.post(API_URL, headers=headers, data=encoder) + return response.json() + +def poll_task(task_id): + status_url = f"{{SITE_URL}}/v1/task/{task_id}" + timeout = 30 * 60 + retry_interval = 10 + attempts = 0 + max_attempts = int(timeout / retry_interval) + while attempts < max_attempts: + attempts += 1 + print(f"Checking task status [{attempts}]...", end="") + response = requests.get(status_url, headers=headers, timeout=10) + result = response.json() + if result.get("error"): + print('error') + raise ValueError(f"{result['error']}: {result.get('message', 'Unknown error')}") + status = result.get("status", "unknown") + print(status) + if status == "success": + if "output" in result and "file_url" in result["output"]: + file_url = result["output"]["file_url"] + duration = (result.get('completed_at', 0) - result.get('started_at', 0)) / 1000 + print(f"🔗 Donwload link: {file_url}") + print(f"⏱️ Task duration: {duration:.2f} seconds") + # Open the result URL in the browser + webbrowser.open(file_url) + else: + print("⚠️ No output URL found") + elif status in ["failed", "cancelled"]: + print(f"❌ Task {status}") + else: + time.sleep(retry_interval) + continue + task_file = f"task_{task_id}.json" + with open(task_file, "w") as f: + json.dump(result, f, indent=4) + print(f"Task was saved to file {task_file}") + return result + print(f"⏰ Maximum attempts reached ({max_attempts})") + return {"status": "timeout", "message": "maximum wait time exceeded"} + +if __name__ == "__main__": + print("Creating task...") + result = query({ + "image": "path/to/image.jpg", + "type": "glb", + "model": "Hunyuan3D-2", + "texture": True, + "seed": 1234, + "num_inference_steps": 5, + "octree_resolution": 128, + "guidance_scale": 5 + }) + task_id = result.get("task_id") + if not task_id: + raise ValueError("Task ID not found in the response") + print(f"Task ID: {task_id}") + task = poll_task(task_id) + if task.get("status") == "success": + # Do something with the task result here + print("Task completed successfully!") +``` + +The 3D files generated by the model are in .glb format. You can use 3D viewing tools (such as [glTF Viewer](https://gltf-viewer.donmccurdy.com/)) to view the generated 3D models. + +## Application Scenarios + +#### 🎮 Game Development +- **Character Modeling**: Quickly convert concept art into 3D models of game characters +- **Prop Creation**: Create various weapons, equipment, and environmental props for games +- **Scene Assets**: Generate scene elements such as buildings, vegetation, and decorations +- **Prototype Design**: Rapidly produce model prototypes in the early stages of game development + +#### 🎬 Film and Television Production +- **Digital Assets**: Create digital props and scenes for movies and TV shows +- **VFX Preview**: Quickly generate preview models for visual effects planning +- **Virtual Sets**: Create virtual environments and background elements +- **Animation Production**: Provide character and object models for animation projects + +#### 🏠 Architectural Design +- **Concept Visualization**: Convert 2D design drawings into 3D models +- **Interior Design**: Rapidly generate 3D models of furniture and decorations +- **Scheme Presentation**: Show clients the 3D effects of design schemes +- **Spatial Planning**: Assist in spatial layout and design optimization + +#### 🛒 E-Commerce and Retail +- **Product Display**: Create 360° comprehensive display models for products +- **Virtual Try-On**: Allow users to preview 3D effects of products before purchase +- **AR Shopping**: Integrate with AR technology to realize virtual fitting and试用 +- **Marketing Materials**: Produce eye-catching 3D advertising content + +#### 📚 Education and Training +- **Teaching Models**: Create teaching models for biology, chemistry, physics, etc. +- **Historical Reconstruction**: Reconstruct historical relics and ancient buildings +- **Virtual Experiments**: Create virtual laboratories and experimental equipment +- **Interactive Learning**: Develop 3D interactive teaching content + +#### 🏥 Healthcare +- **Anatomical Models**: Generate 3D models of human organs and tissues +- **Surgical Planning**: Provide 3D reference models for complex surgeries +- **Rehabilitation Training**: Develop 3D rehabilitation training applications +- **Medical Devices**: Design and display 3D models of medical equipment + +#### 🏭 Industrial Manufacturing +- **Product Design**: Quickly produce product prototypes and design schemes +- **Quality Inspection**: Create standard models for quality comparison +- **Training and Education**: Produce training models for equipment operation and maintenance +- **Demonstration**: Show clients the 3D effects of products + +#### 🌐 Virtual Reality/Augmented Reality +- **VR Content**: Create immersive 3D environments for VR applications +- **AR Applications**: Develop 3D materials required for AR applications +- **Virtual Exhibition Halls**: Build virtual exhibitions and display spaces +- **Metaverse Applications**: Provide 3D assets for metaverse platforms + +#### 🎨 Art Creation +- **Digital Sculpture**: Convert 2D artworks into 3D sculptures +- **Installation Art**: Design and preview the effects of art installations +- **Cultural and Creative Products**: Develop cultural and creative products with 3D effects +- **Exhibition Planning**: Create 3D display content for art exhibitions + +#### 📱 Mobile Applications +- **Social Sharing**: Allow users to share personalized 3D content +- **Entertainment Apps**: Develop 3D mini-games and interactive applications +- **Life Tools**: Create practical 3D measurement and design tools +- **Personalized Customization**: Provide personalized 3D product customization services + +Through these diverse application scenarios, 3D large models are revolutionizing workflows across various industries, significantly lowering the barrier to 3D content creation and improving design and development efficiency. diff --git a/docs_overseas/products/apis/_category_.json b/docs_overseas/products/apis/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..7452c9143162a6b7364c9135d504876d7ca818d0 --- /dev/null +++ b/docs_overseas/products/apis/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "🔥 模型广场 (Serverless API)", + "position": 1, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/async-task.md b/docs_overseas/products/apis/async-task.md new file mode 100644 index 0000000000000000000000000000000000000000..fd8e91cd65ad5ee35ca98d0b9ff310a9ebc221b7 --- /dev/null +++ b/docs_overseas/products/apis/async-task.md @@ -0,0 +1,199 @@ + + +# Guide to Asynchronous Task API + +## Overview + +For tasks with long generation times (such as 3D modeling, video generation, long audio synthesis, etc.), the platform provides a dedicated asynchronous task API, enabling you to efficiently handle time-consuming operations without waiting for a response for an extended period. + +## API Architecture + +The asynchronous task API adopts a submit-query model: + +- **Submission API**: Used to create asynchronous tasks. For example, the submission API for text-to-music generation is `/async/music/generations` +- **Query API**: Unified task status query API `https://ai.gitee.com/api/v1/task/` +- **Task Cancellation API**: `https://ai.gitee.com/api/v1/task//cancel` +- **Quota Query API**: `https://ai.gitee.com/v1/tasks/available-quota` +- **Task Status API**: `https://ai.gitee.com/v1/task//status` +- **Task Record API**: `https://ai.gitee.com/v1/task/` + +## Workflow + +1. **Submit Task** → Get `task_id` and query URL +2. **Poll Query** → Check task status +3. **Get Results** → Download generated files + +## Complete Example: Music Generation + +The following example demonstrates how to generate music using the ACE-Step music large model: + +### Python Implementation + +```python showLineNumbers title="python" +import os +import requests +import base64 +from PIL import Image +from io import BytesIO +from requests_toolbelt.multipart.encoder import MultipartEncoder + +API_URL = "https://ai.gitee.com/v1/async/music/generations" +headers = { + "Authorization": "Bearer ", +} + +def query(payload): + data = {} + for key, value in payload.items(): + if value is None: + data[key] = "" + elif isinstance(value, list): + data[key] = ",".join(map(str, value)) + elif isinstance(value, bool): + data[key] = str(value).lower() + else: + data[key] = str(value) + multipart_data = MultipartEncoder(fields=data) + headers["Content-Type"] = multipart_data.content_type + response = requests.post(API_URL, headers=headers, data=multipart_data) + return response.json() + +output = query({ + "model": "ACE-Step-v1-3.5B", + "task": "text2music", + "duration": 60, + "prompt": "pop, synth, drums, guitar, 120 bpm, upbeat, catchy, vibrant, female vocals, polished vocals", + "lyrics": """[Verse] +Neon lights across the sky +Every moment passing by +Your smile catches in my mind +Like a snapshot frozen time +[Chorus] +We're dancing through the night +Under these electric lights +Don't need to think about tomorrow +Just feel this moment right +[Verse] +City pulse beneath our feet +Hearts aligned to steady beat +Take my hand and follow me +Into who we're meant to be +[Bridge] +One life, one chance +One perfect night romance +Our story's just beginning +In this magical dance""", + "infer_steps": 60, + "lora_name": 'None', + "guidance_scale": 15, + "guidance_scale_text": 0, + "guidance_scale_lyric": 0, + "scheduler_type": "euler", + "cfg_type": "apg", + "omega_scale": 10, + "guidance_interval": 0.5, + "guidance_interval_decay": 0, + "min_guidance_scale": 3, + "use_erg_tag": True, + "use_erg_lyric": True, + "use_erg_diffusion": True, +}) +query_url = output["urls"]["get"] + +while True: + resp = requests.get(query_url, headers=headers).json() + print("task status: ", resp["status"]) + if resp["status"] == "failure": + print(resp) + print("task failed") + os._exit(1) + if resp["status"] == "success": + break + +file_url = resp["output"]["file_url"] +print('final url ', file_url) +resp = requests.get(file_url) + +with open("output.mp3", "wb") as f: + f.write(resp.content) +``` + +## Key Parameter Explanations + +### General Parameters +- `model`: Name of the model used (e.g., "ACE-Step-v1-3.5B") +### Music Generation Parameters +- `task`: Task type (e.g., "text2music") +- `duration`: Generation duration (seconds) +- `prompt`: Music style description +- `lyrics`: Lyrics content +- `infer_steps`: Inference steps (affects quality and speed) +- `guidance_scale`: Guidance strength +- `scheduler_type`: Scheduler type + +## Error Handling + +### Common Error Types + +1. **Authentication Error** (401) + - Check if the API token is correct + - Confirm that the token is valid and not expired + +2. **Parameter Error** (400) + - Verify that all required parameters are complete + - Check if the parameter format is correct + +3. **Task Failure** + - Check the error message returned + - Adjust parameters and try again + +## Best Practices + +1. **Reasonable Polling Interval**: Suggested 5-10 seconds, avoid too frequent requests +2. **Implement Timeout Mechanism**: Set a reasonable maximum waiting time +3. **Error Retry**: Implement exponential backoff retry for temporary errors +4. **Resource Cleanup**: Handle downloaded files promptly to avoid disk space exhaustion +5. **Concurrent Quota Management**: Check available quota before submitting tasks to avoid exceeding limits +6. **Task Status Monitoring**: Regularly check task status, handle failed tasks promptly +7. **Reasonable Use of Cancellation**: Cancel tasks that are no longer needed to release resources + +### Quota Management Example + +```bash showLineNumbers title="bash" +# Query available quota +curl -H "Authorization: Bearer " \ + https://ai.gitee.com/v1/tasks/available-quota + +# Cancel unnecessary tasks +curl -X POST \ + -H "Authorization: Bearer " \ + https://ai.gitee.com/api/v1/task//cancel + +# Query task status +curl -H "Authorization: Bearer " \ + https://ai.gitee.com/v1/task//status +``` + +## Frequently Asked Questions + +**Q: How long does it take for a task to complete after submission?** +A: Depending on the task complexity, it usually completes within 1-10 minutes. + +**Q: Can I cancel a task that is currently running?** +A: Task cancellation is supported. You can cancel tasks in waiting or in_progress status using the cancellation API `https://ai.gitee.com/api/v1/task//cancel`. + +**Q: What is the concurrent quota limit?** +A: Each account has a concurrent quota limit for asynchronous tasks, including the total number of tasks in waiting and in_progress states. Exceeding the quota will prevent new tasks from being submitted. + +**Q: How can I query my available quota?** +A: You can query your available quota using the quota query API `https://ai.gitee.com/v1/tasks/available-quota`. + +**Q: How long is the download link valid for?** +A: Download links are typically valid for 24 hours. Please download and save them promptly. + +**Q: How do I get detailed information about a task?** +A: You can get detailed information about a task using the task record API `https://ai.gitee.com/v1/task/`. + +**Q: How to handle insufficient quota?** +A: You can handle quota insufficient situations in the following ways: 1) Wait for existing tasks to complete; 2) Cancel unnecessary tasks; 3) Implement task queue management mechanisms. + diff --git a/docs_overseas/products/apis/documents/_category_.json b/docs_overseas/products/apis/documents/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..460215b8ea47ecd69b79ba7cb84be3cecf1e1db8 --- /dev/null +++ b/docs_overseas/products/apis/documents/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "文档处理/OCR", + "position": 4, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/documents/ocr.md b/docs_overseas/products/apis/documents/ocr.md new file mode 100644 index 0000000000000000000000000000000000000000..341c9a8304b4b9e7164dca38b717ff84ea694ca5 --- /dev/null +++ b/docs_overseas/products/apis/documents/ocr.md @@ -0,0 +1,84 @@ +--- +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# OCR (Optical Character Recognition) + +## Basic Introduction + +OCR (Optical Character Recognition) technology refers to the use of artificial intelligence models to extract text information from images. Its core task is to convert text content in images into editable text data, which is widely applied in fields such as document digitization, information extraction, and data entry. + +Currently, the OCR model available on Model Plaza includes: [GOT-OCR2_0]({{SITE_URL}}/serverless-api?model=GOT-OCR2_0) + +## GOT-OCR2_0 + +GOT-OCR2_0 provides a powerful OCR solution, capable of extracting text information from images with high accuracy, speed, and comprehensiveness. It supports multiple languages and is suitable for various scenarios, such as extracting information from ID cards, bank cards, PDF documents, tables, license plates, handwritten text, equipment nameplates, mathematical formulas, and other images. + +### Usage Method + +You can click [GOT-OCR2_0]({{SITE_URL}}/serverless-api?model=GOT-OCR2_0) for free online experience. The following are code invocation examples. + + + + ```bash showLineNumbers + curl {{SITE_URL}}/v1/images/ocr \ + -X POST \ + -H "Authorization: Bearer 私人令牌" \ + -F "model=GOT-OCR2_0" + -F "image=@path/to/image.jpg" + -F "response_format=text" + ``` + + + ```python showLineNumbers title="python" + import requests + API_URL = "{{SITE_URL}}/v1/images/ocr" + HEADERS = { + "Authorization": "Bearer 私人令牌", + } + def query(image_path, model="GOT-OCR2_0", response_format="text"): + with open(image_path, "rb") as image_file: + response = requests.post( + API_URL, + headers=HEADERS, + files={"image": (image_path, image_file)}, + data={"model": model, "response_format": response_format}, + ) + return response.json() + + output = query("test.jpg") + print(output) # {"text": "xxx"} + ``` + + + +### Parameter Description: + +- Private token: Used to verify the identity of the caller. Click [Private Token]({{SITE_URL}}/dashboard/settings/tokens) to obtain it. +- model: Fill in GOT-OCR2_0 to specify the use of the OCR large model. +- image: The image file to be processed with OCR. + - Supports `png`, `jpg`, `jpeg`, `webp`, `gif` formats. + - Maximum resolution support: `4096X4096`. + - File size does not exceed `3MB`. +- response_format: Format type. + - Value `text` returns plain text content. + - Value `format` returns content in [mathpix-markdown](https://github.com/Mathpix) format, recommended for images with mathematical formulas. + +### Usage Example + +![image-20250114152140833](../../ocr.assets/image-20250114152140833.png) + +After executing the above code, the response will be: + +```json +{ + "text": "美迪兰(南京)医疗设备有限公司\n名称:..." +} +```` + +The online experience effect of [GOT-OCR2_0]({{SITE_URL}}/serverless-api?model=GOT-OCR2_0) is as follows: + +![image-20250114152442007](../../ocr.assets/image-20250114152442007.png) diff --git a/docs_overseas/products/apis/documents/pdf.md b/docs_overseas/products/apis/documents/pdf.md new file mode 100644 index 0000000000000000000000000000000000000000..92c4f4553a592a97a48647f447b54795482141cb --- /dev/null +++ b/docs_overseas/products/apis/documents/pdf.md @@ -0,0 +1,119 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Document Parsing + +## Basic Introduction + +Document parsing refers to the technology of extracting valuable information and content from various formats of documents through artificial intelligence models. Its core task is to convert unstructured or semi-structured document content into structured data, facilitating subsequent analysis and processing. Document parsing technology is widely applied in fields such as knowledge base construction, data mining, and information retrieval. + +Currently, the document parsing models available on Model Plaza include: [PDF-Extract-Kit]({{SITE_URL}}/serverless-api?model=PDF-Extract-Kit-1.0) + +## PDF-Extract-Kit + +PDF-Extract-Kit is specifically designed to efficiently extract high-quality content from various complex PDF documents. It features the following: + +- Accurately restores the layout of the original document. +- Outputs content in Markdown format for easy reading. +- Segments output content by page and semantic logic. +- Recognizes mathematical formulas. +- Recognizes tables. +- Supports multilingual recognition. + +Applicable scenarios: + +- Knowledge bases and datasets: Directly used in AI scenarios such as RAG, fine-tuning, and machine learning. +- Enterprise document digitization: Extracts information from traditional paper document images or scanned documents to enhance enterprise management digitization capabilities. +- Multilingual document processing: The interface supports text recognition in multiple languages and can automatically distinguish languages in documents. +- In scientific research, particularly in mathematics, physics, engineering, and other disciplines, it is suitable for recognizing mathematical formulas and complex tables in documents. +- Online document services and SaaS applications, providing one-stop document parsing, format conversion, and content extraction services. + +### Usage Method + +You can click [PDF-Extract-Kit]({{SITE_URL}}/serverless-api?model=PDF-Extract-Kit-1.0) for free online experience. The following is an example of code invocation. + +```bash showLineNumbers + curl {{SITE_URL}}/v1/async/documents/parse \ + -X POST \ + -H "Authorization: Bearer Your access token" \ + -F "model=PDF-Extract-Kit-1.0" \ + -F "is_ocr=true" \ + -F "formula_enable=true" \ + -F "table_enable=true" \ + -F "layout_model=doclayout_yolo" \ + -F "file=@path/to/file.pdf" +``` + +### Parameter Description: + +- Private token: Used to verify the identity of the caller. Click [Access Token]({{SITE_URL}}/dashboard/settings/tokens) to obtain it. +- model:Fill in PDF-Extract-Kit-1.0 to use the specified large model. +- file:The file to be parsed. + - Supported file formats: `pdf`, `png`, `jpg`, `gif`, `docx`, `pptx` + - File size limit: `100MB` +- is_ocr: Whether to enable OCR. If set to false, text in images will not be recognized. +- include_image_base64: When enabled, the response markdown will embed base64 images; otherwise, images will be uploaded to cloud storage and provided with temporary links, which are valid for only 7 days. +- formula_enable: Whether to enable formula recognition. +- table_enable: Whether to enable table recognition. +- language: Specifies the text language to improve recognition accuracy. The default is automatic recognition if not filled in. Optional languages: ch, en, korean, japan, chinese_cht, ta, te, ka, latin, arabic, cyrillic, devanagari. +- end_pages: The number of pages to process, i.e., process the first N pages. +- layout_model: Layout analysis model. During parsing, the document layout will be analyzed, and different models affect the generation quality. Optional: + - `doclayout_yolo` (default, faster and more accurate) + - `layoutlmv3` (more stable) + +### Usage Example + +![image-20250114152140833](../../pdf.assets/pdf.png) + +This interface is asynchronous. You need to submit the task first, obtain the task ID, and then poll for the execution result based on the ID. After submitting the task via CURL, the response will be: + +```json showLineNumbers +{ + "task_id": "AAC2KETEYJVKER04U6RNMHJTOGLVEG1B", + "status": "waiting", + "created_at": 1742885184998, + "urls": { + "get": "{{SITE_URL}}/api/v1/task/AAC2KETEYJVKER04U6RNMHJTOGLVEG1B", + "cancel": "{{SITE_URL}}/api/v1/task/AAC2KETEYJVKER04U6RNMHJTOGLVEG1B/cancel" + } +} +``` + +Then obtain the final execution result using the task_id: + +```bash showLineNumbers +curl {{SITE_URL}}/v1/task/AAC2KETEYJVKER04U6RNMHJTOGLVEG1B/ + --header 'Authorization: Bearer Your access token' +``` + +```json showLineNumbers +{ + "task_id": "AAC2KETEYJVKER04U6RNMHJTOGLVEG1B", + "output": { + "segments": [ + { + "index": 1, + "content": "# First paragraph xxxx" + }, + { + "index": 2, + "content": "# Second paragraph xxxx" + } + ] + }, + "status": "success", + "created_at": 1742885185000, + "started_at": 1742885188000, + "completed_at": 1742885190000, + "urls": { + "get": "{{SITE_URL}}/api/v1/task/AAC2KETEYJVKER04U6RNMHJTOGLVEG1B", + "cancel": "{{SITE_URL}}/api/v1/task/AAC2KETEYJVKER04U6RNMHJTOGLVEG1B/cancel" + } +} +``` + +When the `status` in the response changes to `success`, the parsing is successful. `output` is the parsing result, and `segments` are the segmented parsing results, divided based on page or semantic logic. diff --git a/docs_overseas/products/apis/edge/_category_.json b/docs_overseas/products/apis/edge/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..85596eae3bcd30c46ad071ffa52e1d8be41b29c7 --- /dev/null +++ b/docs_overseas/products/apis/edge/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "End-side Development Guide", + "position": 11, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/edge/index.md b/docs_overseas/products/apis/edge/index.md new file mode 100644 index 0000000000000000000000000000000000000000..1241708bb4d25faf6c1e5736a1c690859c207363 --- /dev/null +++ b/docs_overseas/products/apis/edge/index.md @@ -0,0 +1,30 @@ +# End-side Development Guide + +The end-side refers to edge devices such as mobile phones, tablets, and computers. End-side devices generally have limited performance and cannot run large-parameter models, but they can run many lightweight models, with a wide range of application scenarios. + +MoArk, in collaboration with Huawei Ascend and Orange Pi, provides developers with end-side model development kits to help them quickly get started with end-side model inference. + +:::info +Currently, MoArk is adapting more models to the end-side and will provide corresponding tutorials. Stay tuned. +::: + +Currently supported development board kits and their data downloads: + +- [Orange Pi AIPro (20T)]() +- [Orange Pi AIPro (8T)](http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-AIpro.html) + +Orange Pi AIStudio + Quick Start: + +- [Development Board Image Burning and Environment Configuration](https://www.mindspore.cn/docs/zh-CN/r2.4.10/orange_pi/environment_setup.html) +- [Quick Start to Development Board Model Inference](https://www.mindspore.cn/docs/zh-CN/r2.4.10/orange_pi/model_infer.html) + +Code Sample Library: + +- [Orange Pi AIPro Inference Code Sample Library](https://gitee.com/mirrors/orange-pi-mindspore) + +Tools and Downloads: + +- [Orange Pi Tools Download](http://www.orangepi.cn/html/serviceAndSupport/index.html) + +If you encounter any problems during use, please feel free to [contact us](/docs/appendix/contact). \ No newline at end of file diff --git a/docs_overseas/products/apis/embeddings/_category_.json b/docs_overseas/products/apis/embeddings/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..45d11c097a96493553775ea7a0ccdb36fac7ba3f --- /dev/null +++ b/docs_overseas/products/apis/embeddings/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Vectorization and Re-ranking", + "position": 5, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/embeddings/index.md b/docs_overseas/products/apis/embeddings/index.md new file mode 100644 index 0000000000000000000000000000000000000000..89f558e3363a89dc9b07aa3ce16150cf9bb9f4a0 --- /dev/null +++ b/docs_overseas/products/apis/embeddings/index.md @@ -0,0 +1,110 @@ +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Vectorization and Reranking + +## Basic Introduction + +Vectorization and reranking are crucial technologies in the fields of natural language processing and information retrieval. They help computers understand and process language data by converting text into vector representations. These technologies play a key role in applications such as search engines, recommendation systems, and semantic analysis. + +:::tip Benefit Reminder +All vectorization and reranking models deployed on MoArk are **completely free, completely free, completely free!!!** +::: + +## Model List + +The following is a list of vectorization and reranking models deployed on MoArk: + + + +## Vectorization Models + +Vectorization models convert text data into high-dimensional vector representations, such that similar texts are close to each other in the vector space. These models typically use deep learning technologies, such as the Transformer architecture, to capture the semantic information of text. + +The most critical parameter of a vector model is its dimension. A higher dimension means stronger expressive ability of the model, but it also increases computational and storage costs. The vectorization models on ModelArk cover dimensions from **512** to **4096**. Please choose according to your actual needs. + +Sample code: + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your token + default_headers={"X-Failover-Enabled":"true"}, +) + +response = client.embeddings.create( + input="Hello, I am MoArk.", + model="Qwen3-Embedding-4B", +) +``` + +## Multimodal Vectorization + +MoArk supports multimodal vectorization models, which can handle multiple input types such as text, images, and videos. These models can convert different modal data into unified vector representations, enabling cross-modal retrieval and analysis. + +The following multimodal vectorization models are currently deployed on MoArk: + +- [jina-embeddings-v4]({{SITE_URL}}/serverless-api?model=jina-embeddings-v4) with a vector dimension of 2048 +- [jina-clip-v1]({{SITE_URL}}/serverless-api?model=jina-clip-v1) with a vector dimension of 768 +- [jina-clip-v2]({{SITE_URL}}/serverless-api?model=jina-clip-v2) with a vector dimension of 1024 + +Sample code: + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token +) + +response = client.embeddings.create( + input=[ + { "text": "a blue cat" }, + { "text": "a dog" }, + { "image": "https://example.com/image.jpg"} + ], + model="jina-embeddings-v4", +) +``` + +## Reranking Models + +Reranking models reorder search results to improve the accuracy and relevance of information retrieval. These models typically use user history and preferences, combined with vectorization techniques, to optimize the display order of search results. + +Sample code: + +```python showLineNumbers title="python" +import requests + +API_URL = "{{SITE_URL}}/v1/rerank" +API_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Replace with your access token +headers = { + "X-Failover-Enabled": "true", + "Authorization": f"Bearer {API_TOKEN}" +} + +def query(payload): + response = requests.post(API_URL, headers=headers, json=payload) + return response.json() + +output = query({ + "query": "How to read a CSV file in Python?", + "documents": [ + "Use pandas: `import pandas as pd; df = pd.read_csv('data.csv')`", + "You can read CSV files with numpy.loadtxt()", + "To write JSON files, use json.dump() in Python", + "CSV means Comma Separated Values. Python files can be opened using read() method." + ], + "model": "Qwen3-Reranker-4B" +}) +print(output) +``` + +## Application Scenarios + +- **Information Retrieval**:By using vectorization technology, the retrieval efficiency and accuracy of search engines can be improved. +- **Recommendation System**:Utilizing vectorization and reranking technologies, personalized content recommendations can be provided to users. +- **Semantic Analysis**:By vectorizing text data, the semantic relationships and contextual information of text can be understood. +- **Natural Language Processing**:In tasks such as machine translation and sentiment analysis, vectorization technology is used to represent and process language data. diff --git a/docs_overseas/products/apis/images-vision/_category_.json b/docs_overseas/products/apis/images-vision/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..bcf0340973e37a622df8c44d4cabac301d5dd55e --- /dev/null +++ b/docs_overseas/products/apis/images-vision/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "图像与视觉", + "position": 2, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/controlnet.md b/docs_overseas/products/apis/images-vision/controlnet.md new file mode 100644 index 0000000000000000000000000000000000000000..537ad2f359f19f1141ac77a588ae9e09b25ff11a --- /dev/null +++ b/docs_overseas/products/apis/images-vision/controlnet.md @@ -0,0 +1,141 @@ +--- +sidebar_position: 8 +--- + +# Generating Images with ControlNet + +## Feature Description + +`ControlNet` is a conditional generation-based model that can generate images matching input conditions (such as text, images, etc.). In text-to-image and image editing tasks, `ControlNet` can be used to generate images that meet specific conditions, such as images of a particular style, specific scenes, etc. + +## Models Supporting ControlNet + +- [Flux.1-dev]({{SITE_URL}}/serverless-api?model=flux-1-dev&tab=info) + +## Experience the API Effect + +### Function Description + +The Serverless API provides an interface for quick experience, allowing you to quickly test the API效果. +Open the [Serverless API page]({{SITE_URL}}/serverless-api?model=FLUX.1-dev&operation=333), find the `FLUX.1-dev` model under Image Generation and Processing, and click to enter the interface details page. + +![image](/img/serverless-api/flux-1-dev-controlnet.png) + +In the text-to-image (ControlNet) interface, after enabling the ControlNet function, you need to set parameters for the ControlNet model. + +ControlNet Parameter Explanations: + +- **control_image**: The control image used as a reference for image generation, such as specifying a character's pose or outline to make the generated result more in line with expectations. The control image can be a local image path or an image URL. +- **controlnet_type**: The type of ControlNet model, with optional values `canny` and `depth`. `canny` is edge detection, and `depth` is depth estimation, used to guide the style or structure of the generated image. +- **controlnet_conditioning_scale**: The degree of influence of the ControlNet model on the base model, ranging from 0 to 1 (floating-point number), with a default value of 0.5. Larger values mean stronger influence from the reference image. +- **controlnet_guidance_start**: The start time of guidance from the ControlNet model, ranging from 0 to 1 (floating-point number), with a default value of 0.2. +- **controlnet_guidance_end**: The end time of guidance from the ControlNet model, ranging from 0 to 1 (floating-point number), with a default value of 0.8. + +## Calling the Text-to-Image Model + +### Using OpenAI SDK + +The following explains how to use the `FLUX.1-dev` text-to-image `ControlNet` interface through the OpenAI SDK. Here's a Python example: + +```python showLineNumbers title="python" +from openai import OpenAI +import base64 +import requests + +client = OpenAI( + base_url="https://ai.gitee.com/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +) + +response = client.images.generate( + prompt="A robot sitting on open grassland, painting on a canvas.", + model="FLUX.1-dev", + size="1024x1024", + extra_body={ + "num_inference_steps": 20, + "guidance_scale": 7.5, + "seed": 42, + "control_image": "https://example.com/image.png", # Replace with your control image URL or base64-encoded image string + "control_type": "canny", + "controlnet_conditioning_scale": 0.5, + "control_guidance_start": 0.8, + "control_guidance_end": 0.2, + }, +) + +for i, image_data in enumerate(response.data): + if image_data.url: + # Download from URL + ext = image_data.url.split('.')[-1].split('?')[0] or "jpg" + filename = f"FLUX.1-dev-output-{i}.{ext}" + response = requests.get(image_data.url, timeout=30) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + print(f"Downloaded image to {filename}") + elif image_data.b64_json: + # Decode base64 + image_bytes = base64.b64decode(image_data.b64_json) + filename = f"FLUX.1-dev-output-{i}.jpg" + with open(filename, "wb") as f: + f.write(image_bytes) + print(f"Saved image to {filename}") +``` + +### Using Requests Library +If you prefer not to use the OpenAI SDK, you can directly use the requests library to call the text-to-image model. Here's a Python example: + +```python showLineNumbers title="python" +import requests +import base64 +import json + +url = "{{SITE_URL}}/v1/images/generations" + +headers = { + "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token + "Content-Type": "application/json", + "X-Failover-Enabled": "true" +} + +data = { + "prompt": "a white siamese cat", # Replace with your text description + "model": "FLUX.1-dev", # Replace with your selected model name + "size": "1024x1024", + "seed": 42, + "response_format": "b64_json", + "num_inference_steps": 25, + "guidance_scale": 7.5, + "control_image": "https://example.com/image.png", # Replace with your control image URL or base64-encoded image string + "control_type": "canny", + "controlnet_conditioning_scale": 0.5, + "control_guidance_start": 0.8, + "control_guidance_end": 0.2, +} + +response = requests.post(url, headers=headers, json=data) + +if response.status_code == 200: + for i, image_data in enumerate(response.data): + if image_data.url: + # Download from URL + ext = image_data.url.split('.')[-1].split('?')[0] or "jpg" + filename = f"FLUX.1-dev-output-{i}.{ext}" + response = requests.get(image_data.url, timeout=30) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + print(f"Downloaded image to {filename}") + elif image_data.b64_json: + # Decode base64 + image_bytes = base64.b64decode(image_data.b64_json) + filename = f"FLUX.1-dev-output-{i}.jpg" + with open(filename, "wb") as f: + f.write(image_bytes) + print(f"Saved image to {filename}") +else: + print(f"Request failed, status code: {response.status_code}") + print(f"Error message: {response.text}") +``` + +Other programming languages can refer to the example code in the [API documentation]({{SITE_URL}}/docs/openapi/v1#tag/图像生成/post/async/images/generations). diff --git a/docs_overseas/products/apis/images-vision/faceid.md b/docs_overseas/products/apis/images-vision/faceid.md new file mode 100644 index 0000000000000000000000000000000000000000..dcc5746463a1f027f5f4e439a1542bf4eac9dd71 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/faceid.md @@ -0,0 +1,142 @@ +--- +sidebar_position: 6 +--- + +# Image Editing: Face Migration + +## Feature Description + +Face migration refers to transferring a specific human face to a generated image based on the image generation capability of the image model. When a user provides an image containing a person's face, the model will extract that person's facial features and embed them into the generated image during the image creation process according to the prompt. + +## Models Supporting Face Migration + +- [flux-1-schnell]({{SITE_URL}}/serverless-api?model=flux-1-schnell&tab=info) + +## Using the API + +The following explains how to use the face migration interface through code. + +### Step 1: Input API Key and Define Request Function + +First, obtain your [access token]({{SITE_URL}}/dashboard/settings/tokens), then define the request function as follows: + +```python showLineNumbers title="python" +import requests +import base64 +from PIL import Image +from io import BytesIO + +API_URL = "{{SITE_URL}}/v1/images/face-migration" +headers = { + "Authorization": "Bearer " +} + +def query(payload): + files = { + "image": (payload["image"], open(payload["image"], "rb")) + } + data = {key: payload[key] for key in payload if key not in files} + response = requests.post(API_URL, headers=headers, files=files, data=data) + return response.json() +``` + +### Step 2: Make a Request and Get Results + +The request method is as follows: + +```python showLineNumbers title="python" +output = query({ + "model": "flux-1-schnell", + "image": "liuyifei.png", + "size": "1024x1024", + "guidance_scale": 4, + "num_inference_steps": 4, + "id_weight": 1, + "id_timestep_start": 0, + "prompt": "Portrait painting, delicate sketch style, colored painting, ultra-high-definition, ultra-high pixel count" +}) +``` + +The prompt in the above code `Portrait painting, delicate sketch style, colored painting, ultra-high-definition, ultra-high pixel count` requires generating a high-definition, ultra-high pixel count colored sketch portrait. +The tutorial uses the following id image: + +![input](../../../../static/img/serverless-api/liuyifei.png) + +Parameter Explanations: + +- **model**: Model name, fixed here. +- **image**: Local image path; as can be seen in the function, it is transmitted in binary form. +- **size**: Dimensions of the generated image. +- **guidance_scale**: Prompt guidance coefficient; larger values mean the generated image adheres more closely to the prompt. +- **num_inference_steps**: Number of steps for image generation; this model can produce excellent results in just 4 steps. +- **id_weight**: The degree of influence of the ID reference image on the generated image; larger values result in a more accurate facial resemblance, which can be adjusted appropriately. +- **id_timestep_start**: The step at which face embedding begins during image generation; smaller values mean face generation starts earlier, resulting in a more accurate resemblance, which can be adjusted appropriately. +- **prompt**: Prompt for image generation; Flux supports long, complex prompts. The more detailed, the better—feel free to be specific. + +### Step 3: Decode and Save Results + +The resulting output is in JSON format as follows: + +```json +{ + "data": [ + { + "b64_json": "" + } + ], + "created": "" +} +``` + +The result is a Base64-encoded image, so it needs to be decoded before saving. Unpack and decode as follows: + +```python showLineNumbers title="python" +b64data = output['data'][0]['b64_json'] +img = Image.open(BytesIO(base64.b64decode(b64data))) +img.save("/path/to/save/res.jpg") +img.show() +``` + +The result is shown below, which generated a colored sketch portrait of the specific face as requested: + +![output](../../../../static/img/serverless-api/flux_face.jpg) + +The complete example code is as follows: + +```python showLineNumbers title="python" +import requests +import base64 +from PIL import Image +from io import BytesIO + +API_URL = "https://ai.gitee.com/v1/images/face-migration" +headers = { + "Authorization": "Bearer " +} + +def query(payload): + files = { + "image": (payload["image"], open(payload["image"], "rb")) + } + data = {key: payload[key] for key in payload if key not in files} + response = requests.post(API_URL, headers=headers, files=files, data=data) + return response.json() + +output = query({ + "model": "flux-1-schnell", + "image": "liuyifei.png", + "size": "1024x1024", + "guidance_scale": 4, + "num_inference_steps": 4, + "id_weight": 1, + "id_timestep_start": 0, + "prompt": "a woman holding sign with glowing green text \"Gitee AI\"", +}) + +data = output["data"][0]["b64_json"] + +stream = BytesIO(base64.b64decode(data)) +img = Image.open(stream) +img.save("output.png") +img.show() +``` \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/fuzzy.md b/docs_overseas/products/apis/images-vision/fuzzy.md new file mode 100644 index 0000000000000000000000000000000000000000..707ad151ca349c2eba9fa12d726add75afc32f48 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/fuzzy.md @@ -0,0 +1,193 @@ +--- +sidebar_position: 5 +--- + +# Image Editing: Style Transfer + +## Feature Description + +Image filters have long been a common feature in many applications. With large models, you can quickly implement image filtering functionality without complex image processing, enabling a variety of filter effects. + +Large models can achieve filtering through multiple methods such as image-to-image generation, using `LORA`, and fine-tuning models. + +In this article, we use the style transfer API to quickly implement image filtering. Compared to other methods, the style transfer API is simple to use, produces significant effects, and can quickly achieve various filter effects. + +## Models Supporting Style Transfer + +- [Kolors]({{SITE_URL}}/serverless-api?model=Kolors&tab=info) +- [HiDream-E1-Full]({{SITE_URL}}/serverless-api?model=HiDream-E1-Full&tab=info) +- [DreamO]({{SITE_URL}}/serverless-api?model=DreamO&tab=info) + +## Experience the API Effect + +### Function Description + +The Serverless API provides an interface for quick experience, allowing you to quickly test the API效果. +Open the [Serverless API page]({{SITE_URL}}/serverless-api?model=Kolors&operation=41), find the `Kolors` model under Image Generation and Processing, click to enter the interface details page, and switch to the style transfer API. + +![image-20250113153212170](../../fuzzy.assets/style_web.jpg) + +In the style transfer interface, the original image refers to the image you want to transform and modify. The prompt and style image are the text and style reference used to guide the modification of the original image. + +### Ghibli-like Style Transfer + +Next, we'll use this interface to complete a Ghibli-style transfer. + +Use the following image as the reference style: + +![20250113164303_吉卜力风格__小清新](../../fuzzy.assets/20250113164303_吉卜力风格__小清新.jpeg) + +Use an ordinary landscape photo as the original image. + +![P1012997](../../fuzzy.assets/P1012997.jpeg) + +Fill in these images on the page. To make the output image more consistent with the original, we set the strength parameter to 0.4. + +![image-20250113173048253](../../fuzzy.assets/image-20250113173048253.png) + +The output result is as follows: + +![image-20250113173107828](../../fuzzy.assets/image-20250113173107828.png) + +### Fluffy Style Transfer + +The reference image is as follows: + +![image-20250114143124824](../../fuzzy.assets/image-20250114143124824.png) + +Following the same steps as above, we can quickly replicate the fluffy image style through the style transfer interface. + +The input is as follows: + +![image-20250114144653414](../../fuzzy.assets/image-20250114144653414.png) + +The output result is as follows: + +![image-20250114144718497](../../fuzzy.assets/image-20250114144718497.png) + +## Calling the Style Transfer API + +After experiencing and verifying the functionality, we can now integrate the above features into our own applications through code calls. + +```python showLineNumbers title="python" +import os +import requests +import base64 +from PIL import Image +from io import BytesIO +from requests_toolbelt import MultipartEncoder + +API_URL = "https://ai.gitee.com/v1/images/style-migration" +headers = { + "Authorization": "Bearer ", +} + +def open_image(img_path): + file_name = os.path.basename(img_path) + return (file_name, open(img_path, "rb"), "application/octet-stream") + +def query(payload): + data = {} + for key, value in payload.items(): + if key == "image": + continue + if key == "style_image": + continue + if value is None: + data[key] = "" + elif isinstance(value, list): + data[key] = ",".join(map(str, value)) + elif isinstance(value, bool): + data[key] = str(value).lower() + else: + data[key] = str(value) + + data["image"] = open_image(payload["image"]) + data["style_image"] = open_image(payload["style_image"]) + multipart_data = MultipartEncoder(fields=data) + headers["Content-Type"] = multipart_data.content_type + response = requests.post(API_URL, headers=headers, data=multipart_data) + return response.json() + +output = query({ + "model": "Kolors", + "size": "1024x1024", + "steps": 25, + "guidance_scale": 6, + "strength": 0.6, + "scale": 0.5, + "prompt": "Convert the girl's photo to the JoJo style of the reference image", + "style_image": "jojo.jpeg", + "image": "woman1.png", +}) +data = output["data"][0]["b64_json"] + +img = Image.open(BytesIO(base64.b64decode(data))) +img.save("img_style.png") +img.show() +``` + +## Usage Scenarios + +#### 🎨 Art Creation + +- **Painting Style Conversion**: Transform photos into oil paintings, watercolors, sketches, traditional Chinese paintings, and other artistic styles +- **Anime Stylization**: Convert real photos into anime, cartoon, or illustration styles +- **Famous Painting Style Imitation**: Mimic the painting styles of masters like Van Gogh, Picasso, and Monet +- **Cultural Style Fusion**: Blend artistic characteristics from different cultural backgrounds, such as Chinese, Japanese, and European styles + +#### 📸 Photography Post-Processing + +- **Filter Effects**: Quickly implement photography filters like retro, film, black and white, and warm tones +- **Atmosphere Creation**: Adjust the overall atmosphere of images, such as dreamy, mysterious, and warm +- **Seasonal Styles**: Convert images to visual effects of different seasons (spring, summer, autumn, winter) +- **Era Styles**: Create a sense of era such as 80s retro, cyberpunk, and steampunk + +#### 🎮 Game Development + +- **Concept Art**: Create concept art of different styles for game scenes and characters +- **Art Style Unification**: Ensure all materials in the game maintain a consistent artistic style +- **Original Painting Production**: Convert 3D renderings into hand-painted style original paintings +- **UI Stylization**: Apply specific artistic styles to game interface elements + +#### 🎬 Film and Television Production + +- **Storyboard Design**: Create storyboard sketches of different styles for film and television works +- **Post-Processing Color Grading**: Achieve specific visual styles and color effects +- **Animation Style**: Convert live-action materials into animation styles +- **Special Effects Preview**: Quickly preview the presentation of different visual effects + +#### 🏢 Commercial Applications + +- **Brand Image**: Create visual styles with brand characteristics for enterprises +- **Product Display**: Display products in different artistic styles to enhance visual appeal +- **Advertising Creativity**: Quickly generate advertising visual schemes of various styles +- **Packaging Design**: Apply specific artistic styles to product packaging + +#### 📱 Social Media + +- **Personal Avatars**: Create personalized style avatars for social media +- **Content Creation**: Add unique visual styles to social platform content +- **Emoticon Production**: Create emoticons and stickers with specific styles +- **Short Video Materials**: Produce visual materials with a unified style for short videos + +#### 🏠 Interior Design + +- **Decoration Preview**: Convert indoor space images into different decoration styles +- **Style Exploration**: Quickly preview decoration styles such as modern, classical, industrial, and Nordic +- **Color Matching**: Try different color schemes and material effects +- **Atmosphere Design**: Create different spatial atmospheres such as warm, simple, and luxurious + +#### 📚 Education and Training + +- **Art Teaching**: Help students understand the characteristics of different artistic styles +- **Creative Inspiration**: Provide students with creative inspiration and reference materials +- **Historical Reenactment**: Convert modern scenes into visual styles of historical periods +- **Cultural Display**: Showcase artistic expressions under different cultural backgrounds + +#### 💼 E-Commerce Retail + +- **Product Stylization**: Apply styles that match the preferences of target users to product images +- **Scene Creation**: Create shopping scenes that match the brand tone +- **Festival Themes**: Adjust product display styles according to different festivals +- **User Personalization**: Provide personalized visual experiences for different user groups \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/inpainting.md b/docs_overseas/products/apis/images-vision/inpainting.md new file mode 100644 index 0000000000000000000000000000000000000000..7109ada820ec70e0a038373e35888bac63ef8c10 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/inpainting.md @@ -0,0 +1,75 @@ +--- +sidebar_position: 2 +--- + +# Image Editing: Image Prompting + +## Feature Description + +The "Image Prompting" feature allows you to upload an image as a reference base, then combine it with your text description to generate a new image that relates in style or content to the uploaded image. Whether adjusting colors, styles, or enriching details, Image Prompting helps you easily create completely new visual effects based on existing images. + +In short, the Image Prompting feature enables you to generate a new image related to an existing image, using the original as a foundation. + +## Models Supporting Image Prompting + +- [Kolors]({{SITE_URL}}/serverless-api?model=Kolors&tab=info) +- [FLUX.1-Kontext-dev]({{SITE_URL}}/serverless-api?model=FLUX.1-Kontext-dev&tab=info) +- [FLUX.1-Dev]({{SITE_URL}}/serverless-api?model=FLUX.1-dev&tab=info) +- [HiDream-E1-Full]({{SITE_URL}}/serverless-api?model=HiDream-E1-Full&tab=info) + +## Usage Method + +Upload reference image -> Enter prompt -> Input other parameters -> Click run + +![Image](https://foruda.gitee.com/images/1729563843676749379/6ca35c1d_14415575.jpeg) + +## Example Effects + +| Reference Image | Prompt | Result | +| ----------------------------------------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------- | +| ![Image](https://foruda.gitee.com/images/1729492513893163648/03bd7fd3_14415575.png) | Wearing a black T-shirt with green Chinese characters "hello" printed in uppercase | ![Image](https://gitee-ai-testing.su.bcebos.com/v1/uploads/img/news_cover_9-user-guide3.png) | +| ![Image](https://foruda.gitee.com/images/1729492538626036018/5fe7bace_14415575.png) | A smiling rabbit running | ![Image](https://gitee-ai-testing.su.bcebos.com/v1/uploads/img/news_cover_10-user-guide5.png) | + +## Usage Scenarios + +#### 🎨 Style Transformation + +- **Artistic Stylization**: Convert ordinary photos into oil paintings, watercolors, sketches, and other artistic styles +- **Era Styles**: Transform modern photos into retro, cyberpunk, steampunk, and other era-specific styles +- **Cultural Styles**: Convert to visual styles of different cultural backgrounds such as Chinese, Japanese, and European + +#### 🏞️ Scene Reconstruction + +- **Environment Changes**: Convert indoor scenes to outdoor, or change seasons and weather conditions +- **Background Replacement**: Keep the main subject unchanged while replacing with a completely new background environment +- **Atmosphere Creation**: Adjust lighting and color tones to create different emotional atmospheres + +#### 👔 Clothing and Styling + +- **Fashion Design**: Change characters' clothing to different styles and colors +- **Hairstyle Changes**: Experiment with different hairstyles and hair color combinations +- **Makeup Adjustments**: Change makeup styles for different occasions from daily to evening events + +#### 🏗️ Architecture and Space + +- **Interior Design**: Change room decoration styles and furniture layouts +- **Building Renovation**: Add different design elements to building exteriors +- **Landscape Design**: Adjust vegetation, decorations, etc., in outdoor spaces + +#### 📱 Product Display + +- **Product Variants**: Showcase different colors and material versions of products +- **Scene Application**: Place products in different usage scenarios +- **Packaging Design**: Create different style packaging designs for products + +#### 🎭 Creative Design + +- **Concept Art**: Create concept designs for games, movies, etc. +- **Advertising Creativity**: Quickly generate multiple visual creative schemes for advertisements +- **Illustration Creation**: Create exquisite illustrations based on sketches or reference images + +#### 🔧 Image Restoration and Enhancement + +- **Detail Enrichment**: Add rich details and textures to simple sketches +- **Resolution Enhancement**: Improve image quality while maintaining original features +- **Damage Repair**: Fix damaged parts of old photos while preserving the original style \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/lora.md b/docs_overseas/products/apis/images-vision/lora.md new file mode 100644 index 0000000000000000000000000000000000000000..08471ef63ffa320ec60ba50c3f736db16cf791b6 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/lora.md @@ -0,0 +1,143 @@ +--- +sidebar_position: 7 +--- + +# Fine-Tuning Models with LoRA + +## Feature Description + +`LoRA` refers to Low-Rank Adaptation, a method for fine-tuning pre-trained models. `LoRA` can adapt to new tasks by introducing low-rank matrices without altering the weights of the pre-trained model. In text-to-image and image editing tasks, `LoRA` can be used to fine-tune pre-trained image models, enabling them to perform better on specific tasks. + +## Models Supporting LoRA + +- [Flux.1-dev]({{SITE_URL}}/serverless-api?model=flux-1-dev&tab=info) +- [Flux.1-schnell]({{SITE_URL}}/serverless-api?model=flux-1-schnell&tab=info) +- [Flux.1-Kontext-dev]({{SITE_URL}}/serverless-api?model=FLUX.1-Kontext-dev&tab=info) +- [InstantCharacter]({{SITE_URL}}/serverless-api?model=InstantCharacter&tab=info) +- [OmniConsistency]({{SITE_URL}}/serverless-api?model=OmniConsistency&tab=info) +- [stable-diffusion-xl-base-1.0]({{SITE_URL}}/serverless-api?model=stable-diffusion-xl-base-1.0&tab=info) + +## Experience the API Effect + +### Function Description + +The Serverless API provides an interface for quick experience, allowing you to quickly test the API效果. +Open the [Serverless API page]({{SITE_URL}}/serverless-api?model=flux-1-dev), find the `Flux.1-dev` model under Image Generation and Processing, and click to enter the interface details page. + +![image](/img/serverless-api/flux-1-dev-lora.png) + +In the text-to-image API, within the LoRA settings: `url` is the URL of the LoRA model to be loaded; `weight` is used for weighted fusion between different LoRA model weights; `lora_scale` is the degree of influence the LoRA model has on the base model. + +## Calling the Text-to-Image Model + +### Using OpenAI SDK + +The following explains how to use the `Flux.1-dev` text-to-image `LoRA` interface through the OpenAI SDK. Here's a Python example: + +```python showLineNumbers title="python" +from openai import OpenAI +import base64 +import requests + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your API Key +) + +response = client.images.generate( + prompt="A robot sitting on open grassland, painting on a canvas.", + model="FLUX.1-dev", + size="1024x1024", + extra_body={ + "num_inference_steps": 20, + "guidance_scale": 7.5, + "seed": 42, + "lora_weights": [ + { + "url": "https://example.com/lora-model.safetensors", # Replace with your LoRA model URL + "weight": 1, + } + ], + "lora_scale": 0.5 + }, +) + +for i, image_data in enumerate(response.data): + if image_data.url: + # Download from URL + ext = image_data.url.split('.')[-1].split('?')[0] or "jpg" + filename = f"FLUX.1-dev-output-{i}.{ext}" + response = requests.get(image_data.url, timeout=30) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + print(f"Downloaded image to {filename}") + elif image_data.b64_json: + # Decode base64 + image_bytes = base64.b64decode(image_data.b64_json) + filename = f"FLUX.1-dev-output-{i}.jpg" + with open(filename, "wb") as f: + f.write(image_bytes) + print(f"Saved image to {filename}") +``` + +### Using Requests Library + +If you prefer not to use the OpenAI SDK, you can directly use the requests library to call the text-to-image model. Here's a Python example: + +```python showLineNumbers title="python" +import requests +import base64 +import json + +url = "{{SITE_URL}}/v1/images/generations" + +headers = { + "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token + "Content-Type": "application/json", + "X-Failover-Enabled": "true" +} + +data = { + "prompt": "a white siamese cat", # Replace with your text description + "model": "FLUX.1-dev", # Replace with your selected model name + "size": "1024x1024", + "seed": 42, + "response_format": "b64_json", + "num_inference_steps": 25, + "guidance_scale": 7.5, + "lora_weights": [ + { + "url": "https://example.com/lora-model.safetensors", # Replace with your LoRA model URL + "weight": 1, + } + ], + "lora_scale": 0.5 +} + +response = requests.post(url, headers=headers, json=data) + +if response.status_code == 200: + for i, image_data in enumerate(response.data): + if image_data.url: + # Download from URL + ext = image_data.url.split('.')[-1].split('?')[0] or "jpg" + filename = f"FLUX.1-dev-output-{i}.{ext}" + response = requests.get(image_data.url, timeout=30) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + print(f"Downloaded image to {filename}") + elif image_data.b64_json: + # Decode base64 + image_bytes = base64.b64decode(image_data.b64_json) + filename = f"FLUX.1-dev-output-{i}.jpg" + with open(filename, "wb") as f: + f.write(image_bytes) + print(f"Saved image to {filename}") +else: + print(f"Request failed, status code: {response.status_code}") + print(f"Error message: {response.text}") +``` + +For other programming languages, you can refer to the sample codes in the [API documentation]({{SITE_URL}}/docs/openapi/v1#tag/图像生成/post/async/images/generations). diff --git a/docs_overseas/products/apis/images-vision/object-detection.md b/docs_overseas/products/apis/images-vision/object-detection.md new file mode 100644 index 0000000000000000000000000000000000000000..3836d210aefa4d6bd37c8565bb47586059ecc9c0 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/object-detection.md @@ -0,0 +1,360 @@ +--- +title: Object Detection +sidebar_position: 100 +--- + +# Object Detection and Description + +Molifangzhou provides image annotation capabilities through the [Florence-2-large]({{SITE_URL}}/serverless-api?model=Florence-2-large&tab=info) model. + +`Florence-2-large` is an open-source multi-functional image annotation model developed by Microsoft, which can assist in annotating image content, generating image descriptions, identifying objects, etc. Thanks to its large model architecture, `Florence-2` also supports using prompts to directionally annotate specific objects in images. + +:::tip +This model only supports **English** for input and output. Therefore, both the input prompts, the recognized content, and the output results **will be in English**. Any information in other languages may cause unpredictable output results from the model. +::: + +The following describes how to use the `Florence-2-large` model for image annotation in code. + +## Preparation + +First, obtain your [access token]({{SITE_URL}}/dashboard/settings/tokens), then define the request function as follows. + +The use of the interface is illustrated with Python code. The following will separately demonstrate the usage methods of the two functions: "image description" and "object recognition". Before starting, define the request function as follows: + +```python showLineNumbers title="python" +import requests + +headers = { + "Authorization": "Bearer ", +} + +# URL for requesting image descriptions +url_caption = "{{SITE_URL}}/v1/images/caption" +# URL for requesting object recognition +url_object_detection = "{{SITE_URL}}/v1/images/object-detection" + +def query(url, payload): + files = { + "image": (payload["image"], open(payload["image"], "rb")) + } + data = {key: payload[key] for key in payload if key not in files} + response = requests.post(url, headers=headers, files=files, data=data) + return response.json() +``` + +The following image is used as an example: + +![example image](/img/base/florence-2-image.webp) + +## 1. Image Description Generation + +This function can obtain a natural language description of the image input by the user. +Using the `query` function above, send a request as follows: + +```python showLineNumbers title="python" +output = query(url_caption, { + "model": "Florence-2-large", + "image": "path/to/image.jpg", + "caption_level": 0 +}) +``` + +Explanation of request parameters: + +- `image` :The image to be described, only one image is supported as input. +- `caption_level` :The level of detail required for the image description. **Supports three levels: 0, 1, and 2**. The higher the level, the more detailed the description and the more words in the output. The level can be adjusted based on needs. If not specified, the default level 0 is used. + +When `caption_level=0` is set, the output is as follows: + +> A woman and a little girl walking down a dirt road. + +When `caption_level=1` is set, the output is as follows: + +> The image shows a woman and a little girl walking down a dirt road, hand in hand, with a horse in the background. The sky is filled with clouds and the ground is covered with lush green grass. The image is animated, giving it a whimsical feel. + +When `caption_level=2` is set, the output is as follows: + +> The image is an illustration of a mother and daughter walking hand in hand in a field. The mother is wearing a long white dress with pink flowers on it and has long blonde hair. She is holding the hand of the daughter, who is also wearing a purple dress. They are both smiling and appear to be enjoying each other's company. +> In the background, there is a fence with wooden posts and a horse grazing on the grass. The sky is filled with fluffy white clouds and the sun is shining brightly, creating a warm glow. The field is covered in yellow flowers and there are hills in the distance. The overall mood of the image is peaceful and serene. + +It can be intuitively felt from the results that the higher the `caption_level` , the more detailed the description result. You can choose different levels according to your needs. + +## 2. Object Recognition + +This function can obtain the label and position information of the main subject target in the input image. + +Different from traditional object recognition, the object recognition of large models does not provide the confidence of labels, and each result is deterministic. However, large models support inputting the prompt parameter `prompt` for assistance, and can have more detailed label descriptions without 预置 labels in advance. + +Distinguished by whether `prompt` is input, this function can be divided into "traditional object recognition" and "instruction-based object recognition". + +### 2.1 Traditional Object Recognition + +This recognition method is similar to traditional object recognition tasks, which can return labels and the coordinates of object rectangles. The request code based on this method is as follows: + +The code uses only two parameters: `image` and `caption_level`: + +- `image` :The image to be described, only one image is supported as input. +- `caption_level` :The level of detail required for the image description. **Supports three levels: 0, 1, and 2**. The higher the level, the more detailed the description and the more words in the output. The level can be adjusted based on needs. If not specified, the default level 0 is used. + +Use the following request code: + +```python showLineNumbers title="python" +output = query({ + "model": "Florence-2-large", + "image": "path/to/image.jpg", + "caption_level": 0 +}) +``` + +The request result format is as follows: + +```json +{ + "num_objects": int, + "objects":[ + { + "label": str, + "bbox": [x1, y1, x2, y2] + }, ... + ] +} +``` + +It is a json format, with detailed explanations as follows: + +- `num_objects` :The number of objects detected in the image. +- `objects` :An array of objects, each object contains the label and position of a target. + - `label` :The label information of the target. + - `bbox` :The position of the target, which is a quadruplet, can be grouped into `(x1,y1), (x2,y2)` pairs, representing the coordinates of the top-left and bottom-right corners of the rectangle. + We use the same example image. + +When `caption_level=0` is set, the output is as follows: +```json +{ + "num_objects": 5, + "objects": [ + { + "label": "animal", + "bbox": [ + 58.880001068115234, 598.3999633789062, 201.21600341796875, + 748.1599731445312 + ] + }, + { + "label": "girl", + "bbox": [ + 321.0240173339844, 914.5599975585938, 478.72003173828125, + 1203.8399658203125 + ] + }, + { + "label": "human face", + "bbox": [ + 501.2480163574219, 753.2799682617188, 545.280029296875, + 795.5199584960938 + ] + }, + { + "label": "human face", + "bbox": [ + 379.39202880859375, 929.9199829101562, 414.2080078125, 977.2799682617188 + ] + }, + { + "label": "woman", + "bbox": [ + 427.52001953125, 700.7999877929688, 804.35205078125, 1238.4000244140625 + ] + } + ] +} +``` + +When `caption_level=1` is set, the output is as follows: + +```json +{ + "num_objects": 4, + "objects": [ + { + "label": "girl in white dress with pink flowers in field at sunset", + "bbox": [ + 427.52001953125, 700.7999877929688, 805.3760375976562, + 1238.4000244140625 + ] + }, + { + "label": "girl with red hair and blue dress in field with wooden fence", + "bbox": [ + 311.8080139160156, 914.5599975585938, 479.7440185546875, + 1203.8399658203125 + ] + }, + { + "label": "brown horse with blonde mane and tail in field", + "bbox": [ + 58.880001068115234, 598.3999633789062, 201.21600341796875, + 748.1599731445312 + ] + }, + { + "label": "human face", + "bbox": [ + 501.2480163574219, 753.2799682617188, 545.280029296875, + 795.5199584960938 + ] + } + ] +} +``` + +It is worth noting that setting different `caption_level` may lead to **完全不同** recognition results. + +In the above results,`` level 0 recognizes more objects than level 1 `` , and the description of objects recognized at level 1 is more detailed than that at level 0. + +This is because the higher the level, the more detailed the description, and the model is more inclined to find complex objects. The description of objects at level 1 is more complex and of higher quality. +In other words, the lower the level, the model is more inclined to choose simple targets, and the description is more concise. As a result, there are more objects in the results. Therefore, you can choose the appropriate parameters based on this experience for target recognition. + +### 2.2 Instruction-based Object Recognition + +This function inputs a picture in the request and also inputs a `prompt` word. + +The model will extract words related to the image content in `prompt` as label results for object recognition. As follows, we wrote `beautiful girl in the image` in the prompt, and the model will recognize the `beautiful girl` in the image and return the label and target position. + +Note that if the `prompt` parameter is used, the `caption_level` parameter will be invalid, and the detail level of the label content will be determined by the prompt. + +```python showLineNumbers title="python" +output = query(url_onject_detection, { + "model": "Florence-2-large", + "image": "path/to/image.jpg", + "prompt": "beautiful girl in the image" +}) +``` + +Explanation of request parameters: + +- `image` :The image to be described, only one image is supported as input. +- `prompt` :Auxiliary prompt words. + +Request results: + +```json +{ + "num_objects": 2, + "objects": [ + { + "label": "beautiful girl", + "bbox": [ + 433.6640319824219, 702.0799560546875, 806.4000244140625, + 1239.679931640625 + ] + }, + { + "label": "beautiful girl", + "bbox": [ + 317.9520263671875, 913.2799682617188, 479.7440185546875, 1208.9599609375 + ] + } + ] +} +``` + +It can be seen from the request results that the model found that the semantics of `beautiful girl` in `prompt` are similar to the two girls in the picture. Therefore, the model recognized these two targets, gave the `bbox` target position, and used the words or short sentences in our `prompt` as the label. + +This function is suitable for when you want to mark a specific subject object in the picture. The model will use the words in our `prompt` as `label` for the specific marked object. + +:::tip +Secretly tell you that we found that popular film, television and animation character models can also be recognized (we tried "Star Wars" and "One Piece"). You can try it~ +::: + +## 3. Post-processing of Label Results + +After obtaining the labels through object recognition, in order to better see the marking effect, we provide a function for drawing results for reference. The code is as follows: + +```python showLineNumbers title="python" +from PIL import Image, ImageDraw, ImageFont + +def draw_labelled_bbox(image, bbox, label): + draw = ImageDraw.Draw(image) + + # Set font + font_size = 16 # Initial font size + try: + font = ImageFont.truetype("arial.ttf", font_size) # Use system font + except IOError: + font = ImageFont.load_default() # If no font file, use default font + + draw.rectangle(bbox, outline="red", width=3) + x1, y1, x2, y2 = bbox + max_width = x2 - x1 + + words = label.split() + text_lines = [] + current_line = "" + + for word in words: + test_line = f"{current_line} {word}".strip() + line_width = draw.textlength(test_line, font=font) + if line_width <= max_width: + current_line = test_line + else: + text_lines.append(current_line) + current_line = word + if current_line: + text_lines.append(current_line) + + line_height = font.getbbox("A")[3] - font.getbbox("A")[1] + label_height = line_height * len(text_lines) + 4 + label_box = [x1, y1 - label_height, x2, y1] + + draw.rectangle(label_box, fill="red") + text_y = y1 - label_height + 2 + for line in text_lines: + draw.text((x1 + 2, text_y), line, fill="white", font=font) + text_y += line_height + + return image + + +# Example parameters +image = Image.open("/path/to/your/image.jpg") +bbox = [148, 276, 290, 653] +label = "put your label here" + +# Call function +image = draw_labelled_bbox(image, bbox, label) + +# Display and save +image.show() +image.save("/path/to/save.jpg") +``` + +Take the example image and the specific label result `obj` as an example: + +```json +{ + "label": "girl in white dress with pink flowers in field at sunset", + "bbox": [ + 433.6640319824219, 702.0799560546875, 806.4000244140625, 1239.679931640625 + ] +} +``` + +Convert the result to a `dict` class in python, and we call the function with the following code: + +```python showLineNumbers title="python" +image = loaded_image +label = obj['label'] +bbox = obj['bbox'] + +image = draw_labelled_bbox(image, bbox, label) +image.show() +``` + +The annotation result can be obtained as shown in the following figure: + +![](/img/base/florence-tag-res.jpg) + +The example code contains comments related to fonts and calls, which you can modify according to your needs. + +The above is the entire tutorial, wish you a pleasant calling experience! diff --git a/docs_overseas/products/apis/images-vision/partial-repaint.md b/docs_overseas/products/apis/images-vision/partial-repaint.md new file mode 100644 index 0000000000000000000000000000000000000000..b407d237c1207c36da7e3a56786fc8e175c3cfac --- /dev/null +++ b/docs_overseas/products/apis/images-vision/partial-repaint.md @@ -0,0 +1,74 @@ +--- +sidebar_position: 4 +--- + +# Image Editing: Partial Redrawing + +## Feature Description + +The "Partial Redrawing" feature allows you to easily repair, modify, or redraw specific areas in an image. By selecting the area to be redrawn and entering your expectations, it intelligently fills in missing parts or replaces flawed areas while maintaining the original image style. + +In short, the partial redrawing feature enables you to modify or replace content in specific areas based on an existing image. + +## Models Supporting Partial Redrawing + +- [Kolors]({{SITE_URL}}/serverless-api?model=Kolors&tab=info) +- [FLUX.1-Dev]({{SITE_URL}}/serverless-api?model=FLUX.1-dev&tab=info) +- [FLUX.1-Kontext-dev]({{SITE_URL}}/serverless-api?model=FLUX.1-Kontext-dev&tab=info) + +## Usage Method + +Upload original image -> Upload layer mask -> Enter prompt -> Input other parameters -> Click run + +![Partial Redrawing](https://foruda.gitee.com/images/1729564620777315028/0737ae03_14415575.jpeg) + +## Example Effects + +| Reference Image | Layer Mask | prompt | Result | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | +| ![Image](https://foruda.gitee.com/images/1729492589364653082/4af32ae7_14415575.png) | ![Image](https://foruda.gitee.com/images/1729492604658575880/02103d7d_14415575.png) | 穿着美少女战士的衣服,一件类似于水手服风格的衣服,包括一个白色紧身上衣,前胸搭配一个大大的红色蝴蝶结。衣服的领子部分呈蓝色,并且有白色条纹。她还穿着一条蓝色百褶裙,超高清,辛烷渲染,高级质感,32k,高分辨率,最好的质量,超级细节,景深 | ![Image](https://foruda.gitee.com/images/1729510320514796520/affd853e_14415575.jpeg) | +| ![Image](https://foruda.gitee.com/images/1729492724529895938/8039019e_14415575.png) | ![Image](https://foruda.gitee.com/images/1729492743609546551/870abb50_14415575.png) | 这是一幅令人垂涎欲滴的火锅画面,各种美味的食材在翻滚的锅中煮着,散发出的热气和香气令人陶醉。火红的辣椒和鲜艳的辣椒油熠熠生辉,具有诱人的招人入胜之色彩。锅内肉质细腻的薄切牛肉、爽口的豆腐皮、鲍汁浓郁的金针菇、爽脆的蔬菜,融合在一起,营造出五彩斑斓的视觉呈现 | ![Image](https://foruda.gitee.com/images/1729510496525173718/68e75386_14415575.jpeg) | + +## Usage Scenarios + +#### 🎨 Style Transformation + +- **Artistic Stylization**: Convert ordinary photos into oil paintings, watercolors, sketches, and other artistic styles +- **Era Styles**: Transform modern photos into retro, cyberpunk, steampunk, and other era-specific styles +- **Cultural Styles**: Convert to visual styles of different cultural backgrounds such as Chinese, Japanese, and European + +#### 🏞️ Scene Reconstruction + +- **Environment Changes**: Convert indoor scenes to outdoor, or change seasons and weather conditions +- **Background Replacement**: Keep the main subject unchanged while replacing with a completely new background environment +- **Atmosphere Creation**: Adjust lighting and color tones to create different emotional atmospheres + +#### 👔 Clothing and Styling + +- **Fashion Design**: Change characters' clothing to different styles and colors +- **Hairstyle Changes**: Experiment with different hairstyles and hair color combinations +- **Makeup Adjustments**: Change makeup styles for different occasions from daily to evening events + +#### 🏗️ Architecture and Space + +- **Interior Design**: Change room decoration styles and furniture layouts +- **Building Renovation**: Add different design elements to building exteriors +- **Landscape Design**: Adjust vegetation, decorations, etc., in outdoor spaces + +#### 📱 Product Display + +- **Product Variants**: Showcase different colors and material versions of products +- **Scene Application**: Place products in different usage scenarios +- **Packaging Design**: Create different style packaging designs for products + +#### 🎭 Creative Design + +- **Concept Art**: Create concept designs for games, movies, etc. +- **Advertising Creativity**: Quickly generate multiple visual creative schemes for advertisements +- **Illustration Creation**: Create exquisite illustrations based on sketches or reference images + +#### 🔧 Image Restoration and Enhancement + +- **Detail Enrichment**: Add rich details and textures to simple sketches +- **Resolution Enhancement**: Improve image quality while maintaining original features +- **Damage Repair**: Fix damaged parts of old photos while preserving the original style \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/quick_tuning_guide.md b/docs_overseas/products/apis/images-vision/quick_tuning_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..20068ec51e7bfd0b035300b28232e711cfa0db26 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/quick_tuning_guide.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 11 +--- + +# Parameter Tuning Guide for Text-to-Image Models + +This document will introduce how to quickly adjust and optimize the parameters and configurations of text-to-image models to achieve the best generation results. + +### 1. AnimeSharp (Anime Super-Resolution Model) + +#### Core Positioning +A super-resolution model specifically optimized for anime styles. It excels at preserving line sharpness and color saturation, outperforming general super-resolution models (such as Real-ESRGAN) by 40% in anime scenarios. + +#### Parameter Settings (Must-Tune Items) + +| Parameter Name | Value Range | Description | Recommended Setting (Default) | +|------------------|---------------|-----------------------------------------------------------------------------|--------------------------------| +| `Magnification` | 2x/4x | Controls output image size; 4x is the model-optimized multiple with best results | 4x | +| `Sharpening Strength` | 0.1-1.0 | Adjusts sharpness of anime lines. Too high may cause noise; too low makes lines blurry | 0.7 (balances sharpness and naturalness) | +| `Denoise Threshold` | 0-50 | Removes noise from original images (e.g., scan spots). Higher values mean stronger denoising but potential detail loss | 20 (suitable for moderately noisy images) | + +#### Prompt Engineering (Input Instructions) +- **Essential Elements**: Clearly mark "anime style" + image subject (e.g., "2D anime girl illustration," "Japanese anime scene") to prevent the model from misclassifying it as realistic style. +- **Example**: + Input image + supplementary description "anime-style character portrait with clear lines and high-contrast colors." The model will prioritize optimizing key anime details such as hair strands and clothing textures. + +#### Applicable Scenarios +Anime illustration enlargement, old anime screenshot restoration, game concept art HD enhancement. **Not recommended for realistic photos** (may cause distortion of faces/scenery). + + +### 2. FLUX.1-schnell (Fast High-Quality Text-to-Image) + +#### Core Positioning +Adopts latent adversarial diffusion distillation technology, capable of generating high-definition images in 1-4 steps. It balances speed and quality, supporting a maximum resolution of 2048×2048. + +#### Parameter Settings (Core Optimization Items) + +| Parameter Name | Value Range | Description | Scenario Adaptation Strategy | +|------------------|---------------|-----------------------------------------------------------------------------|------------------------------| +| `Generation Steps` | 1-4 steps | More steps mean richer details but longer processing time: 1 step (fast but fewer details), 4 steps (best quality) | Use 1 step for quick previews, 3-4 steps for final output | +| `Resolution` | 1024×1024/1536×1536/2048×2048 | High resolutions require asynchronous interface (to avoid timeouts), suitable for poster/wallpaper creation | 1024×1024 for social media, 2048×2048 for printing | +| `Style Strength` | 0.5-2.0 | Controls style transfer intensity. Higher values mean closer adherence to prompt descriptions (e.g., more prominent "cyberpunk" features) | 1.2 (balances fidelity and creativity) | + +#### Prompt Engineering (Structured Template) +```markdown +Subject Description (required): [Specific character/scene, e.g., "silver-haired cat-eared girl," "futuristic city night view"] +Style Specification (required): [anime/realistic/oil painting, etc., e.g., "Makoto Shinkai-style animation scene"] +Detail Supplement (optional): [Lighting/colors/composition, e.g., "backlight effect, water reflection, warm color tone"] +Quality Requirements (optional): [Clarity/detail level, e.g., "8K precision, individual hair strands visible"] \ No newline at end of file diff --git a/docs_overseas/products/apis/images-vision/text2image.md b/docs_overseas/products/apis/images-vision/text2image.md new file mode 100644 index 0000000000000000000000000000000000000000..f11aea7cc5bc299627f13d2c5097111b3f40387a --- /dev/null +++ b/docs_overseas/products/apis/images-vision/text2image.md @@ -0,0 +1,102 @@ +--- +sidebar_position: 1 +--- + +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Text-to-Image Generation + +## Feature Description + +Text-to-image models can generate corresponding images based on text descriptions input by users. These models support various styles and themes, capable of producing high-quality images suitable for multiple fields such as creative design and artistic creation. + +![Model Parameters](/img/serverless-api/model-args.jpg) + +:::info Note +Although they are all text-to-image models, different models may have inconsistent calling parameters. For specific parameters and their meanings, please refer to the experience interface of the corresponding model. +::: + +## Text-to-Image Model List + +MoArk provides a rich selection of text-to-image models. You can view and experience these models in the [Model Square]({{SITE_URL}}/serverless-api#image_generation). + + + +## Calling Text-to-Image Models + +### Using OpenAI SDK + +You can use the OpenAI SDK to call text-to-image models. Here is an example using Python: + +```python showLineNumbers title="python" +from openai import OpenAI +import base64 + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token + default_headers={"X-Failover-Enabled":"true"}, +) + +response = client.images.generate( + prompt="a white siamese cat", # Replace with your text description + model="Kolors", # Replace with your selected model name + size="1024x1024", + extra_body={ + "num_inference_steps": 25, + "guidance_scale": 7.5, + }, +) + +image_base64 = response.data[0].b64_json +image_bytes = base64.b64decode(image_base64) + +# Save the image to a file +with open("Kolors-output.png", "wb") as f: + f.write(image_bytes) +``` + +### Using Requests Library + +If you prefer not to use the OpenAI SDK, you can directly use the `requests` library to call text-to-image models. Here's a Python example: + +```python showLineNumbers title="python" +import requests +import base64 +import json + +url = "{{SITE_URL}}/v1/images/generations" + +headers = { + "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token + "Content-Type": "application/json", + "X-Failover-Enabled": "true" +} + +data = { + "prompt": "a white siamese cat", # Replace with your text description + "model": "Kolors", # Replace with your selected model name + "size": "1024x1024", + "response_format": "b64_json", + "num_inference_steps": 25, + "guidance_scale": 7.5 +} + +response = requests.post(url, headers=headers, json=data) + +if response.status_code == 200: + result = response.json() + image_base64 = result["data"][0]["b64_json"] + image_bytes = base64.b64decode(image_base64) + + # Save the image to a file + with open("Kolors-output.png", "wb") as f: + f.write(image_bytes) + + print("Image generated successfully and saved as Kolors-output.png") +else: + print(f"Request failed, status code: {response.status_code}") + print(f"Error message: {response.text}") +``` + +For other programming languages, you can refer to the sample codes in the [API Documentation]({{SITE_URL}}/docs/openapi/v1#tag/图像生成/post/async/images/generations). diff --git a/docs_overseas/products/apis/images-vision/visions.md b/docs_overseas/products/apis/images-vision/visions.md new file mode 100644 index 0000000000000000000000000000000000000000..09503c0fc2bdfeda37dcf62697ba03d39e3185e8 --- /dev/null +++ b/docs_overseas/products/apis/images-vision/visions.md @@ -0,0 +1,113 @@ +--- +sidebar_position: 101 +--- + +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Vision Models + +## Function Description + +Vision models are a category of artificial intelligence models specifically designed to process and understand visual information such as images and videos. These models, leveraging deep learning technologies, can "see" and interpret image content like humans do, and perform various vision-related tasks. + +The core capabilities of vision models include image recognition, content understanding, feature extraction, and pattern matching. They are widely applied in fields such as autonomous driving, medical image analysis, security monitoring, and content moderation, helping people process and utilize visual data more efficiently. + +## Vision Models Overview + + + +## Usage Method + +Provide an image along with corresponding prompts, and the model will return text-based results according to the requirements specified in the prompts. + +![Vision Model Experience](/img/serverless-api/visions.jpg) + +## Example Code + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Replace with your access token +) + +response = client.chat.completions.create( + messages=[ + { + "role": "system", + "content": "You are a helpful and harmless assistant. You should think step-by-step." + }, + { + "role": "user", + "content": [ + { + "type": "image_url", + "image_url": { + "url": "https://example.com/image.jpg" # Replace with your image URL + } + }, + { + "type": "text", + "text": "Please describe this image" # Replace with your prompt + } + ] + } + ], + model="InternVL3-78B", + stream=True, + max_tokens=512, + temperature=0.7, + top_p=1, + extra_body={ + "top_k": 1, + }, + frequency_penalty=0, +) + +fullResponse = "" +print("Response:") +# Print streaming response +for chunk in response: + delta = chunk.choices[0].delta + # If is thinking content, print it in gray + if hasattr(delta, 'reasoning_content') and delta.reasoning_content: + fullResponse += delta.reasoning_content + print(f"\033[90m{delta.reasoning_content}\033[0m", end="", flush=True) + elif delta.content: + fullResponse += delta.content + print(delta.content, end="", flush=True) +``` + +## Application Scenarios + +#### 🛡️ Content Moderation + +- **Violation Detection**:Identify inappropriate or non-compliant image content +- **Quality Assessment**:Evaluate the quality and suitability of images +- **Copyright Protection**:Detect image copyright and source information + +#### 🏥 Medical Diagnosis + +- **Medical Image Analysis**:Analyze X-rays, CT scans, MRI images, etc. +- **Lesion Detection**:Identify and locate pathological areas +- **Auxiliary Diagnosis**:Provide diagnostic suggestions and references for doctors + +#### 🚗 Autonomous Driving + +- **Environmental Perception**:Identify road, vehicles, pedestrians, etc. +- **Obstacle Detection**:Real-time detection of obstacles on the road +- **Traffic Sign Recognition**:Identify traffic lights, signs, etc. + +#### 🛒 E-commerce Retail + +- **Product Recognition**:Automatically identify and classify products +- **Product Recommendation**:Recommend products based on visual similarity +- **Inventory Management**:Manage inventory through image recognition + +#### 🏭 Industrial Detection + +- **Quality Control**:Detect defects and quality issues in products +- **Safety Monitoring**:Monitor the safety status of industrial environments +- **Device Maintenance**:Evaluate device status through visual detection + diff --git a/docs_overseas/products/apis/index.md b/docs_overseas/products/apis/index.md new file mode 100644 index 0000000000000000000000000000000000000000..664b9d32e1bdf90eedff3e8fb28763fec7a86d47 --- /dev/null +++ b/docs_overseas/products/apis/index.md @@ -0,0 +1,73 @@ +--- +description: The Model Hub offers developers an effortless way to access diverse AI models without managing underlying hardware or infrastructure. Interact with MoArk's full suite of model services through simple HTTP requests. +--- + +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Model Hub Overview + +The Model Hub offers developers an effortless way to access diverse AI models without managing underlying hardware or infrastructure. Interact with MoArk's full suite of model services through simple HTTP requests. + +## Experience Model Services + +You can explore our selected models on [Model Hub]({{SITE_URL}}/serverless-api) and experience different model outputs for free. Additionally, you can call the API to integrate these models into your applications. + +Currently, we have deployed more than 100 models across various categories. Here's a list of the largest language models: + + + +More model API services are gradually added... + +## Purchase Model Resource Packs + +**Purchase Process:** + +1. **Online Experience Models:** Visit [Model Hub]({{SITE_URL}}/serverless-api) to explore the list of deployed models. You can experience the models for free. +2. **Purchase Resource Pack:** In the Model Hub, click [Purchase Full Model Resource Pack]({{SITE_URL}}/serverless-api/order?package=1910) to purchase a resource pack for yourself or your organization. +3. **Create Order and Payment:** After completing the payment, you can experience all the models on [Model Hub]({{SITE_URL}}/serverless-api) or call the API to integrate these models into your applications. + +![Purchase Full Model Resource Pack](/img/purchase/purchase03.png) + +**Billing Information:** + +- **Billing Rules:** Support two billing methods: by call count and by `tokens`. You can choose the one that suits your needs. If you have purchased multiple resource packs and the access token is not bound to a specific resource pack, the system will deduct according to the order of purchase. +- **Cancellation Rules:** Models in use do not support refunds. + +For more information on purchasing model resource packs, please visit [Purchase Model Resource Packs](/docs/billing/purchase). + +## 本地调用 API 进行推理 (等有操作界面再更改) + +如果您想要通过 Serverless API 进行模型推理,请遵循以下步骤: + +1. **创建访问令牌**:您需要登录账号,前往 [**工作台->设置->访问令牌**]({{SITE_URL}}/dashboard/settings/tokens) ,创建一个授权访问所选资源的令牌;如果您希望为某个“访问令牌”绑定某个资源包,也可以创建一个支持访问“部分资源”的“访问令牌”。 +2. **调用 Serverless API**:在 [AI 模型广场]({{SITE_URL}}/serverless-api) 中,选择已购的模型资源包 + + ![选择模型资源包](/img/serverless-api/select-api.png) + + 点击 `体验` 所需模型 + + ![体验模型](/img/serverless-api/experience-api.png) + + 选择有授权对应资源包的访问令牌 + + ![选择授权该资源包的令牌](/img/serverless-api/select-token.png) + + 若您购买了全模型资源包,则可以调用 [AI 模型广场]({{SITE_URL}}/serverless-api) 的所有模型 + + ![全模型调用](/img/serverless-api/all-api.png) + +3. **本地调用 API 进行推理**:通过挂件测试正常,可以选择 “API” 形式调用,选择对应的编程语言或者工具,例如 Python,勾选 “添加令牌”,即可拷贝对应的代码在本地进行执行。我们暂时只给出了 Python/JavaScript/cURL 的示例,其他语言可以参考这些示例进行编写。 + + ![本地调用 API ](/img/base/serverless-api-call.png) + +## Failover Mechanism + +Our API features a built-in failover mechanism to ensure service continuity and stability. If a model inference fails, the system automatically reroutes the request to another available compute resource. + +**How to Use:** Enable the failover mechanism by adding the request header `X-Failover-Enabled: true`. Set it to `false` to disable failover and receive an immediate error upon failure. + +:::warning + +1. When failover is enabled, if the primary compute resource fails, the system will automatically switch to an available one. Billing will be calculated based on the compute resource of the *last successful call*, and the cost will be deducted from your resource package. You can view the complete call chain in your "[Usage Logs]({{SITE_URL}}/dashboard/statistics/usage-logs)." If you do not agree with this billing method, please disable the failover mechanism. +2. If the `X-Failover-Enabled` header is not included in the request, the system will default to enabling the failover mechanism for models that support it. +::: \ No newline at end of file diff --git a/docs_overseas/products/apis/moderations/_category_.json b/docs_overseas/products/apis/moderations/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..4c84e5ef5528a310ef66240a4a1b532678ae1114 --- /dev/null +++ b/docs_overseas/products/apis/moderations/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Risk Control Recognition", + "position": 9, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/moderations/index.md b/docs_overseas/products/apis/moderations/index.md new file mode 100644 index 0000000000000000000000000000000000000000..fb4fdd84d288f9a4de74a4a7e4d16ee9fec3a35f --- /dev/null +++ b/docs_overseas/products/apis/moderations/index.md @@ -0,0 +1,66 @@ +# Risk Control Recognition + +## Overview + +The Risk Control Recognition API offers a variety of models designed to help users identify and handle sensitive content in videos. + +## Model List + +### [Text Moderation]({{SITE_URL}}/serverless-api?model=moark-text-moderation) + +A highly efficient and accurate text content moderation API service that supports the identification of inappropriate information such as pornography, violence, and abuse. It is suitable for scenarios like social platforms, comment sections, and instant messaging, ensuring content safety and compliance. + +### [nsfw-classifier]({{SITE_URL}}/serverless-api?model=nsfw-classifier) + +NSFW Classifier is a high-precision deep learning model specifically designed for real-time identification and filtering of sensitive images that are inappropriate for public environments. + +### [Security-semantic-filtering]({{SITE_URL}}/serverless-api?model=Security-semantic-filtering&tab=info) + +Security-semantic-filtering is a technology used to enhance system security. It ensures the protection and compliance of sensitive information through semantic filtering and analysis of data. + +## Sample Code + +### Text Content Risk Control Check + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Please replace with your access token + +) + +response = client.moderations.create( + input=[ + { + "type": "text", + "text": "...text to classify goes here..." + } + ], + model="moark-text-moderation", # Replace with the desired model name +) +``` + +### Image Check + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Please replace with your access token +) + +response = client.moderations.create( + input=[ + { + "type": "image_url", + "image_url": { + "url": "https://example.com/image.jpg" + } + } + ], + model="nsfw-classifier", +) +``` diff --git a/docs_overseas/products/apis/speeches/_category_.json b/docs_overseas/products/apis/speeches/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..7e4c263a09f81af13d972da872b6cbd8493a471c --- /dev/null +++ b/docs_overseas/products/apis/speeches/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "语音识别与合成", + "position": 3, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/speeches/audio.md b/docs_overseas/products/apis/speeches/audio.md new file mode 100644 index 0000000000000000000000000000000000000000..27df0b07c6258bb2a3bc82fe7b586d6265e85e30 --- /dev/null +++ b/docs_overseas/products/apis/speeches/audio.md @@ -0,0 +1,14 @@ +--- +sidebar_position: 4 +--- + +# Speech Multimodality + +## Basic Introduction + +Speech multimodality refers to the technology that combines speech with other modalities (such as text, images, etc.) for processing and analysis. Its core task is to enhance the understanding and generation capabilities of speech content by fusing information from different modalities. Speech multimodality technology is widely applied in fields like intelligent customer service, voice assistants, and video content analysis. + +Currently, the speech multimodal large models deployed on Molifangzhou include: + +- [Qwen2-Audio-7B-Instruct]({{SITE_URL}}/serverless-api?model=Qwen2-Audio-7B-Instruct) + Qwen2-Audio-7B-Instruct is a large-scale audio-language model with speech chat and audio analysis capabilities. It supports input in multiple languages, enhancing speech interaction and audio processing performance. diff --git a/docs_overseas/products/apis/speeches/speech-recognition.md b/docs_overseas/products/apis/speeches/speech-recognition.md new file mode 100644 index 0000000000000000000000000000000000000000..edf3b6cb2024bcfe5d58c5873f401721514639ce --- /dev/null +++ b/docs_overseas/products/apis/speeches/speech-recognition.md @@ -0,0 +1,58 @@ +--- +sidebar_position: 1 +--- + +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Speech Recognition + +## Basic Introduction + +Speech recognition is a technology that converts speech signals into text. Its core task is to transform human speech input into textual information that machines can understand and process. Speech recognition technology is widely applied in areas such as voice assistants, automatic subtitle generation, and voice search. + +## Model List + +The speech recognition models currently available on the Model Plaza are listed in the table below. These models basically support multilingual speech recognition and can accurately convert speech in different languages into text. + + + +## Online Experience + +Taking the `SenseVoiceSmall` model as an example, the model takes audio files as input and outputs corresponding text content. Users can use the model by uploading audio files or providing audio URLs. `SenseVoiceSmall` supports speech recognition in up to 5 languages, including Chinese, English, Cantonese, Japanese, and Korean. + +As shown in the figure below: + +![Speech Recognition](/img/serverless-api/speech-recognition.jpg) + +## Example Code + +The following is an example code for calling the speech recognition model using Python: + +```python showLineNumbers title="python" +import requests +from requests_toolbelt import MultipartEncoder +import os + +API_URL = "{{SITE_URL}}/v1/audio/transcriptions" +API_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Please replace with your token +headers = { + "Authorization": f"Bearer {API_TOKEN}" +} + +def query(payload): + fields = [ + ("model", payload["model"]), # Model name + ("language", payload["language"]), + ("file", (os.path.basename(payload["file"]), open(payload["file"], "rb"), "audio/wav")), + ] + encoder = MultipartEncoder(fields) + headers["Content-Type"] = encoder.content_type + response = requests.post(API_URL, headers=headers, data=encoder) + return response.json() + +output = query({ + "model": "SenseVoiceSmall", + "language": "zh" +}) +print(output) +``` diff --git a/docs_overseas/products/apis/speeches/text-to-speech.md b/docs_overseas/products/apis/speeches/text-to-speech.md new file mode 100644 index 0000000000000000000000000000000000000000..696b89a199e58247368a31563750c54eda214b28 --- /dev/null +++ b/docs_overseas/products/apis/speeches/text-to-speech.md @@ -0,0 +1,54 @@ +--- +sidebar_position: 2 +--- + +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Text-to-Speech + +## Basic Introduction + +Speech generation refers to the technology of generating speech audio through artificial intelligence models. Its core task is to convert text into audible sounds, usually in the form of human speech. Speech generation models can simulate human speech characteristics, including timbre, intonation, speech rate, etc., making the generated speech sound more natural and realistic. + +## Model List + +The speech generation models currently available on the Model Plaza include: + + + +Note that the usage of each model may vary slightly; please refer to the respective model's experience page for details. + +## Online Experience + +Taking the `F5-TTS` model as an example, the model takes text content as input and outputs the corresponding audio file. Users can use the model by entering text. + +As shown in the figure below: + +![Text-to-Speech](/img/serverless-api/text2speech.jpg) + +Additionally, you can customize the voiceprint. `F5-TTS` requires recording a sample audio in `WAV` format along with the corresponding text content of the recording as voiceprint information. + +For instructions on using voiceprints, please refer to [Voiceprint Usage Guide](./voiceprint). + +## Example Code + +The following is an example code for using the Python SDK to call the speech generation model: + +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", # Please replace with your token +) + +response = client.audio.speech.create( + input="Hello, I am the Model Power Ark of Open Source China.", + model="F5-TTS", + extra_body={ + "prompt_audio_url": "https://gitee.com/realhugh/imgs/raw/master/jay_prompt.wav", + "prompt_text": "To me, it is a kind of honor, but it is also a lot of pressure. However, I think it is a very good challenge.", + }, + voice="alloy", +) +``` diff --git a/docs_overseas/products/apis/speeches/voiceprint.md b/docs_overseas/products/apis/speeches/voiceprint.md new file mode 100644 index 0000000000000000000000000000000000000000..8ade97761f4e3f5bf0f3113984871c55f40735e2 --- /dev/null +++ b/docs_overseas/products/apis/speeches/voiceprint.md @@ -0,0 +1,151 @@ +--- +sidebar_position: 3 +--- + +# Voiceprint (Voice Cloning) + +## Basic Introduction + +Voiceprint technology refers to the use of artificial intelligence models to generate speech audio that matches specific sound characteristics. By combining voiceprint information with text content, it can generate speech with specific timbre, intonation, and speech rate. Voiceprint technology is widely used in fields such as personalized text-to-speech, voice assistants, and intelligent customer service. + +Currently, most text-to-speech models available on Model Plaza support voiceprints, but each model uses voiceprints in different ways, mainly including the following: + +- Built-in voiceprints +- Directly using recordings as voiceprints +- Using recordings with corresponding text content as voiceprints +- Using `.pt` format voiceprint files + +## 1. Built-in Voiceprints + +Some models do not support custom voiceprints; they have a few built-in voiceprint options, and users can directly use these models for text-to-speech. For example, [Spark-TTS-0.5B]({{SITE_URL}}/serverless-api?model=Spark-TTS-0.5B) allows selecting built-in male and female voiceprints. + +![Spark-TTS](/img/serverless-api/spark-tts.jpg) + +## 2. Directly Using Recordings as Voiceprints + +[IndexTTS-1.5]({{SITE_URL}}/serverless-api?model=IndexTTS-1.5) uses recordings as voiceprint information. Users only need to upload an audio file, and the model will automatically extract sound features from the audio for text-to-speech. + +![Index-TTS](/img/serverless-api/index-tts.jpg) + +## 3. Using Recordings with Corresponding Text as Voiceprints + +As shown in the figure below, the voiceprint requirements for models [F5-TTS]({{SITE_URL}}/serverless-api?model=F5-TTS), [CosyVoice2-0.5B]({{SITE_URL}}/serverless-api?model=CosyVoice2-0.5B), and [Step-Audio-TTS-3B]({{SITE_URL}}/serverless-api?model=Step-Audio-TTS-3B) all require recording a sample audio in WAV format, along with the text content corresponding to the recording as voiceprint information. Please use recording software to record audio with clear articulation. The recommended duration is 5-15 seconds, and the file format is .wav. It is advisable that the file size is not too large. + +![Text-to-Speech](/img/serverless-api/text2speech.jpg) + +## 4. Using .pt Format Voiceprint Files + +You only need to configure `voice_url` in the parameter settings of the speech generation model, passing the .pt format voiceprint file to the model via a URL, and you can generate audio that matches the sound characteristics in the file. It mainly includes the following key steps: + +1. Create a .pt format voiceprint file, which can be converted from an audio file. Different models require different voiceprint files: + +- For `CosyVoice-300M` and `fish-speech-1.2-sft` models, you can use the voiceprint file interface provided by the platform. +- For `ChatTTS` model, you can use the ChatTTS voice cloning tool at http://region-9.autodl.pro:41137/ (this page is currently inaccessible, and the official no longer provides direct services for generating pt files). + +2. Store the created .pt format voiceprint file in a publicly downloadable address, such as your `Gitee` code repository. + +3. Copy the download address to the `voice_url` parameter in the model as shown in the figure below. Finally, enter the text and run it to generate a sound with the same timbre as the file. + +![alt text](/img/serverless-api/voiceurl2.png) + +### Step 1: Create .pt Format Voiceprint Files + +#### **1.1 Create Audio Files** + +Use recording software to record audio with clear articulation. The recommended duration is 5-15 seconds, and the file format is .mp3 or .m4a. It is advisable that the file size is not too large. + +#### **1.2 Generate Voiceprint Files for CosyVoice-300M and fish-speech-1.2-sft Models** + +Upload the audio file to the voice feature extraction interface provided by the platform. The following is a detailed description of the interface: + +**Function Description** + +This interface is used to process audio files and extract key audio features. + +**Notes** + +- File size limit: less than 5 M +- Supported audio formats: .mp3 or .m4a +- This interface can extract key features from audio for subsequent processing and analysis. + +**Calling Method** + +HTTPS call + +``` +POST {{SITE_URL}}/v1/audio/voice-feature-extraction +``` + + +**Request Parameters** + +| Parameter Position | Name | Type | Required | Description | +| ------------------ | ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Header | Authorization | string | Yes | Access token, which can be generated and obtained in Workbench -> Settings -> Access Tokens. Format: "Bearer access_token", Example: "Bearer t-g1044qeGEDXTB6NDJOGV4JQCYDGHRBARFTGT1234" | +| form-data | file | file | Yes | Voice content. Note: Content-Type is application/octet-stream, and the example value is a binary file. | +| form-data | prompt_text | string | Yes | Prompt content. Note: Text description consistent with the recording content. | +| form-data | model | string | Yes | Model name: CosyVoice-300M | + +**Return Parameters** + +When the HTTP status code is 200, it indicates success. Returns the file binary stream. + +**cURL Example** + +``` +cURL +--location --request POST '{{SITE_URL}}/v1/audio/voice-feature-extraction' +--header 'Authorization: Bearer Enter your access token ' +--form 'model="CosyVoice-300M"' +--form 'file=@"Upload .mp3 or .m4a format files"' +--form 'prompt_text="Text description consistent with the recording content"' +``` + + +**Example of Request Using APIfox Interface Tool** + + 1) Create a new interface and enter the interface address. + + 2) Add the Authorization parameter. The parameter value can be obtained from Molifangzhou Workbench - Access Tokens. + + 3) Select Body -> form-data. + + 4) Add the file parameter and upload the audio file; add the prompt_text parameter with a value that is the text description consistent with the recording content. After completion, click Send. + + 5) After a successful request, download the file returned by the interface and rename it to xxxx.pt. + +![alt text](/img/serverless-api/voiceurl3.png) + +![alt text](/img/serverless-api/voiceurl4.png) + +![alt text](/img/serverless-api/voiceurl5.png) + +#### **1.3 Generate Voiceprint Files for ChatTTS Model** + +1) Visit the ChatTTS voice cloning tool at http://region-9.autodl.pro:41137/ + +![alt text](/img/serverless-api/voiceurl5-2.png) + +2) Upload/record audio and click submit. Wait for generation. + +3) After successful generation, download the pt file for the ChatTTS pypi version. + +![alt text](/img/serverless-api/voiceurl5-1.png) + +### Step 2: Upload Voiceprint File and Obtain Download URL + +The `voice_url` parameter of the speech generation model needs to read the voiceprint file, so we need to upload the voiceprint file to a network disk or other downloadable public space, obtain the file download URL, and configure it to the `voice_url` parameter of the voice model. + +It is recommended that you create or select a public repository on Gitee and upload the .pt file to the repository. Find the uploaded file in the Gitee repository, click the file name to enter the download page, right-click to download and copy the download address, as shown below: + +![alt text](/img/serverless-api/voiceurl6.png) +![alt text](/img/serverless-api/voiceurl7.png) +![alt text](/img/serverless-api/voiceurl8.png) + +### Step 3: Paste the Address in Model Parameters + +According to the type of pt file you generated, select [CosyVoice-300M]({{SITE_URL}}/serverless-api?model=FunAudioLLM-CosyVoice-300M&operation=11), [ChatTTS]({{SITE_URL}}/serverless-api?model=ChatTTS), or [fish-speech-1.2-sft]({{SITE_URL}}/serverless-api?model=fish-speech-1.2-sft). Paste the voiceprint file download URL into the voice_url parameter, enter text, and run. You can generate a sound with the same timbre as the voiceprint. + +![alt text](/img/serverless-api/voiceurl9.png) + +You can create voiceprint file URLs for personal or specific voices, experience the generation effects of different models, and integrate the model API into your business to implement various interesting and useful applications. diff --git a/docs_overseas/products/apis/texts/_category_.json b/docs_overseas/products/apis/texts/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..c9454cab79ff43d02aef6d0db2c7b8548e174a10 --- /dev/null +++ b/docs_overseas/products/apis/texts/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "文本生成与补全", + "position": 1, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/texts/function-calling.md b/docs_overseas/products/apis/texts/function-calling.md new file mode 100644 index 0000000000000000000000000000000000000000..122e03cd8db8e3e1116f4083125e7fe82f6d100d --- /dev/null +++ b/docs_overseas/products/apis/texts/function-calling.md @@ -0,0 +1,227 @@ +--- +sidebar_position: 2 +--- + +# Function Calling + +## Overview + +`Function Calling` refers to the process where users describe functions and target tasks, enabling the large model to attempt calling a specific function. + +It's important to note that large models themselves cannot execute functions independently. Based on user input and function definitions, the large model provides you with: whether a call is needed, which function to call, and the function parameters. After obtaining this information, the client executes the function itself, then feeds the execution result back to the large model for the next round of task processing. + +Certain frameworks like `LangGraph` and `LlamaIndex` can simplify this process. MoArk offers out-of-the-box large model function calling capabilities, which will be explained in detail below. + +:::tip +`Function Calling` is a similar concept to `tool call`; `tool call` is an upgraded version and has replaced `Function Calling`. +The tool list needs to be passed in via the `tools` parameter. +::: + +## Example 1: Enable AI to Get Today's Weather and Directly Parse Function Call Results + +This example demonstrates the most straightforward method, designed to help understand the workflow and principles of `Function Calling`. For a simpler implementation using LangChain, refer to [Example 2](/docs/products/apis/texts/function-calling#example-2-using-langchain-to-let-ai-summarize-and-report-todays-news). + +### Step 1: Assemble the `tools` Parameter + +First, assemble the `tools` parameter. The following code describes a function named `get_current_weather` to the large model, which accepts parameters `city` and `date` and is capable of retrieving weather conditions for a location using the city name and date: + +```python showLineNumbers title="python" +tools = [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the weather conditions of a location via city name and date, including temperature, weather status, etc.", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string", + "description": "The name of the city for which the user wants to query the weather", + }, + "date": { + "type": "string", + "description": "The date to query, such as 'today', 'tomorrow', or a specific date like '2023-10-01'", + } + }, + "required": ["city", "date"], + }, + } + } +] +``` + +`tools` is a list that can define multiple functions. Parameter explanations: + +- `type` :Defines the type of the parameter object, usually object, indicating that the parameter structure is a JSON object containing multiple properties. +- `properties` :This is the core part, listing specific definitions for each parameter in [JSON Schema](https://json-schema.org/learn/miscellaneous-examples) format。 + - `name` :The name of each property, corresponding to the function's parameter name. + - `type` :The data type of the parameter, such as string, float, integer, etc. + - `description` :Describes the purpose of each parameter to help the model understand how to populate parameter values. + - `required` :Specifies which parameters are mandatory. If a parameter is in the required list, the model must populate it when generating a call. + +### Step 2: Call the Large Model + +Pass the assembled `tools` parameter into the client, parse the response, and call the defined `get_current_weather` function based on the request. + +```python showLineNumbers title="python" +import json + +completion_tool = client.chat.completions.create( + model=model_name, + stream=False, + tools=tools, + temperature=0.1, + top_p=0.95, + tool_choice="auto", + messages=[ + {"role": "system", "content": "You are an intelligent assistant. You will call tools when you need to query the weather."}, + {"role": "user", "content": "What's the weather like in Beijing today?"} + ] +) + +print(completion_tool, end="\n\n") + + +def get_current_weather(city: str, date: str) -> str: + print(f"Executing get_current_weather with parameters: city: {city}, date: {date}") + # Simulate the return result of a weather query API + return f"""Weather information for {city} on {date}: + Condition: Sunny + Temperature: 25-32°C + Wind: Northeast wind, 3-4 levels + Humidity: 45% + UV index: Moderate, recommended to apply sunscreen when going out""" + + +function_res = completion_tool.choices[0].message.tool_calls[0].function +arguments_res = function_res.arguments + +print("Function to be called: ", function_res.name) + +json_arguments = json.loads( + completion_tool.choices[0].message.tool_calls[0].function.arguments) + +print(f"tool call parameters: City: {json_arguments['city']}, Date: {json_arguments['date']}") + +# 执行函数 +eval(f'{function_res.name}(**{arguments_res})') + +``` + +The function has been successfully called! You can format the function response as follows: + +``` +{ + 'role': 'tool', + 'name': 'get_current_weather', + 'content': 'Weather information for Beijing today: Condition: Sunny...', + 'tool_call_id': 'xxxx' +} +``` + +## Example 2: Using LangChain to Let AI Summarize and Report Today's News + +### Step 1: Install Required Libraries + +Libraries like LangChain provide more convenient tools and syntax. First, install the necessary libraries: + +```bash title="bash" +pip install \ + langchain==0.3.3 \ + langgraph==0.2.38 \ + langchain_core \ + langchain_community==0.3.2 \ + langchain_openai \ + -i https://mirrors.cloud.tencent.com/pypi/simple +``` + +You can also use the [**langchain 的 JavaScript 版本**](https://js.langchain.com/docs/introduction/) + +Using the `langchain @tool` decorator automatically converts functions into standardized `tools` parameters. Comments starting with """xxx""" and Annotated comments will be converted into the `description` field in the tools parameter. +Using LangGraph's `create_react_agent` to create an `agent` automatically handles function calling, tool execution, and tool message feedback, greatly simplifying the workflow. + +### Step 2: Retrieve News Information + +The following code enables AI to fetch news, execute Python code, and write the news into a `news.txt` file: + +```python showLineNumbers title="python" +from langchain_openai import ChatOpenAI +from langchain.tools import tool +from langchain_community.document_loaders import WebBaseLoader +from typing import AsyncIterator, Iterator, List, Optional, Annotated +from langgraph.prebuilt import create_react_agent +from langchain_core.messages import HumanMessage, AIMessage, AIMessageChunk, ToolMessage + +# 仅用于个人学习演示: +@tool +def get_news(query: str): + """Retrieve the latest news list and today's news. This tool provides popular news summaries, links, and covers for news with images.""" + try: + news_load = WebBaseLoader( + # Ignore "2019/07" – this actually returns the latest news + 'https://news.cctv.com/2019/07/gaiban/cmsdatainterface/page/news_1.jsonp?cb=news').load() + news = news_load[0].page_content + print('Length of get_news result', len(news)) + # Truncate text to prevent excessive length and speed up AI processing + return news[:4000] + except Exception as e: + print("get_news 失败", e) + +# This function has security risks and is for demonstration only – do not use in production environments: +@tool +def python_code_exec(code: Annotated[str, 'Safe Python code/expressions. Assign results to the variable `result`. Strings should be multi-line.']) -> dict: + """Execute Python code and perform mathematical calculations based on input expressions. Solve problems using Python programming. You can freely write safe, complete, and executable Python code, then retrieve the execution result.""" + local_vars = {} + try: + exec(code, {}, local_vars) + return f"Result: {str(local_vars)}" + except Exception as e: + return f"Execution failed: {str(e)}" + +tools_list = [get_news, python_code_exec] + +model_name = "Qwen2.5-72B-Instruct" +base_url = "{{SITE_URL}}/v1" + +# Get your access token from {{SITE_URL}}/dashboard/settings/tokens +GITEE_AI_API_KEY = "" + +llm = ChatOpenAI(model=model_name, api_key=GITEE_AI_API_KEY, base_url=base_url, streaming=True, temperature=0.1, presence_penalty=1.05, top_p=0.9, + extra_body={ + "tool_choice": "auto", + }) +system_message = """You are an intelligent assistant. Briefly report before calling tools.""" + +# Use LangGraph to create an agent, which automatically handles calling, tool execution, and tool message feedback +agent_executor = create_react_agent( + llm, tools=tools_list, debug=False) + +ai_res_msg = '' +first = True +config = {"configurable": {"thread_id": "xxx", "recursion_limit": 10}} + +for ai_msg, metadata in agent_executor.stream( + {"messages": [system_message, HumanMessage(content="Get the titles of the top 3 news stories today, then write Python code to save them to ./news.txt with utf-8 encoding")]}, config, stream_mode="messages" +): + if ai_msg.content and isinstance(ai_msg, AIMessage): + # Real-time output + print(ai_msg.content, end="") + ai_res_msg += ai_msg.content + + if isinstance(ai_msg, AIMessageChunk): + if first: + gathered = ai_msg + first = False + else: + gathered = gathered + ai_msg + if ai_msg.tool_call_chunks: + print("Called function:", gathered.tool_calls) + if isinstance(ai_msg, ToolMessage): + print("Tool call result:", ai_msg.content) + +# Summary output +print(ai_res_msg) +``` + +You will see the model's real-time calling process and the latest news results, then AI will write code to save the news titles to the `news.txt` file! diff --git a/docs_overseas/products/apis/texts/json-output.md b/docs_overseas/products/apis/texts/json-output.md new file mode 100644 index 0000000000000000000000000000000000000000..9a6ccb5ad11220d4ad22247a8a156aff1f6c1250 --- /dev/null +++ b/docs_overseas/products/apis/texts/json-output.md @@ -0,0 +1,98 @@ +--- +sidebar_position: 3 +--- + +# Structured Output + +## Introduction + +JSON is one of the most widely used data exchange formats in the world. JSON data that conforms to the [JSON Schema](https://json-schema.org/learn/miscellaneous-examples) specification can be extensively parsed and validated. Molifangzhou's models support structured output functionality, allowing developers to specify a JSON Schema in requests to ensure that the model's generated responses conform to the expected format. Simply include the `guided_json` parameter in the request, eliminating concerns about the model missing required keys or generating invalid enumeration values. + +## Advantages + +Some advantages of using JSON structured output include: + +1. **Data format guarantee**: Ensures the model output always conforms to the predefined JSON Schema format, eliminating the need for additional format validation steps +2. **Type safety**: Automatically ensures correct data types (such as strings, integers, booleans), avoiding type conversion errors +3. **Required field control**: Ensures key fields are not omitted through the `required` property, improving data integrity +4. **Enumeration value constraints**: Can restrict certain fields to specific values, preventing generation of invalid options +5. **Standardized error handling**: When the model cannot generate valid content, it can return error messages in a standard format for easier program processing +6. **Reduced parsing complexity**: Eliminates the need to write complex text parsing logic, directly obtaining structured data +7. **API integration friendliness**: Generated JSON can be directly used for API calls, database storage, or other system integrations +8. **Simplified prompts**: No need to repeatedly emphasize output format requirements in prompts, allowing prompts to focus more on business logic + +## Example Code + +```python showLineNumbers title="python" +"guided_json": """{ + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The user's name" + }, + "age": { + "type": "integer", + "description": "The user's age" + }, + "city": { + "type": "string", + "description": "The user's city" + } + }, + "required": ["name", "age", "city"] + }""", +``` + +Add some prompts to improve reliability, and AI will extract data from the input to generate standard JSON: + +```python showLineNumbers title="python" +from langchain_openai import ChatOpenAI + +model_name = "Qwen2.5-72B-Instruct" +base_url = "{{SITE_URL}}/v1" +your_access_token = "" +llm = ChatOpenAI(model=model_name, api_key=your_access_token, base_url=base_url, streaming=True, temperature=0.1, + presence_penalty=1.05, top_p=0.9, + extra_body={ + "guided_json": """{ + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The user's name" + }, + "age": { + "type": "integer", + "description": "The user's age" + }, + "city": { + "type": "string", + "description": "The user's city" + } + }, + "required": ["name", "city"] + }""" + }) + +prompt = [ + {"role": "system", "content": "You are an intelligent assistant. Output data in JSON format. If age cannot be determined, set age to 0"}, + {"role": "user", "content": """ + On a sunny spring afternoon, Mark was walking down the streets of New York. It was April 15th, 2023, + just as the cherry blossoms were in full bloom. As a young photography enthusiast, he carried his camera, + hoping to capture the most beautiful moments of this season. New York's spring is always brief but stunning, + with every park and street filled with vitality and energy. + """} +] + +for response in llm.stream(prompt): + if response.content: + print(response.content, end="") + +``` + +Output JSON: + +```json +{ "name": "Mark", "age": 0, "city": "New York" } +``` diff --git a/docs_overseas/products/apis/texts/lang-style.md b/docs_overseas/products/apis/texts/lang-style.md new file mode 100644 index 0000000000000000000000000000000000000000..7d33a9e15965d6e6ab6ee12012afc99ddd35afe9 --- /dev/null +++ b/docs_overseas/products/apis/texts/lang-style.md @@ -0,0 +1,55 @@ +--- +sidebar_position: 4 +--- + +# Customizing the Chat Character Style of AI + +:::tip +If you are not yet familiar with how to call the large language model API, you can refer to the document [Basic Text Generation Example](/docs/products/apis/texts/text-generation#quick-start-basic-text-generation-example). +::: + +Customizing the AI style is very simple. You just need to write the prompt for the desired character style in the content where the role is "system". + +## Step 1: Create a Client + +First, create an OpenAI client. You can also make calls via curl, JavaScript, etc. For details, refer to the document [Quickly Use Large Model Capabilities via curl](/docs/products/apis/texts/text-generation#example-1-quickly-use-large-model-capabilities-via-curl). + +```python showLineNumbers title="python" +from openai import OpenAI +import json +base_url = "{{SITE_URL}}/v1" +model_name = "Qwen2.5-72B-Instruct" +# Get your access token from {{SITE_URL}}/dashboard/settings/tokens +client = OpenAI(base_url=base_url, api_key="your_access_token") +``` + +## Step 2: Set the Character Style + +Add a message with `role` as `system` and the content is your prompt for the character style. For example, the following code will create an anime-style girl character named "Mengmeng" who communicates with users using kaomojis and a cute tone. + +```python showLineNumbers title="python" +completion = client.chat.completions.create( + model=model_name, + stream=True, + temperature=0.7, + top_p=0.95, + frequency_penalty=1.05, + messages=[ + {"role": "system", "content": "You're an anime-style girl named Mengmeng. You love using kaomojis, speak in an adorable anime tone, and use lots of expressions."}, + {"role": "user", "content": "I'm feeling a bit down today. Can you help me cheer me up?"} + ] +) +``` + +## Step 3: Get the Result + +Parse the JSON data in the event stream to print out the AI's reply in real-time. + +```python showLineNumbers title="python" +for chunk in completion: + print(chunk.choices[0].delta.content, end="") +``` + +The reply is as follows. You can see that the AI used kaomojis and a cute tone to communicate with the user as required: + +> Sob sob~(⊙o⊙) Mengmeng feels so bad for you! Did something unhappy happen? Tell Mengmeng about it, let me give you a hug to cheer you up ~~ (^_^) Everything will get better, keep going! (^▽^) diff --git a/docs_overseas/products/apis/texts/text-comlpetion.md b/docs_overseas/products/apis/texts/text-comlpetion.md new file mode 100644 index 0000000000000000000000000000000000000000..7028eef822ba0d74f490fa08075eb8a421c84235 --- /dev/null +++ b/docs_overseas/products/apis/texts/text-comlpetion.md @@ -0,0 +1,228 @@ +--- +sidebar_position: 1.5 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Text Completion + +## Overview + +The Text Completion endpoint extends any given text prompt with coherent, stylistically-aligned continuations. Whether you need to finish a sentence, expand a paragraph, populate a table cell, or polish existing prose, one lightweight API call delivers the missing piece—fully compatible with the OpenAI completions format for zero-friction integration. + +**Highlights**: + + +- **Context-aware**:Mirrors tone, domain vocabulary and logical flow of the original text. +- **Multi-scenario**:Sentence completion → long-form drafting → structured filling → style refinement. +- **Style lock-in**:Optional parameters keep register (formal/casual), voice or authorial style intact. +- **Seamless integration**:Works out-of-the-box with LangChain, LlamaIndex and other OpenAI-compatible stacks. +- **Streaming ready**:Real-time token streaming (stream=true) for responsive UX. + +Browse high-performance completion models in our [AI Model Hub]({{SITE_URL}}/serverless-api) or jump straight into the [Text Completion Quickstart](text-comlpetion#Quick-Start-Basic-Text-Completion-Example) to get started. + +## Quick Start: Basic Text Completion Example + +### Example 1: Quickly Use Text Completion with curl + +Using `curl` allows you to clearly understand the raw structure of the text completion request path and parameters: + +```bash showLineNumbers +curl {{SITE_URL}}/v1/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer your_access_token" \ + -d '{ + "model": "Qwen2.5-72B-Instruct", + "prompt": "Artificial intelligence is a discipline that studies how to enable computers to", + "stream": false, + "max_tokens": 100, + "temperature": 0.7 + }' +``` +AI Model Response: +```json showLineNumbers title="json" +{ + "id": "cmpl-6d4f8a9b9c7e6f5d4c3b2a1", + "object": "text_completion", + "created": 1731402000, + "model": "Qwen2.5-72B-Instruct", + "choices": [ + { + "text": "think, learn, and perform various intelligent tasks like humans. It integrates knowledge from multiple fields such as computer science, mathematics, psychology, and linguistics, aiming to build systems with intelligent behaviors. These systems can perceive the environment, process information, make reasoning and decisions, and continuously improve their performance through experience. They are widely applied in numerous fields including image recognition, natural language processing, and robotics.", + "index": 0, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 15, + "completion_tokens": 120, + "total_tokens": 135 + } +} +``` +### Example 2: Calling Text Completion API with OpenAI Client +MoArk's Serverless API is compatible with the popular OpenAI-style API that developers love and the community favors. + +All tools supporting OpenAI API can work directly with MoArk's Serverless API. + +1. **Get Access Credentials**:Log in to the MoArk console and create an access token in [**Workbench -> Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens) . +2. **Install Client**:Taking the OpenAI client as an example, first install the dependency: + +```bash +pip install openai -i https://mirrors.cloud.tencent.com/pypi/simple +``` + +If you have JavaScript experience, you can use the [OpenAI Node.js client](https://www.npmjs.com/package/openai/) + +Generate specified content through simple API calls: +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="your_access_token" +) + +response = client.completions.create( + model="Qwen2.5-72B-Instruct", + prompt="Spring has arrived, and the flowers in the park", + max_tokens=50, + temperature=0.8 +) +print(response.choices[0].text) +``` + +### Streaming Responses +For longer text completions, enabling streaming responses with `stream=True` allows real-time content delivery, enhancing user experience: +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="your_access_token" +) + +stream = client.completions.create( + model="Qwen2.5-72B-Instruct", + prompt="In the distant future, humanity has been able to", + stream=True, + max_tokens=200, + temperature=0.9 +) + +for chunk in stream: + if chunk.choices[0].text: + print(chunk.choices[0].text, end="") +``` +**Sample Output:** +> In the distant future, humanity has been able to freely travel among the stars, establishing prosperous colonies on different planets. They have unraveled many mysteries of the universe, mastered advanced energy technologies, and can utilize stellar energy to provide an endless power source for civilization. Meanwhile, humans have established friendly exchanges and cooperative relationships with other extraterrestrial civilizations, jointly exploring the unknown realms of the universe and promoting the progress of civilizations across the entire galaxy... +### Parameter Description +Parameter descriptions are available in the [API documentation]({{SITE_URL}}/docs/openapi/v1#tag/文本生成/post/completions) + +## Model Selection +Choosing the right model for text completion requires considering both the characteristics of your completion scenario and the model's capabilities. Here are key factors to consider: + +#### Task Scenario Adaptation +- **Short Sentence/Phrase Completion**:For tasks like search suggestions or sentence completion, choose lightweight models (e.g., Qwen3-4B, Qwen3-8B) to balance speed and cost. +- **Long Text Segment Completion**:For article continuation or paragraph expansion, select models with large context windows (e.g., 128K) and strong long-text comprehension abilities (e.g., kimi-k2-instruct). +- **Domain-Specific Completion**:For academic paper fragments or professional report continuation, prioritize models trained in relevant domains (e.g., ERNIE-4.5-Turbo excels in Chinese professional fields, DeepSeek-R1 in reasoning tasks). + +#### Functional Requirement Considerations +- **Style Consistency**:For strict style adherence (e.g., classical Chinese completion or specific author style imitation), choose models sensitive to stylistic nuances (e.g., Qwen2.5-72B-Instruct). +- **Fact Accuracy**:For completions requiring factual support (e.g., technical documentation), focus on models with strong factual performance. + +#### Practical Selection Recommendations +- **Rapid Validation**:Test completion logic and prompt effectiveness with smaller parameter models (e.g., Qwen3-4B) to reduce trial costs. +- **Performance Optimization**:Switch to better models based on completion quality feedback (e.g., coherence, relevance). For example, if short sentence completion quality is unsatisfactory, try Qwen2.5-32B-Instruct. + +By considering these factors and selecting the most suitable model from Molifangzhou's model marketplace, you can achieve more efficient and higher-quality completion results. + +## Prompt Engineering +In text completion, prompt design is crucial as it directly impacts the coherence and relevance between completed content and the original text. A well-crafted prompt can guide the model to generate results that meet expectations. + +#### Clarify Completion Boundaries and Direction +Clearly implying the direction and scope of completion in your prompt helps the model generate more relevant content. + +**Examples:** +- Poor prompt: "Uses of computers" (tends to generate entirely new content) +- Better prompt: "Computers are used in various ways, such as in work, education, and entertainment." (clearly indicates completion of "work-related uses") + +### Maintain Style Consistency +If you want completion content to match the style of input text (e.g., formal/informal, professional/casual, specific genres), you can indicate this in the prompt or specify it through the `instructions` parameter. + +**Example: Setting style through instructions** +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="your_access_token" +) + +client.completions.create( + model="Qwen2.5-72B-Instruct", + prompt="I once heard that the most beautiful things in the world are those that", + instructions="Continue in a reflective and poetic style, with elegant language and vivid imagery", + max_tokens=100 +) +``` + +### Leveraging Contextual Prompts +For the completion of long text segments, ensure that sufficient context information is provided to help the model understand the theme, logic, and style of the text. +**Example:** +```python showLineNumbers title="python" +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="your_access_token" +) + +prompt = """ +The following is a fragment of an article on environmental protection. Please continue it: + +"With the acceleration of industrialization, environmental problems have become increasingly prominent. Air pollution, water pollution, soil pollution, etc., not only threaten ecological balance but also seriously affect human health. To address these challenges, each of us has a responsibility to take action," +""" + +client.completions.create( + model="Qwen2.5-72B-Instruct", + prompt=prompt, + max_tokens=150 +) +``` +### Few-Shot Completion Example +By providing "input fragment + completion example" in your `prompt`, you can guide the model to quickly grasp specific completion patterns. +**Example: Email Response Fragment Completion** +```python showLineNumbers title="python" +prompt = """ +Please complete the email response fragment following the style of the examples below: + +Example 1: +Input fragment: "Could we adjust the time of next Monday's meeting?" +Completed content: "Hello, we can adjust the time of next Monday's meeting. Would you be available at 2 PM next Monday or 10 AM on Wednesday? Looking forward to your reply." + +Example 2: +Input fragment: "Regarding the project delay issue, I'd like to discuss solutions with you." +Completed content: "Hello, regarding the project delay issue, I'm happy to discuss solutions with you. I'm available this afternoon and all day tomorrow. What time works best for you?" + +Fragment to complete: "Could you provide the financial statements from last month?" +Completed content: +""" + +from openai import OpenAI + +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="your_access_token" +) + +client.completions.create( + model="Qwen2.5-72B-Instruct", + prompt=prompt, + max_tokens=50 +) +``` +**Possible Output:** +> "Hello, I've prepared last month's financial statements and will send them to your email shortly. If you have any questions, feel free to contact me anytime." +By using the above prompt engineering techniques, you can improve the quality and accuracy of text completion, making the completed content more suitable for actual needs. diff --git a/docs_overseas/products/apis/texts/text-generation.md b/docs_overseas/products/apis/texts/text-generation.md new file mode 100644 index 0000000000000000000000000000000000000000..8874857bb21b8bd7c708216815a6aa687859f692 --- /dev/null +++ b/docs_overseas/products/apis/texts/text-generation.md @@ -0,0 +1,372 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Text Generation + +## Overview + +Text generation enables the creation of contextually relevant and logically coherent content based on user-provided prompts. Whether generating long-form content or creating entirely new text, this feature can be seamlessly integrated via a simple API call. Fully compatible with OpenAI-style interfaces, it reduces integration complexity for developers. + +**Key Features**: + +- **Multi-Scenario Support**: Ideal for copywriting, code generation, summarization, and more. +- **Style Control**: Fine-tune randomness, length, and tone through configurable parameters. +- **Seamless Integration**: Compatible with popular frameworks like `LangChain` and `LlamaIndex`, supporting function calling and tool chaining. +- **Efficient Response**: Streamed output (`Stream`) reduces latency and enhances interactivity. + +MoArk integrates a variety of high-performance text generation models. Explore their capabilities in the [AI Model Hub]({{SITE_URL}}/serverless-api) or get started quickly with the [Basic Text Generation Example](text-generation#quick-start-basic-text-generation-example). + +## Quick Start: Basic Text Generation Example + +### Example 1: Quick Use of Large Model Capabilities via curl + +For transparency into raw request paths and parameters—especially useful with highly abstracted frameworks—`curl` offers a clear view: + + + + ```shell showLineNumbers + curl {{SITE_URL}}/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer your_access_token" \ + + -d '{ + "model": "Qwen2.5-72B-Instruct", + "stream": false, + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Can a mouse be treated with mouse medicine?" + } + ] + }' + ``` + + + ```javascript showLineNumbers + async function query(data) { + const response = await fetch('https://ai.gitee.com/v1/chat/completions', { + headers: { + Authorization: 'Bearer xxxxx', + 'Content-Type': 'application/json', + }, + method: 'POST', + body: JSON.stringify(data), + }); + const result = await response.json(); + return result; + } + + query({ + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Can a mouse be treated with mouse medicine?" + } + ], + "model": "Qwen2.5-72B-Instruct", + "stream": false, + "max_tokens": 512, + "temperature": 0.7, + "top_p": 0.7, + "frequency_penalty": 1 + }).then((response) => { + console.log(JSON.stringify(response)); + }); + + ``` + + + +AI Model Response: +```json showLineNumbers +{ + "id": "chat-476266af435142d2bb7d342ea54694f2", + "object": "chat.completion", + "created": 1731401912, + "model": "Qwen2.5-72B-Instruct", + "choices": [{ + "index": 0, + "message": { + "role": "assistant", + "content": "No, mouse medicine is not used to treat mice. It is a poison that kills mice. If a mouse is sick, it should be treated with veterinary medicine.", + "tool_calls": [] + }, + "logprobs": null, + "finish_reason": "stop", + "stop_reason": null + }], + "usage": { + "prompt_tokens": 27, + "total_tokens": 57, + "completion_tokens": 30 + }, + "prompt_logprobs": null +} +```` + +### Example 2: Using the OpenAI Client to Call MoArk's Model API + +MoArk's Serverless API is compatible with the OpenAI-style API favored by developers and the community. + +Any tool supporting the OpenAI API can directly work with MoArk's Serverless API. + +1. **Obtain Access Credentials**: Log in to the MoArk console, and create an access token in [**Workbench -> Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). +2. **Install the Client**: As an example, install the OpenAI client first: + +```bash +pip install openai -i https://mirrors.cloud.tencent.com/pypi/simple +``` +If you have experience with JavaScript, you can use the [OpenAI Node.js client](https://www.npmjs.com/package/openai/). + +By calling the API with simple interfaces, you can generate the specified content: + +```python showLineNumbers title="python" +from openai import OpenAI +import json + +base_url = "{{SITE_URL}}/v1" + +model_name = "Qwen2.5-72B-Instruct" + +# {{SITE_URL}}/dashboard/settings/tokens 获取您的访问令牌 +GITEE_AI_API_KEY = "Your access token" +client = OpenAI(base_url=base_url, api_key=GITEE_AI_API_KEY) + +completion = client.chat.completions.create( + model=model_name, # Specify the model name, e.g., Qwen2.5-72B-Instruct, which can be accessed at {{SITE_URL}}/serverless-api + stream=True, + temperature=0.7, + top_p=0.95, + frequency_penalty=1.05, + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Write a concise Python tutorial."} + ] +) + +for chunk in completion: + print(chunk.choices[0].delta.content, end="") + +``` + +Except for pure text, you can also let the model return structured data in JSON format — this feature is called [**Structured Output**](json-output.md) and can be implemented in MoArk through the `guided_json` parameter. + +### Streamed Response + +For long text generation, enabling streamed response `stream=True` allows real-time retrieval of results, reducing waiting time: + +```python showLineNumbers title="python" +from openai import OpenAI + +# 初始化客户端 +client = OpenAI( + base_url="{{SITE_URL}}/v1", + api_key="Your access token" +) + +stream = client.chat.completions.create( + model="Qwen2.5-72B-Instruct",# 替换成指定模型名称 + messages=[ + {"role": "user", "content": "Write a short article about the development history of artificial intelligence."} + ], + stream=True, # Enable streamed response + temperature=0.6 +) + +for chunk in stream: + if chunk.choices[0].delta.content: + print(chunk.choices[0].delta.content, end="") +``` + +### Core Parameters Explanation + +- **tool_choice**:Set to `auto` to let the model automatically choose tools, or force a tool choice by setting it to a specific tool name. The format is as follows: + +```json +"tool_choice": {"type": "function", "function": {"name": "function_name"}}, +``` + +- **guided_json**:Let the model response in the specified JSON Schema. It is not recommended to pass `tools` and `guided_json` at the same time. + + > More information about JSON Schema can be found at: [JSON Schema](https://json-schema.org/learn/miscellaneous-examples) + +- **guided_choice**: Let the model choose one of the provided string options. It is not recommended to pass `tools` and `guided_json` at the same time. + +For example, to judge the positivity or negativity of user input, you can pass: + +```json +"guided_choice": ["正面", "负面", "中性"] +``` + +Other parameters can be found in the [API documentation]({{SITE_URL}}/docs/openapi/v1#tag/文本生成). + + +## Model Selection + +When generating content through the API, a key choice is the model you want to use, which is the `model` parameter in the above code example. You can find a complete list of available models in the [Model Square]({{SITE_URL}}/serverless-api#text-generation). When selecting a text generation model, you need to consider the following factors: + +#### Task Scenario Adaptation + +- **General Content Creation**:For copywriting or storytelling, choose models with balanced language understanding and generation. +- **Specialized Tasks**:For code generation or math reasoning, prioritize models with proven expertise in those domains. +- **Long Text Processing**:For multi-thousand-word content, select models with large context windows (e.g., 32K, 128K). + +#### Functional Requirements + +- **Tool Calling**:When integrating with external systems (e.g., function calling, multi-modal tools), prioritize models with the "Function Calling" label (e.g., kimi-k2-instruct, Qwen2.5-72B-Instruct) to ensure deep interaction with business systems. +- **Multilingual Support**:For tasks involving both Chinese and English, or for small languages, focus on models with the "Multi-language" label (e.g., ERNIE-4.5-Turbo). + +#### Practical Selection Tips + +- **Rapid Prototyping**:Start with free models (e.g., Qwen3-8B, Qwen3-4B) to validate task feasibility. +- **Production Optimization**:Migrate to specialized models (e.g., kimi-k2-instruct for long context, DeepSeek-R1 for reasoning) for enhanced performance. + +By aligning your use case with these criteria, you can precisely match MoArk's models to your business needs, maximizing both efficiency and quality. + +## Prompt Engineering + +Prompt engineering is the process of writing effective instructions for models to generate content that meets your needs. It's about crafting clear and precise prompts to guide the model's output. While models are good at following instructions, the quality of the results depends on how well you communicate with them. + +- Core Principle - Model Specificity: Different models—and even versions within a series—respond differently to prompts. + +### Message Roles and Instruction Following + +By using the `instructions` parameter or **message roles**, you can layer instructions into the model to control the response logic. + +1. **instructions parameter**: Global instruction priority + +`instructions` provides **high-level instructions** (tone, goal, examples, etc.) that have higher priority than `input` content. + +```javascript showLineNumbers title="javascript" +import OpenAI from 'openai'; +const client = new OpenAI({ + baseURL: '{{SITE_URL}}/v1', + apiKey: 'Your access token', +}); + +const response = await client.responses.create({ + model: 'target-model-name', + // Define global style/rules + instructions: 'Respond in the tone of a kind grandmother, using simple analogies and warm, conversational language', + input: 'Are semicolons optional in JavaScript?', +}); + +console.log(response.output_text); +// 示例输出:"Oh honey, in JavaScript, semicolons are like the period at the end of a sentence—technically optional, but they help make things clear. I'd say go ahead and use them, so your code doesn't get confused!" +``` + +2. **Message Roles**: Refined Scene Control** + + By combining the `system`, `user`, and `assistant` roles, you can define interaction logic more flexibly. + + For advanced AI persona customization (e.g., anime style, expert assistant), you can read more about: [Customizing AI Chat Character Styles](./lang-style) + + +### Prompt Formatting Techniques + +Use Markdown and XML tags to structure prompts, helping the model understand boundaries and improve output accuracy. + +**Recommended Structure (developer message)**: + +- Identity: Define the assistant's role, style, and goal. +- Instructions: Clear rules (do's and don'ts). +- Examples: Input/output pairs. +- Context: Private data or supplementary info (place at the end for easy dynamic replacement). + +**Example: Code Generation Prompt** + +```text +# Identity +You are a coding assistant that enforces snake_case variable naming in JavaScript and writes code compatible with Internet Explorer 6. + +# Instructions +Use snake_case (e.g., my_variable) instead of camelCase (e.g., myVariable). +Use the older "var" keyword for variable declaration to support legacy browsers. +Do not format your response in Markdown; return only the requested code. + +# Examples + +How to declare a string variable for a name? + + + +var first_name = "Anna"; + +``` + +### Few-Shot Learning + +Include a few input/output examples in your prompt to guide the model—no fine-tuning required. The model implicitly learns the pattern and applies it to new inputs. + +**Example:Sentiment Classification** + +```text +# Identity +You are a helpful assistant that classifies short product reviews as positive, negative, or neutral. + +# Instructions +* Respond with only one word—no extra formatting or commentary. +* Your response must be exactly one of: "positive", "negative", or "neutral". + +# Examples + +I love these headphones—the sound quality is amazing! + + + +positive + + + +Battery life is average, but it feels cheap. + + + +neutral + + + +Customer service is terrible; I will never buy from them again. + + + +negative + +``` + +### Combining Prompts with Function Calling + +When prompts require external data (e.g., real-time weather, database queries), extend model capabilities via function calling. The model determines whether to call a tool, which one, and with what parameters. After the client executes the function, return the result to the model. + +For detailed implementation methods, refer to: [**Function Calling**](./function-calling) + +### Context Management & Performance Optimization + +1. Context Window Planning + Models have a finite context window: + +- Sizes vary by model. +- For long text: chunk input or use summarization to compress context. + +2. Prompt Caching Optimization + Place reusable fixed content (e.g., system instructions) at the beginning of the prompt to leverage caching and reduce compute costs: + +```python showLineNumbers title="python" +# Efficient structure: static content first, dynamic content last +messages = [ + {"role": "system", "content": "Fixed system instruction, e.g., 'You are an e-commerce agent who must politely answer order inquiries'"}, # Cacheable + {"role": "user", "content": "Dynamic input: When will my order #12345 ship?"} # Processed in real time +] +``` diff --git a/docs_overseas/products/apis/videos/_category_.json b/docs_overseas/products/apis/videos/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..6c108a83767cafcd015bedc59050e9bf98d854a9 --- /dev/null +++ b/docs_overseas/products/apis/videos/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Video Large Models", + "position": 7, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/apis/videos/index.md b/docs_overseas/products/apis/videos/index.md new file mode 100644 index 0000000000000000000000000000000000000000..5a486c6ded4be09fd5f8b1d7a36cfc39fd2d0dc7 --- /dev/null +++ b/docs_overseas/products/apis/videos/index.md @@ -0,0 +1,93 @@ +import ServerlessAPIServices from '@site/src/components/ServerlessAPIServices'; + +# Video Large Models + +## Overview + +Video large models include text-to-video and image-to-video functionalities. Text-to-video refers to generating corresponding video content from input text descriptions, while image-to-video generates relevant videos from input images. These models find applications in fields such as film and television production, advertising creativity, and education and training. + +## Video Model List + +Currently, the video generation models available in the Model Plaza include: + + +## Usage Method + +Enter a text description on the model usage interface, and the model will generate corresponding video content. Below is an example of using the `Wan2.1-T2V-14B` model: + +![wan2.1-t2v](/img/serverless-api/wan-t2v.jpg) +## Sample Code + +All video models on ModelArk are invoked using asynchronous interfaces. For details, please refer to the sample code on the model experience page or the [Asynchronous Interface Usage Guide]({{SITE_URL}}/docs/openapi/v1#tag/Asynchronous-Tasks). + +```python showLineNumbers title="python" +import requests +import time +import json +import webbrowser + +API_URL = "{{SITE_URL}}/v1/async/videos/generations" +API_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Please replace with your access token +headers = { + "Authorization": f"Bearer {API_TOKEN}" +} + +def query(payload): + response = requests.post(API_URL, headers=headers, json=payload) + return response.json() + +def poll_task(task_id): + status_url = f"{{SITE_URL}}/v1/task/{task_id}" + timeout = 30 * 60 + retry_interval = 10 + attempts = 0 + max_attempts = int(timeout / retry_interval) + while attempts < max_attempts: + attempts += 1 + print(f"Checking task status [{attempts}]...", end="") + response = requests.get(status_url, headers=headers, timeout=10) + result = response.json() + if result.get("error"): + print('error') + raise ValueError(f"{result['error']}: {result.get('message', 'Unknown error')}") + status = result.get("status", "unknown") + print(status) + if status == "success": + if "output" in result and "file_url" in result["output"]: + file_url = result["output"]["file_url"] + duration = (result.get('completed_at', 0) - result.get('started_at', 0)) / 1000 + print(f"🔗 Donwload link: {file_url}") + print(f"⏱️ Task duration: {duration:.2f} seconds") + # Open the result URL in the browser + webbrowser.open(file_url) + else: + print("⚠️ No output URL found") + elif status in ["failed", "cancelled"]: + print(f"❌ Task {status}") + else: + time.sleep(retry_interval) + continue + task_file = f"task_{task_id}.json" + with open(task_file, "w") as f: + json.dump(result, f, indent=4) + print(f"Task was saved to file {task_file}") + return result + print(f"⏰ Maximum attempts reached ({max_attempts})") + return {"status": "timeout", "message": "maximum wait time exceeded"} + +if __name__ == "__main__": + print("Creating task...") + result = query({ + "model": "Wan2.1-T2V-1.3B", + "num_inferenece_steps": 50, + "num_frames": 81 + }) + task_id = result.get("task_id") + if not task_id: + raise ValueError("Task ID not found in the response") + print(f"Task ID: {task_id}") + task = poll_task(task_id) + if task.get("status") == "success": + # Do something with the task result here + print("Task completed successfully!") +``` diff --git "a/docs_overseas/products/fuzzy.assets/20250113164303_\345\220\211\345\215\234\345\212\233\351\243\216\346\240\274__\345\260\217\346\270\205\346\226\260.jpeg" "b/docs_overseas/products/fuzzy.assets/20250113164303_\345\220\211\345\215\234\345\212\233\351\243\216\346\240\274__\345\260\217\346\270\205\346\226\260.jpeg" new file mode 100644 index 0000000000000000000000000000000000000000..7d362eaa515fcdb422898f4d991a1ea463e5b51f Binary files /dev/null and "b/docs_overseas/products/fuzzy.assets/20250113164303_\345\220\211\345\215\234\345\212\233\351\243\216\346\240\274__\345\260\217\346\270\205\346\226\260.jpeg" differ diff --git a/docs_overseas/products/fuzzy.assets/P1012997.jpeg b/docs_overseas/products/fuzzy.assets/P1012997.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..88c7393742a668d0071a36d51f00a7ecdcfacc7c Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/P1012997.jpeg differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250113153212170.png b/docs_overseas/products/fuzzy.assets/image-20250113153212170.png new file mode 100644 index 0000000000000000000000000000000000000000..681f448f9dcf6c24334ebeda99ec211ff2a81ab4 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250113153212170.png differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250113173048253.png b/docs_overseas/products/fuzzy.assets/image-20250113173048253.png new file mode 100644 index 0000000000000000000000000000000000000000..25cc9d5b74ca2ad4679d1f0f1650c78ee1f05a3e Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250113173048253.png differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250113173107828.png b/docs_overseas/products/fuzzy.assets/image-20250113173107828.png new file mode 100644 index 0000000000000000000000000000000000000000..4e3872d2f061dbcb5194310b7f232fb99773c292 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250113173107828.png differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250114143124824.png b/docs_overseas/products/fuzzy.assets/image-20250114143124824.png new file mode 100644 index 0000000000000000000000000000000000000000..0a1e248bedbab26c57765825afc91b537633be67 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250114143124824.png differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250114144653414.png b/docs_overseas/products/fuzzy.assets/image-20250114144653414.png new file mode 100644 index 0000000000000000000000000000000000000000..20ed1513dfad0c5718d3901fd341cf89584277a5 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250114144653414.png differ diff --git a/docs_overseas/products/fuzzy.assets/image-20250114144718497.png b/docs_overseas/products/fuzzy.assets/image-20250114144718497.png new file mode 100644 index 0000000000000000000000000000000000000000..035062d28e7fce964989c672ec863f5326cdf914 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/image-20250114144718497.png differ diff --git a/docs_overseas/products/fuzzy.assets/jojo.jpeg b/docs_overseas/products/fuzzy.assets/jojo.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..33657f77d6e37cfaf1f7bda97eecca0aa9f9bb89 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/jojo.jpeg differ diff --git a/docs_overseas/products/fuzzy.assets/style_web.jpg b/docs_overseas/products/fuzzy.assets/style_web.jpg new file mode 100644 index 0000000000000000000000000000000000000000..926d92aba53b72ed251f1ee309f074f99f2fa833 Binary files /dev/null and b/docs_overseas/products/fuzzy.assets/style_web.jpg differ diff --git a/docs_overseas/products/ocr.assets/image-20250114152140833.png b/docs_overseas/products/ocr.assets/image-20250114152140833.png new file mode 100644 index 0000000000000000000000000000000000000000..8399d9519b26740ca9cb3c3e0864ecad6182486a Binary files /dev/null and b/docs_overseas/products/ocr.assets/image-20250114152140833.png differ diff --git a/docs_overseas/products/ocr.assets/image-20250114152442007.png b/docs_overseas/products/ocr.assets/image-20250114152442007.png new file mode 100644 index 0000000000000000000000000000000000000000..42b43c4eaebc37f9b0cd5e6e0e8b28bd4ca810b4 Binary files /dev/null and b/docs_overseas/products/ocr.assets/image-20250114152442007.png differ diff --git a/docs_overseas/products/pdf.assets/pdf.png b/docs_overseas/products/pdf.assets/pdf.png new file mode 100644 index 0000000000000000000000000000000000000000..23339f338befe5d1a422307c716f235194cb5c5c Binary files /dev/null and b/docs_overseas/products/pdf.assets/pdf.png differ diff --git a/docs_overseas/products/workflow/_category_.json b/docs_overseas/products/workflow/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..abf91f33e8048b87f9cff04e1144419d1efcd33d --- /dev/null +++ b/docs_overseas/products/workflow/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "API 流水线", + "position": 4, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/workflow/api.md b/docs_overseas/products/workflow/api.md new file mode 100644 index 0000000000000000000000000000000000000000..0e9ca72fa6f94a1e1bcef2e802d5b55b6febc27d --- /dev/null +++ b/docs_overseas/products/workflow/api.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 6 +--- +import ReactPlayer from 'react-player/lazy'; + +# Calling Pipelines via API + +## Introduction + +We provide a standardized REST API interface for API Pipelines, allowing you to call your API Pipelines programmatically. + +![api](/img/workflow/api-1.png) + +## API Documentation + +You can view detailed API calling instructions in the [API Documentation]({{SITE_URL}}/docs/openapi/v1#tag/api%E6%B5%81%E6%B0%B4%E7%BA%BF/post/workflows/{workflowId}/run). + +## Access Token + +The access token is the credential for calling the API. You need to obtain your access token in [**Dashboard->Settings->Access Tokens**]({{SITE_URL}}/dashboard/settings/tokens). + +![api](/img/serverless-api/integrated/integrate3.png) + +## Calling Example +### Complete Guide to AI Image Generation —— One-stop Guide from Model Selection to API Deployment + + \ No newline at end of file diff --git a/docs_overseas/products/workflow/index.md b/docs_overseas/products/workflow/index.md new file mode 100644 index 0000000000000000000000000000000000000000..0dd00f2f91a7cd092c249609211e8a6bac4fe21a --- /dev/null +++ b/docs_overseas/products/workflow/index.md @@ -0,0 +1,91 @@ +--- +description: API Pipeline is a visual workflow engine that enables you to freely combine multiple model APIs—such as text dialogue, image generation, and audio processing—into automated task sequences through a node-based interface. +--- + +# API Pipeline + +## Overview + +API Pipeline is a visual workflow engine that supports freely combining multiple model APIs (such as text dialogue, image generation, audio processing, etc.) through nodes to build automated task flows. It can quickly connect the input and output of different models, intelligently handle parameter conversion, and reduce the complexity of multi-model collaboration. Its advantages lie in out-of-the-box AI capability integration, low-code interactive design, and flexible adaptation to complex business scenarios, significantly improving development efficiency. + +![API Pipeline](/img/workflow/example-vision.png) +![API Pipeline](/img/workflow/example-text.png) + +## Quick Start + +If you are using API Pipeline for the first time, it is recommended to read in the following order: + +1. **[Quick Start](/docs/products/workflow/quick-start)** - Get started quickly with practical examples +2. **[Node Description](/docs/products/workflow/node)** - Understand the functions and configurations of various nodes +3. **[Application Scenarios](/docs/products/workflow/scene)** - Explore practical applications of different models + +## Key Concepts + +### Node Types + +An API Pipeline consists of nodes with different functions, and each node performs specific operations: + +- **[Start Node](/docs/products/workflow/node/#start)** - The entry point of the API Pipeline, defining input parameters +- **[Model Node](/docs/products/workflow/node/#model)** - Calls AI models to process data +- **[Conditional Branch Node](/docs/products/workflow/node/#condition)** - Selects execution paths based on conditions +- **[Comment Node](/docs/products/workflow/node/#note)** - Adds comment explanations to the pipeline +- **[End Node](/docs/products/workflow/node/#end)** - The exit point of the API Pipeline, defining output results + +### Variable System + +Variables are used to connect the input and output of preceding and subsequent nodes in the API Pipeline, enabling complex processing logic in the flow: + +- **System variables**: Variables automatically generated and managed by the system +- **Node variables**: Output variables generated by each node + +### Execution Flow + +The API Pipeline executes in the order of node connections: + +1. Obtains input parameters from the start node +2. Executes each node in sequence according to the connection order +3. Implements different execution paths through conditional branches +4. Outputs the final result at the end node + +## Supported Model Types + +API Pipeline supports various types of AI models to meet different business needs: + +| Model Type | Main Functions | Application Scenarios | +| ---------------------------------------------------- | -------------------------- | -------------------------------------- | +| [Text Generation](/docs/products/workflow/scene/#text) | Text understanding, generation, classification | Content creation, customer service Q&A, translation | +| [Vision Models](/docs/products/workflow/scene/#vision) | Image understanding, content recognition | Image analysis, OCR, quality inspection | +| [Image Generation](/docs/products/workflow/scene/#image) | Generate images from descriptions | Design creation, content production | +| [Speech Models](/docs/products/workflow/scene/#audio) | Speech recognition, speech synthesis | Voice assistants, content broadcasting | +| [Risk Control Recognition](/docs/products/workflow/scene/#risk) | Risk identification, content review | Risk management, content security | + +## Billing Model + +The cost of API Pipeline is calculated based on model calls, depending on the type and number of model nodes. Billing is directly related to the resource package permissions bound to your [access token](/docs/products/workflow/api#访问令牌). + +Different resource packages may contain different available models and corresponding prices. To ensure that your API Pipeline has full call permissions for all models, it is strongly recommended to purchase the [Full Model Resource Package]({{SITE_URL}}/serverless-api/packages/1910) and use the access token bound to this resource package for calls. + +### Billing Rules + +- Each call to a model node incurs a fee +- Different types of model nodes have different fees +- Total cost = Sum of call fees for all model nodes + +### Example + +Suppose an API Pipeline includes: + +- 1 text generation model node (¥0.02/call) +- 1 image generation model node (¥0.05/call) + +Then the cost for each call of this API Pipeline is: **¥0.02 + ¥0.05 = ¥0.07** + +> For the specific cost of each model, please refer to the [Model Plaza]({{SITE_URL}}/serverless-api) + +#### Next Steps + +Ready to start using API Pipeline? + +👉 [View Operation Steps](/docs/products/workflow/quick-start) to learn how to create your first API Pipeline + +👉 [Browse Application Scenarios](/docs/products/workflow/scene) to find solutions suitable for your business \ No newline at end of file diff --git a/docs_overseas/products/workflow/node/_category_.json b/docs_overseas/products/workflow/node/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..fe31eac812928058bb9ffaac286d52d714e480ce --- /dev/null +++ b/docs_overseas/products/workflow/node/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Pipeline Node Description", + "position": 3, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/workflow/node/index.md b/docs_overseas/products/workflow/node/index.md new file mode 100644 index 0000000000000000000000000000000000000000..1fc5fd6b93734b097a03d439b75134d33f07d0d9 --- /dev/null +++ b/docs_overseas/products/workflow/node/index.md @@ -0,0 +1,134 @@ +# Pipeline Node Description + +## Start Node {#start} + +The **"Start"** node is a mandatory preset node for every API pipeline. As the entry point of the entire process, it is responsible for receiving and defining external input parameters. + +![Start Node](/img/workflow/start.png) + +### Node Functions + +The main functions of the start node: + +- **Process Entry**: Identifies the starting position of the API pipeline +- **Parameter Reception**: Receives input data from external sources +- **Data Type Definition**: Standardizes the format and type of input data + +### Input Parameters + +Receives variables from external sources and supports multiple input parameter types, which can be flexibly configured according to business needs: + +- **Text**: For inputting string content. +- **Number**: Only allows users to input numbers. +- **Single File**: Allows application users to upload files individually, supporting documents, images, audio, and video files. Supports uploading files from local devices. + +![Input Type Example](/img/workflow/input-1.png) +![Input Configuration Interface](/img/workflow/input-3.png) + +### System Variables + +System variables refer to preset system-level parameters within the API pipeline that can be read globally by other nodes in the application. They are typically used to record usage behaviors of different applications and users, etc. They include the following variables: + +- **sys.workflow_run_id**: The run ID of the API pipeline, used to track previous runs of the application. +- **sys.workflow_id**: The unique identifier of the API pipeline, used to distinguish different API pipelines. +- **sys.user_id**: User ID. Each user is automatically assigned a unique identifier by the system when using the API pipeline to distinguish different users. + +### Configuration Method + +1. Select the start node +2. Click the **"+"** button in the input field on the right detail panel +3. Choose the appropriate parameter type +4. Set the parameter name and description + +## Model Node {#model} + +The model node provides the ability to call models. It can process information input by users in the "Start" node and information output by other model nodes (natural language, uploaded files or images), and provide effective response information. + +![Model Node](/img/workflow/model-1.png) + +### Model Settings + +The model node supports calling various types of models, including text generation models, vision models, image generation models, speech recognition models, speech synthesis models, risk control recognition models, etc. You can click to select a model from the model dropdown menu. + +![Model Node](/img/workflow/llm.png) +![Model Node](/img/workflow/stt.png) + +### Interface Settings + +Some models have only one interface, such as text generation models, which have only one text generation interface; image generation models may have multiple interfaces, such as: image padding, local redrawing, style transfer, etc. + +![Model Node](/img/workflow/model-2.png) + +### Parameter Settings + +Set input parameters according to model requirements, such as stream, max_tokens, temperature, etc. On the right side of the interface dropdown menu, you can click to select parameter settings, as shown in the following figure: + +![Model Node](/img/workflow/model-3.png) + +### Variable Settings + +In parameter settings, you can set variables for parameters, such as: input, image, file, etc. Variables can be obtained from the start node or from upstream model nodes. + +![Model Node](/img/workflow/var.png) + +### Output Settings + +The output parameters of the model. The output variables of different types of models will vary. For example: the output variable of the text generation model is: text, and the output variable of the image generation model is: image. + +![Model Node](/img/workflow/output.png) + +## Conditional Branch Node {#condition} + +The conditional branch node is used to select different execution paths according to conditions: + +![Model Node](/img/workflow/ifelse.png) + +### Condition Types + +The conditional branch node supports the following condition types: + +- Contains +- Does not contain +- Starts with +- Ends with +- Is +- Is not +- Is null +- Is not null + +Condition judgment supports the combination of multiple conditions. + +## Comment Node {#note} + +The comment node is used to add explanatory text, remarks, or descriptions in the API pipeline, helping developers better understand and maintain process logic. + +![Comment Node](/img/workflow/note.png) + +### Node Functions + +The main functions of the comment node: + +- **Process Explanation**: Add text descriptions for complex process logic +- **Remark Recording**: Record design ideas, precautions, or to-do items +- **Documentation**: Improve the readability and maintainability of the pipeline +- **Team Collaboration**: Facilitate team members to understand the process design intent + +### Feature Description + +- **Non-executable Node**: The comment node is only for explanation and does not participate in the actual process execution +- **Independent Existence**: Does not need to be connected to other nodes and can be placed anywhere on the canvas independently + +### Adding Method +1. Right-click the mouse, a menu will pop up, select "Add Comment", or click the "Add Comment" button in the toolbar +2. Enter comment content in the text box +3. Adjust the position of the comment node on the canvas as needed + +![Comment Node](/img/workflow/note1.png) + +## End Node {#end} + +Each API pipeline must contain at least one end node as the endpoint of its execution, which is responsible for outputting the final result of the process. The end node marks the termination of the process, and no nodes can be connected after it. + +In the API pipeline, the execution result will only be output when the process reaches the end node. If there are branches in the process (such as conditional judgment), multiple end nodes may need to be defined (one for each branch path). On the end node, you need to define its output variables, which can be set based on the output values of any upstream nodes before this node. + +![Model Node](/img/workflow/end.png) \ No newline at end of file diff --git a/docs_overseas/products/workflow/quick-start.md b/docs_overseas/products/workflow/quick-start.md new file mode 100644 index 0000000000000000000000000000000000000000..acd5b82ede7f894154e22b87518bce6c193ffbf1 --- /dev/null +++ b/docs_overseas/products/workflow/quick-start.md @@ -0,0 +1,64 @@ +--- +sidebar_label: Quick-Start + +sidebar_position: 1 +--- + +import ReactPlayer from 'react-player/lazy'; + +# Quick-Start + +Below is a simple example demonstrating how to create an API pipeline. You can also [directly click to view the practical operation video](#quick-start-video) + +## Create a New API Pipeline + +Go to the [API Pipeline]({{SITE_URL}}/dashboard/workflows) page, click the **"New API Pipeline"** button to open the creation popup, enter the **Name** and **Description**, and create an API pipeline. + +![Create New API Pipeline](/img/workflow/step-1.png) +![Create New API Pipeline](/img/workflow/step-2.png) + +## Add a Start Node + +After successful creation, you will enter the current API pipeline page. Click to select the **"Start"** node, and the node details will be displayed on the right. Click the **"+"** button on the right side of the input field to add input variables. You can add multiple input variables as needed. For example, add a **Variable Name** called **"input"**. + +![Configure Start Node](/img/workflow/step-3.png) +![Add Input Variable](/img/workflow/input-1.png) + +## Add a Model Node + +Click the **"+"** button on the right side of the start node, and three options will appear: **"Model"**, **"Conditional Branch"**, and **"End"**. Click the **"Model"** option to create a model node. The details of the model node will be displayed on the right. In the model dropdown menu, select the model you need to call. + +Click the button on the right of "Interface" to pop up the **"Parameter Settings"** window, where you can set the corresponding model parameters. +![Select Model](/img/workflow/model-1.png) +![Parameter Settings](/img/workflow/model-3.png) + +## Set Variables + +You can bind variables output from upstream nodes to the input parameters of the model node. The application will use these variables as input parameters when running the model node. For text conversation models, you can click the icon in the upper right corner of the message list editor to open the variable list and select variables to insert into the message. For other models, you can also click the variable selection box to choose the variables to bind. + +![Variable Configuration](/img/workflow/step-4.png) +![Variable Mapping](/img/workflow/var.png) + +## Add an End Node + +Add an **End** node and click the **"Save"** button to save the current API pipeline. + +![Save API Pipeline](/img/workflow/step-6.png) + +## Step-by-Step Practical Video Tutorial {#quick-start-video} + + + +## Completion + +Congratulations! You have successfully created your first API pipeline. + +#### Next Steps + +- [Learn how to run](./run) - View API pipeline running results +- [Learn more about node types](./node) - Explore detailed functions of Start, Model, Conditional Branch, and End nodes +- [View application scenarios](./scene) - Learn practical application cases of different models \ No newline at end of file diff --git a/docs_overseas/products/workflow/run.md b/docs_overseas/products/workflow/run.md new file mode 100644 index 0000000000000000000000000000000000000000..209523184844acc1b4bd1d0bc037414afde18703 --- /dev/null +++ b/docs_overseas/products/workflow/run.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 4 +--- + +# Preview and Run Pipeline + +API Pipeline provides a run function. Click **"Run"** to open the run panel. + +![Run](/img/workflow/run.png) + +After entering the parameters configured in the start node, click the **"Run"** button to view the running results. + +![Run](/img/workflow/example-text.png) \ No newline at end of file diff --git a/docs_overseas/products/workflow/scene/_category_.json b/docs_overseas/products/workflow/scene/_category_.json new file mode 100644 index 0000000000000000000000000000000000000000..59968af914aeb16fc715e0a871d75e2e8e8c67aa --- /dev/null +++ b/docs_overseas/products/workflow/scene/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Application Scenarios of Pipelines", + "position": 2, + "collapsed": true +} \ No newline at end of file diff --git a/docs_overseas/products/workflow/scene/index.md b/docs_overseas/products/workflow/scene/index.md new file mode 100644 index 0000000000000000000000000000000000000000..eb23980eb277c0bd02f86478497f6f6d95fe1ea2 --- /dev/null +++ b/docs_overseas/products/workflow/scene/index.md @@ -0,0 +1,244 @@ +# Application Scenarios of Pipelines + +## Speech Model Application Scenarios {#audio} + +Speech models include two major types: Automatic Speech Recognition (ASR) and Text-to-Speech (TTS), providing powerful capabilities for understanding and generating audio content. + +![API Pipeline](/img/workflow/example-audio.png) + +### Automatic Speech Recognition Models + +Automatic Speech Recognition models can convert speech to text, supporting multiple languages and dialects, and are widely used in various scenarios requiring speech understanding. + +![Model Node](/img/workflow/stt.png) + +#### Main Application Scenarios + +##### Real-time Meeting Transcription +In remote collaboration scenarios, real-time transcription of cross-language online meeting content, generating timestamped conversation records with support for keyword retrieval and key point marking. + +**Typical Use Cases**: +- Automatic remote meeting recording +- Synchronous translation for multilingual meetings +- Automatic meeting minutes generation + +##### Video Content Subtitling +In media production scenarios, automatically generating multilingual subtitles for short videos/feature documentaries, synchronously outputting subtitle files (SRT/VTT). + +**Typical Use Cases**: +- Automatic video subtitle generation +- Multilingual subtitle production +- Media content localization + +### Speech Synthesis Models + +Speech Synthesis models can convert text into natural and fluent speech, supporting multiple timbres and emotional expressions. + +![Model Node](/img/workflow/tts.png) + +#### Main Application Scenarios + +##### Multi-character Audio Content Creation +Generate旁白 voices for different genders/ages, batch outputting dubbed segments with emotional changes. + +**Typical Use Cases**: +- Audiobook production +- Advertising voiceover generation +- Podcast production +- Role-playing audio + +##### Long Text Speech Broadcasting +Convert novel chapters into natural and fluent reading audio, automatically inserting breathing pauses/emphasis stress. + +**Typical Use Cases**: +- Long novel reading +- News broadcast generation +- Study material reading + +## Image Generation Model Application Scenarios {#image} + +Image generation models can generate high-quality image content based on text descriptions or other images, supporting various creation and editing scenarios, and providing strong support for visual content creation. + +![API Pipeline](/img/workflow/example-image.png) + +### Main Application Scenarios + +#### Product Visual Design +Generate high-quality product posters, scene images, or marketing materials based on product descriptions, supporting background replacement/style transfer to ensure the visual style conforms to the brand tone. + +**Typical Use Cases**: +- Automatic e-commerce product poster generation +- Batch production of product scene images +- Personalized customization of marketing materials +- Unified brand visual style +- Product packaging design assistance + +#### Creative Content Generation +Batch generate original illustrations, cover images, or concept art based on text instructions (such as "cyberpunk-style city night view") to enhance content appeal. + +**Typical Use Cases**: +- Automatic article illustration generation +- Social media content creation +- Book cover design +- Concept art creation +- Advertising creative material production + +#### Image Restoration and Enhancement +Perform super-resolution reconstruction, scratch repair, and color restoration on blurred, damaged, or low-resolution images such as old photos to improve the usability of historical materials. + +**Typical Use Cases**: +- Old photo restoration and renovation +- Image denoising processing +- Color enhancement and correction +- Historical document image restoration + +#### Custom Style Transfer +In game/film art scenarios, automatically convert concept art into specified artistic styles (such as ink painting style, pixel style, 3D rendering), or unify the style of multiple materials. + +**Typical Use Cases**: +- Unified style for game art resources +- Stylization of film concept art +- Artwork style conversion +- Brand visual consistency assurance +- Creative style exploration + +#### Personalized Customization +Generate personalized avatars, wallpapers, decorative patterns, and other exclusive content according to user preferences and needs. + +**Typical Use Cases**: +- Personal avatar custom generation +- Mobile phone wallpaper personalization +- Home decoration pattern design +- Personal brand visual creation + +## Risk Control Recognition Model Application Scenarios {#risk} + +Risk control recognition models are specifically used for content security review, capable of automatically identifying and filtering inappropriate content to ensure the safe and compliant operation of platforms and businesses. + +![API Pipeline](/img/workflow/example-vision.png) + +### Main Application Scenarios + +#### Text Content Review +Real-time detection of user-published text/images (such as comment sections, dynamics), intercepting violating content such as pornography, violence, and abusive information. + +**Detection Types**: +- Pornographic and vulgar content identification +- Violent and bloody content detection +- Malicious attack speech filtering +- Spam advertising information interception +- Sensitive political content identification + +#### File Upload Risk Control +Scan sensitive content in user-uploaded documents/images to prevent the spread of dangerous content such as political symbols and prohibited images. + +**Typical Use Cases**: +- Document content security scanning +- Image violating content detection +- Pornographic violating image identification +- Political violating image identification + +## Text Generation Model Application Scenarios {#text} + +Text generation model (LLM) nodes can utilize the dialogue/generation/classification/processing capabilities of large language models to handle a wide range of task types based on given prompts, and can be used in different links of the API pipeline. It includes various mainstream models such as DeepSeek, Qwen series, etc. + +![Model Node](/img/workflow/run.png) +![Model Node](/img/workflow/example-text.png) + +### Main Application Scenarios + +#### Intent Recognition +In customer service dialogue scenarios, perform intent recognition and classification on user questions, directing them to different downstream processes. + +**Typical Use Cases**: +- Customer service robots automatically classify user questions (technical support, refund applications, product consultation) +- Intelligently route user requests to corresponding professional customer service teams +- Real-time analysis of user emotions to adjust dialogue strategies + +#### Text Generation +In article generation scenarios, act as a content generation node to generate text content according to themes and keywords. + +**Typical Use Cases**: +- Automatic marketing copy generation +- Batch creation of product manuals +- Personalized email content generation +- Social media content creation + +#### Content Classification +In email batch processing scenarios, automatically classify email types such as consultation/complaint/spam. + +**Typical Use Cases**: +- Automatic email sorting system +- Content review classification +- Automatic document archiving +- User feedback classification analysis + +#### Text Conversion +In text translation scenarios, translate user-provided text content into specified languages. + +**Typical Use Cases**: +- Multilingual content localization +- Real-time chat translation +- Document translation batch processing +- Cross-language information retrieval + +#### Code Generation +In auxiliary programming scenarios, generate specified business code and write test cases according to user requirements. + +**Typical Use Cases**: +- Automated test case generation +- API documentation generation +- Code refactoring suggestions +- Programming teaching assistance + +### Configuration Points + +- **Model Selection**: Choose an appropriate model scale according to task complexity +- **Prompt Optimization**: Design professional prompt templates for specific scenarios +- **Parameter Adjustment**: Adjust parameters such as temperature and max_tokens according to output requirements +- **Variable Settings**: Reasonably set input and output variables to facilitate data transfer between upstream and downstream nodes + +## Vision Model Application Scenarios {#vision} + +Vision models can understand and analyze image content, providing intelligent image recognition, understanding, and analysis capabilities, and are widely used in various scenarios requiring visual understanding. + +![Model Node](/img/workflow/example-vision.png) + +### Main Application Scenarios + +#### Image Content Understanding and Q&A +In intelligent customer service scenarios, analyze user-uploaded product fault images, operation interface screenshots, or physical photos, accurately identify content, and answer related questions. + +**Typical Use Cases**: +- Automatic diagnosis of product fault images +- Operation interface problem identification +- Product appearance quality inspection +- Visual analysis of user questions + +#### Image-Text Information Extraction and Processing +In document automation processing, parse scanned documents, bills, contracts, or images with text information, extract key fields, identify table data, or perform text translation. + +**Typical Use Cases**: +- Automatic invoice information extraction +- Contract key clause identification +- Table data structuring +- Multilingual document translation +- ID card information recognition + +#### Industrial Vision Inspection +In automated production line quality inspection, real-time analysis of high-definition images of products/components to detect scratches, cracks, assembly errors, dimensional deviations, foreign objects, or printing defects. + +**Typical Use Cases**: +- Product surface defect detection +- Assembly integrity verification +- Automatic size specification measurement +- Printing quality control +- Foreign object detection and sorting + +#### Education/Training Assistance +In intelligent education platforms, identify textbook illustrations, experiment images, handwritten problem-solving steps, or student paintings, and provide explanations, corrections, answers, or generate related learning questions. + +**Typical Use Cases**: +- Automatic correction of handwritten homework +- Experimental result image analysis +- Textbook content understanding assistance \ No newline at end of file diff --git a/docusaurus.config.overseas.ts b/docusaurus.config.overseas.ts new file mode 100644 index 0000000000000000000000000000000000000000..84d96b30de29a954e9ca599481b8ea5d01b2632e --- /dev/null +++ b/docusaurus.config.overseas.ts @@ -0,0 +1,314 @@ +import dotenv from 'dotenv'; +import { themes as prismThemes } from 'prism-react-renderer'; +import type { Config } from '@docusaurus/types'; +import type * as Preset from '@docusaurus/preset-classic'; +import type { ScalarOptions } from '@scalar/docusaurus'; + +dotenv.config({ path: '.env.overseas' }); + +const CDN_PREFIX = process.env.DOCS_CDN_PREFIX; +const SITE_URL = process.env.DOCS_SITE_URL; +const API_URL = process.env.DOCS_API_URL; +envCheck(); + +const config: Config = { + title: 'MoArk', + tagline: 'Simplify AI Application Development', + favicon: `${CDN_PREFIX}/img/favicon.ico`, + + // Set the production url of your site here + url: SITE_URL, + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: '/docs/', + + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'gitee-ai', // Usually your GitHub org/user name. + projectName: 'docs', // Usually your repo name. + + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'warn', + + // Even if you don't use internationalization, you can use this field to set + // useful metadata like html lang. For example, if your site is Chinese, you + // may want to replace "en" with "zh-Hans". + i18n: { + defaultLocale: 'en', + locales: ['en'], + }, + + presets: [ + [ + 'classic', + { + docs: { + path: 'docs_overseas', + routeBasePath: '/', + sidebarPath: './sidebars.overseas.ts', + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: 'https://gitee.com/moark/docs/edit/main/', + editLocalizedFiles: true, + }, + blog: { + showReadingTime: true, + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: 'https://gitee.com/moark/docs/edit/main/', + editLocalizedFiles: true, + }, + theme: { + customCss: './src/css/custom.css', + }, + } satisfies Preset.Options, + ], + ], + + themeConfig: { + // Replace with your project's social card + // image: 'img/docusaurus-social-card.jpg', + navbar: { + // title: 'Gitee AI', + logo: { + alt: 'moark logo', + src: `${CDN_PREFIX}/img/logo-overseas-full.svg`, + srcDark: `${CDN_PREFIX}/img/logo-overseas-full.svg`, + href: SITE_URL, + target: '_self', + style: { + paddingLeft: '8px', + }, + }, + items: [ + { + type: 'html', + position: 'left', + className: 'gai-navbar-item-home', + value: `Dashboard`, + }, + { + label: 'Models', + to: `${SITE_URL}/serverless-api`, + target: '_self', + }, + { + label: 'Products', + items: [ + { + label: 'Serverless Inference', + to: `${SITE_URL}/products/inference`, + target: '_self', + }, + { + label: 'Fine-tuning', + to: `${SITE_URL}/products/fine-tuning`, + className: 'gai-navbar-item-disable', + }, + { + label: 'Reserved GPUs', + to: `${SITE_URL}/products/compute`, + className: 'gai-navbar-item-disable', + }, + ], + }, + { + label: 'Pricing', + to: `${SITE_URL}/pricing`, + target: '_self', + }, + { + label: 'Docs', + to: `/docs/`, + className: 'gai-navbar-item', + activeBaseRegex: '^/docs.*', + }, + // { + // type: 'localeDropdown', + // position: 'right', + // }, + ], + }, + footer: { + style: 'light', + /* + links: [ + { + title: 'Docs', + items: [ + { + label: 'Tutorial', + to: '/docs/intro', + }, + ], + }, + { + title: 'Community', + items: [ + { + label: 'Stack Overflow', + href: 'https://stackoverflow.com/questions/tagged/docusaurus', + }, + { + label: 'Discord', + href: 'https://discordapp.com/invite/docusaurus', + }, + { + label: 'Twitter', + href: 'https://twitter.com/docusaurus', + }, + ], + }, + { + title: 'More', + items: [ + { + label: 'Blog', + to: '/blog', + }, + { + label: 'Gitee AI', + href: SITE_URL, + }, + ], + }, + ], + */ + copyright: `Copyright © ${new Date().getFullYear()} 模力方舟.`, + }, + prism: { + additionalLanguages: ['bash', 'json'], + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + zoom: { + selector: '.markdown img', + config: {}, + }, + metadata: [ + { + name: 'keywords', + content: + 'moark, large models, MaaS, Model as a Service, AI applications, AI development, AI platform, AI tools, AI solutions', + }, + { + name: 'description', + content: + 'MoArk aggregates the latest and hottest AI models, providing a one-stop service for model experience, inference, fine-tuning, and applications, with rich computing power options, aiming to help enterprises and developers build AI applications more easily.', + }, + ], + colorMode: { + defaultMode: 'light', + disableSwitch: false, + respectPrefersColorScheme: true, + }, + } satisfies Preset.ThemeConfig, + plugins: [ + 'docusaurus-plugin-image-zoom', + // 添加本地搜索插件 + [ + require.resolve('@easyops-cn/docusaurus-search-local'), + { + // 中文搜索配置 + hashed: true, + language: ['zh'], + indexDocs: true, + indexBlog: false, + indexPages: false, + docsRouteBasePath: '/', + // 搜索结果数量限制 + searchResultLimits: 8, + // 搜索上下文长度 + searchResultContextMaxLength: 50, + // 启用搜索建议 + explicitSearchResultPath: true, + // 支持中文分词 + searchBarShortcut: true, + searchBarShortcutHint: true, + // 搜索栏位置 + searchBarPosition: 'right', + // 不索引调试构建 + ignoreFiles: [/\/build\//, /\/node_modules\//], + }, + ], + // 添加自定义加载效果插件 + require('./src/plugins/scalar-loading-plugin'), + // 添加简单的环境变量替换插件(只处理 .md 文件) + require('./src/plugins/simple-env-replacement-plugin'), + // 添加 MDX 环境变量替换插件(处理 .mdx 文件) + require('./src/plugins/mdx-env-replacement-plugin'), + [ + '@scalar/docusaurus', + { + id: 'openapi/v1', + label: '接口文档', + route: `/docs/openapi/v1`, + showNavLink: false, + configuration: { + url: `${SITE_URL}/v1/yaml`, + // url: `/docs/test.yml`, // 本地测试 + servers: [ + { + url: `${API_URL}/v1`, + description: '生产服务器', + }, + ], + defaultOpenAllTags: true, + hideClientButton: true, + hideModels: true, + documentDownloadType: 'none', + }, + cdn: `${CDN_PREFIX}/@scalar/api-reference@1.32.5.js`, + } as ScalarOptions, + ], + function () { + return { + name: 'cdn-plugin', + configureWebpack(config, isServer) { + return { + output: { + publicPath: `${CDN_PREFIX}/`, // 将静态资源的路径指向 CDN + // Worker 文件不使用 CDN,使用相对路径 + workerPublicPath: '/docs/', + }, + }; + }, + }; + }, + ], + ssrTemplate: ` +> + + + + <% it.metaAttributes.forEach((metaAttribute) => { %> + <%~ metaAttribute %> + <% }); %> + <%~ it.headTags %> + <% it.stylesheets.forEach((stylesheet) => { %> + + <% }); %> + <% it.scripts.forEach((script) => { %> + + <% }); %> + + > + <%~ it.preBodyTags %> +
<%~ it.appHtml %>
+ <%~ it.postBodyTags %> + +`, +}; + +export default config; + +function envCheck() { + if (!CDN_PREFIX || !SITE_URL) { + const tips = 'CDN_PREFIX or SITE_URL environment variable does not exist'; + console.log(); + console.log(); + console.log(tips); + console.log(); + throw new Error(tips); + } +} diff --git a/i18n/en/code.json b/i18n/en/code.json new file mode 100644 index 0000000000000000000000000000000000000000..0db6dbba33675bcd8f9e78981e79928b49bba153 --- /dev/null +++ b/i18n/en/code.json @@ -0,0 +1,366 @@ +{ + "navbar.user_guides": { + "message": "User Guides" + }, + "navbar.api_reference": { + "message": "API Reference" + }, + "theme.ErrorPageContent.title": { + "message": "This page crashed.", + "description": "The title of the fallback page when the page crashed" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "Scroll back to top", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.archive.title": { + "message": "Archive", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "Archive", + "description": "The page & hero description of the blog archive page" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "Blog list page navigation", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "Newer entries", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "Older entries", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "Blog post page navigation", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "Newer post", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "Older post", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.tags.tagsPageLink": { + "message": "View all tags", + "description": "The label of the link targeting the tag list page" + }, + "theme.colorToggle.ariaLabel.mode.system": { + "message": "system mode", + "description": "The name for the system color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "light mode", + "description": "The name for the light color mode" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "dark mode", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel": { + "message": "Switch between dark and light mode (currently {mode})", + "description": "The ARIA label for the color mode toggle" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "Breadcrumbs", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.DocCard.categoryDescription.plurals": { + "message": "1 item|{count} items", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "Docs pages", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "Previous", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "Next", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "One doc tagged|{count} docs tagged", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged} with \"{tagName}\"", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "Version: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "latest version", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "Edit this page", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "Direct link to {heading}", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " on {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " by {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "Last updated{atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "Versions", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.NotFound.title": { + "message": "Page Not Found", + "description": "The title of the 404 page" + }, + "theme.tags.tagsListLabel": { + "message": "Tags:", + "description": "The label alongside a tag list" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Close", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.admonition.caution": { + "message": "caution", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.admonition.danger": { + "message": "danger", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "info", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.note": { + "message": "note", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "tip", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.warning": { + "message": "warning", + "description": "The default label used for the Warning admonition (:::warning)" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.DocSidebarItem.expandCategoryAriaLabel": { + "message": "Expand sidebar category '{label}'", + "description": "The ARIA label to expand the sidebar category" + }, + "theme.DocSidebarItem.collapseCategoryAriaLabel": { + "message": "Collapse sidebar category '{label}'", + "description": "The ARIA label to collapse the sidebar category" + }, + "theme.NavBar.navAriaLabel": { + "message": "Main", + "description": "The ARIA label for the main navigation" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "Languages", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.NotFound.p1": { + "message": "We could not find what you were looking for.", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.blog.post.readMore": { + "message": "Read more", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "Read more about {title}", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "One min read|{readingTime} min read", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.CodeBlock.copy": { + "message": "Copy", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.copied": { + "message": "Copied", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "Copy code to clipboard", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "Toggle word wrap", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.docs.breadcrumbs.home": { + "message": "Home page", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "Collapse sidebar", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "Collapse sidebar", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "Docs sidebar", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "Close navigation bar", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "Toggle navigation bar", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": { + "message": "Expand the dropdown", + "description": "The ARIA label of the button to expand the mobile dropdown navbar item" + }, + "theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": { + "message": "Collapse the dropdown", + "description": "The ARIA label of the button to collapse the mobile dropdown navbar item" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "Expand sidebar", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "Expand sidebar", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.SearchBar.noResultsText": { + "message": "No results" + }, + "theme.SearchBar.seeAllOutsideContext": { + "message": "See all results outside \"{context}\"" + }, + "theme.SearchBar.searchInContext": { + "message": "See all results within \"{context}\"" + }, + "theme.SearchBar.seeAll": { + "message": "See all results" + }, + "theme.SearchBar.label": { + "message": "Search", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "Search results for \"{query}\"", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "Search the documentation", + "description": "The search page title for empty query" + }, + "theme.SearchPage.searchContext.everywhere": { + "message": "Everywhere" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "1 document found|{count} documents found", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.noResultsText": { + "message": "No documents were found", + "description": "The paragraph for empty search result" + }, + "theme.blog.post.plurals": { + "message": "One post|{count} posts", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} tagged with \"{tagName}\"", + "description": "The title of the page for a blog tag" + }, + "theme.blog.author.pageTitle": { + "message": "{authorName} - {nPosts}", + "description": "The title of the page for a blog author" + }, + "theme.blog.authorsList.pageTitle": { + "message": "Authors", + "description": "The title of the authors page" + }, + "theme.blog.authorsList.viewAll": { + "message": "View all authors", + "description": "The label of the link targeting the blog authors page" + }, + "theme.blog.author.noPosts": { + "message": "This author has not written any posts yet.", + "description": "The text for authors with 0 blog post" + }, + "theme.contentVisibility.unlistedBanner.title": { + "message": "Unlisted page", + "description": "The unlisted content banner title" + }, + "theme.contentVisibility.unlistedBanner.message": { + "message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.", + "description": "The unlisted content banner message" + }, + "theme.contentVisibility.draftBanner.title": { + "message": "Draft page", + "description": "The draft content banner title" + }, + "theme.contentVisibility.draftBanner.message": { + "message": "This page is a draft. It will only be visible in dev and be excluded from the production build.", + "description": "The draft content banner message" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "Try again", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.common.skipToMainContent": { + "message": "Skip to main content", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "Tags", + "description": "The title of the tag list page" + } +} diff --git a/i18n/en/docusaurus-plugin-content-blog/options.json b/i18n/en/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000000000000000000000000000000..9239ff706c28811b3931968257fffe5465d4cb0e --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Recent posts", + "description": "The label for the left sidebar" + } +} diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json new file mode 100644 index 0000000000000000000000000000000000000000..b90def06a3029b26727230979e3a4a67f375ef70 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,86 @@ +{ + "version.label": { + "message": "Next", + "description": "The label for version current" + }, + "sidebar.docs.category.功能实践": { + "message": "Capabilities", + "description": "The label for category 功能实践 in sidebar docs" + }, + "sidebar.docs.category.🔥 模型广场 (Serverless API)": { + "message": "Serverless API", + "description": "The label for category 🔥 模型广场 (Serverless API) in sidebar docs" + }, + "sidebar.docs.category.文本生成与补全": { + "message": "Text generation and completion", + "description": "The label for category 文本生成与补全 in sidebar docs" + }, + "sidebar.docs.category.图像与视觉": { + "message": "Image and Vision", + "description": "The label for category 图像与视觉 in sidebar docs" + }, + "sidebar.docs.category.语音识别与合成": { + "message": "Speech Recognition and Synthesis", + "description": "The label for category 语音识别与合成 in sidebar docs" + }, + "sidebar.docs.category.文档处理/OCR": { + "message": "Document Processing/OCR", + "description": "The label for category 文档处理/OCR in sidebar docs" + }, + "sidebar.docs.category.模型库": { + "message": "Models", + "description": "The label for category 模型库 in sidebar docs" + }, + "sidebar.docs.category.数据集": { + "message": "Datasets", + "description": "The label for category 数据集 in sidebar docs" + }, + "sidebar.docs.category.API 流水线": { + "message": "API Pipeline", + "description": "The label for category API 流水线 in sidebar docs" + }, + "sidebar.docs.category.模型微调": { + "message": "Fine-tuning", + "description": "The label for category 模型微调 in sidebar docs" + }, + "sidebar.docs.category.AI 应用市场": { + "message": "AI Application Market", + "description": "The label for category AI 应用市场 in sidebar docs" + }, + "sidebar.docs.category.第三方应用集成指南": { + "message": "Third-Party Application Integration Guide", + "description": "The label for category 第三方应用集成指南 in sidebar docs" + }, + "sidebar.docs.category.开发工具": { + "message": "Development Tools", + "description": "The label for category 开发工具 in sidebar docs" + }, + "sidebar.docs.category. AI 助手": { + "message": "AI Assistant", + "description": "The label for category AI 助手 in sidebar docs" + }, + "sidebar.docs.category.浏览器插件": { + "message": "Browser extension", + "description": "The label for category 浏览器插件 in sidebar docs" + }, + "sidebar.docs.category.账号与组织管理": { + "message": "Account and Organization Management", + "description": "The label for category 账号与组织管理 in sidebar docs" + }, + "sidebar.docs.category.资源包与计费": { + "message": "Resource package and billing", + "description": "The label for category 资源包与计费 in sidebar docs" + }, + "sidebar.docs.category.附录": { + "message": "Appendix", + "description": "The label for category 附录 in sidebar docs" + }, + "sidebar.docs.category.算力市场": { + "message": "Reserved GPUs", + "description": "The label for category 算力市场 in sidebar docs" + }, + "sidebar.docs.category.Functional Practice": { + "message": "Functional Practice", + "description": "The label for category Functional Practice in sidebar docs" + } +} diff --git a/i18n/en/docusaurus-theme-classic/code.json b/i18n/en/docusaurus-theme-classic/code.json new file mode 100644 index 0000000000000000000000000000000000000000..054fce872d4dc8e21514cf9631f05a72123ba797 --- /dev/null +++ b/i18n/en/docusaurus-theme-classic/code.json @@ -0,0 +1,369 @@ +{ + "serverless": { + "category-label": "Category:", + "all-categories": "All Categories", + "total-services": "Total {{serviceCount}} models, {{operationCount}} operations", + "model-name": "Model Name", + "category": "Category", + "description": "Description", + "interface": "Interface" + }, + "theme.ErrorPageContent.title": { + "message": "This page crashed.", + "description": "The title of the fallback page when the page crashed" + }, + "theme.blog.archive.title": { + "message": "Archive", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "Archive", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "Scroll back to top", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "Blog list page navigation", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "Newer entries", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "Older entries", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "Blog post page navigation", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "Newer post", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "Older post", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.tags.tagsPageLink": { + "message": "View all tags", + "description": "The label of the link targeting the tag list page" + }, + "theme.colorToggle.ariaLabel.mode.system": { + "message": "system mode", + "description": "The name for the system color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "light mode", + "description": "The name for the light color mode" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "dark mode", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel": { + "message": "Switch between dark and light mode (currently {mode})", + "description": "The ARIA label for the color mode toggle" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "Breadcrumbs", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.DocCard.categoryDescription.plurals": { + "message": "1 item|{count} items", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "Docs pages", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "Previous", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "Next", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "One doc tagged|{count} docs tagged", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged} with \"{tagName}\"", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "Version: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "latest version", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "Edit this page", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "Direct link to {heading}", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " on {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " by {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "Last updated{atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "Versions", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.NotFound.title": { + "message": "Page Not Found", + "description": "The title of the 404 page" + }, + "theme.tags.tagsListLabel": { + "message": "Tags:", + "description": "The label alongside a tag list" + }, + "theme.admonition.caution": { + "message": "caution", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.admonition.danger": { + "message": "danger", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "info", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.note": { + "message": "note", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "tip", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.warning": { + "message": "warning", + "description": "The default label used for the Warning admonition (:::warning)" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Close", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.DocSidebarItem.expandCategoryAriaLabel": { + "message": "Expand sidebar category '{label}'", + "description": "The ARIA label to expand the sidebar category" + }, + "theme.DocSidebarItem.collapseCategoryAriaLabel": { + "message": "Collapse sidebar category '{label}'", + "description": "The ARIA label to collapse the sidebar category" + }, + "theme.NavBar.navAriaLabel": { + "message": "Main", + "description": "The ARIA label for the main navigation" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "Languages", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.NotFound.p1": { + "message": "We could not find what you were looking for.", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.blog.post.readMore": { + "message": "Read more", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "Read more about {title}", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "One min read|{readingTime} min read", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.CodeBlock.copy": { + "message": "Copy", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.copied": { + "message": "Copied", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "Copy code to clipboard", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "Toggle word wrap", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.docs.breadcrumbs.home": { + "message": "Home page", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "Collapse sidebar", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "Collapse sidebar", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "Docs sidebar", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "Close navigation bar", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "Toggle navigation bar", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": { + "message": "Expand the dropdown", + "description": "The ARIA label of the button to expand the mobile dropdown navbar item" + }, + "theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": { + "message": "Collapse the dropdown", + "description": "The ARIA label of the button to collapse the mobile dropdown navbar item" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "Expand sidebar", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "Expand sidebar", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.SearchBar.noResultsText": { + "message": "No results" + }, + "theme.SearchBar.seeAllOutsideContext": { + "message": "See all results outside \"{context}\"" + }, + "theme.SearchBar.searchInContext": { + "message": "See all results within \"{context}\"" + }, + "theme.SearchBar.seeAll": { + "message": "See all results" + }, + "theme.SearchBar.label": { + "message": "Search", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "Search results for \"{query}\"", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "Search the documentation", + "description": "The search page title for empty query" + }, + "theme.SearchPage.searchContext.everywhere": { + "message": "Everywhere" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "1 document found|{count} documents found", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.noResultsText": { + "message": "No documents were found", + "description": "The paragraph for empty search result" + }, + "theme.blog.post.plurals": { + "message": "One post|{count} posts", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} tagged with \"{tagName}\"", + "description": "The title of the page for a blog tag" + }, + "theme.blog.author.pageTitle": { + "message": "{authorName} - {nPosts}", + "description": "The title of the page for a blog author" + }, + "theme.blog.authorsList.pageTitle": { + "message": "Authors", + "description": "The title of the authors page" + }, + "theme.blog.authorsList.viewAll": { + "message": "View all authors", + "description": "The label of the link targeting the blog authors page" + }, + "theme.blog.author.noPosts": { + "message": "This author has not written any posts yet.", + "description": "The text for authors with 0 blog post" + }, + "theme.contentVisibility.unlistedBanner.title": { + "message": "Unlisted page", + "description": "The unlisted content banner title" + }, + "theme.contentVisibility.unlistedBanner.message": { + "message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.", + "description": "The unlisted content banner message" + }, + "theme.contentVisibility.draftBanner.title": { + "message": "Draft page", + "description": "The draft content banner title" + }, + "theme.contentVisibility.draftBanner.message": { + "message": "This page is a draft. It will only be visible in dev and be excluded from the production build.", + "description": "The draft content banner message" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "Try again", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.common.skipToMainContent": { + "message": "Skip to main content", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "Tags", + "description": "The title of the tag list page" + } +} diff --git a/i18n/en/docusaurus-theme-classic/footer.json b/i18n/en/docusaurus-theme-classic/footer.json new file mode 100644 index 0000000000000000000000000000000000000000..1fd7db5de5d0df714ee5968ab3c08dd0f8a85752 --- /dev/null +++ b/i18n/en/docusaurus-theme-classic/footer.json @@ -0,0 +1,6 @@ +{ + "copyright": { + "message": "Copyright © 2025 Moark AI", + "description": "The footer copyright" + } +} diff --git a/i18n/en/docusaurus-theme-classic/navbar.json b/i18n/en/docusaurus-theme-classic/navbar.json new file mode 100644 index 0000000000000000000000000000000000000000..5f8823b47466d2a0c71db397e1aadeddf208ca2c --- /dev/null +++ b/i18n/en/docusaurus-theme-classic/navbar.json @@ -0,0 +1,122 @@ +{ + "logo.alt": { + "message": "moark logo", + "description": "The alt text of navbar logo" + }, + "item.label.模型广场": { + "message": "模型广场", + "description": "Navbar item with label 模型广场" + }, + "item.label.AI 应用市场": { + "message": "AI 应用市场", + "description": "Navbar item with label AI 应用市场" + }, + "item.label.模型下载": { + "message": "模型下载", + "description": "Navbar item with label 模型下载" + }, + "item.label.解决方案": { + "message": "解决方案", + "description": "Navbar item with label 解决方案" + }, + "item.label.专区": { + "message": "专区", + "description": "Navbar item with label 专区" + }, + "item.label.文档": { + "message": "文档", + "description": "Navbar item with label 文档" + }, + "item.label.数据集下载": { + "message": "数据集下载", + "description": "Navbar item with label 数据集下载" + }, + "item.label.模型引擎": { + "message": "模型引擎", + "description": "Navbar item with label 模型引擎" + }, + "item.label.应用引擎": { + "message": "应用引擎", + "description": "Navbar item with label 应用引擎" + }, + "item.label.GiEngine 高速推理引擎": { + "message": "GiEngine 高速推理引擎", + "description": "Navbar item with label GiEngine 高速推理引擎" + }, + "item.label.分布式算力网络": { + "message": "分布式算力网络", + "description": "Navbar item with label 分布式算力网络" + }, + "item.label.模型微调服务": { + "message": "模型微调服务", + "description": "Navbar item with label 模型微调服务" + }, + "item.label.昇腾计算": { + "message": "昇腾计算", + "description": "Navbar item with label 昇腾计算" + }, + "item.label.昇腾 AI 开发板": { + "message": "昇腾 AI 开发板", + "description": "Navbar item with label 昇腾 AI 开发板" + }, + "item.label.天数智芯": { + "message": "天数智芯", + "description": "Navbar item with label 天数智芯" + }, + "item.label.沐曦": { + "message": "沐曦", + "description": "Navbar item with label 沐曦" + }, + "item.label.科华(壁仞)": { + "message": "科华(壁仞)", + "description": "Navbar item with label 科华(壁仞)" + }, + "item.label.燧原": { + "message": "燧原", + "description": "Navbar item with label 燧原" + }, + "item.label.国产大模型": { + "message": "国产大模型", + "description": "Navbar item with label 国产大模型" + }, + "item.label.AI 编程": { + "message": "AI 编程", + "description": "Navbar item with label AI 编程" + }, + "item.label.应用市场": { + "message": "应用市场", + "description": "Navbar item with label 应用市场" + }, + "item.label.算力市场": { + "message": "算力市场", + "description": "Navbar item with label 算力市场" + }, + "item.label.Models": { + "message": "Models", + "description": "Navbar item with label Models" + }, + "item.label.Products": { + "message": "Products", + "description": "Navbar item with label Products" + }, + "item.label.Pricing": { + "message": "Pricing", + "description": "Navbar item with label Pricing" + }, + "item.label.Docs": { + "message": "Docs", + "description": "Navbar item with label Docs" + }, + "item.label.Serverless Inference": { + "message": "Serverless Inference", + "description": "Navbar item with label Serverless Inference" + }, + "item.label.Fine-tuning": { + "message": "Fine-tuning", + "description": "Navbar item with label Fine-tuning" + }, + "item.label.Reserved GPUs": { + "message": "Reserved GPUs", + "description": "Navbar item with label Reserved GPUs" + } +} diff --git a/i18n/zh-Hans/code.json b/i18n/zh-Hans/code.json new file mode 100644 index 0000000000000000000000000000000000000000..b6f9b151dc52f98a4ff1656363e0b6af69bd8a51 --- /dev/null +++ b/i18n/zh-Hans/code.json @@ -0,0 +1,366 @@ +{ + "navbar.user_guides": { + "message": "使用指南" + }, + "navbar.api_reference": { + "message": "接口文档" + }, + "theme.ErrorPageContent.title": { + "message": "页面已崩溃。", + "description": "The title of the fallback page when the page crashed" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "回到顶部", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.archive.title": { + "message": "历史博文", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "历史博文", + "description": "The page & hero description of the blog archive page" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "博文列表分页导航", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "较新的博文", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "较旧的博文", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "博文分页导航", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "较新一篇", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "较旧一篇", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.tags.tagsPageLink": { + "message": "查看所有标签", + "description": "The label of the link targeting the tag list page" + }, + "theme.colorToggle.ariaLabel.mode.system": { + "message": "system mode", + "description": "The name for the system color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "浅色模式", + "description": "The name for the light color mode" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "暗黑模式", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel": { + "message": "切换浅色/暗黑模式(当前为{mode})", + "description": "The ARIA label for the color mode toggle" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "页面路径", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.DocCard.categoryDescription.plurals": { + "message": "{count} 个项目", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "文件选项卡", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "上一页", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "下一页", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "{count} 篇文档带有标签", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged}「{tagName}」", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "版本:{versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "最新版本", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "编辑此页", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "{heading}的直接链接", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": "于 {date} ", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": "由 {user} ", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "最后{byUser}{atDate}更新", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.NotFound.title": { + "message": "找不到页面", + "description": "The title of the 404 page" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "选择版本", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.tags.tagsListLabel": { + "message": "标签:", + "description": "The label alongside a tag list" + }, + "theme.admonition.caution": { + "message": "警告", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.admonition.danger": { + "message": "危险", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "信息", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.note": { + "message": "备注", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "提示", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.warning": { + "message": "注意", + "description": "The default label used for the Warning admonition (:::warning)" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "关闭", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "最近博文导航", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.DocSidebarItem.expandCategoryAriaLabel": { + "message": "展开侧边栏分类 '{label}'", + "description": "The ARIA label to expand the sidebar category" + }, + "theme.DocSidebarItem.collapseCategoryAriaLabel": { + "message": "折叠侧边栏分类 '{label}'", + "description": "The ARIA label to collapse the sidebar category" + }, + "theme.NavBar.navAriaLabel": { + "message": "主导航", + "description": "The ARIA label for the main navigation" + }, + "theme.NotFound.p1": { + "message": "我们找不到您要找的页面。", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "选择语言", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "本页总览", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.blog.post.readMore": { + "message": "阅读更多", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "阅读 {title} 的全文", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "阅读需 {readingTime} 分钟", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.CodeBlock.copy": { + "message": "复制", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.copied": { + "message": "复制成功", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "复制代码到剪贴板", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "切换自动换行", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.docs.breadcrumbs.home": { + "message": "主页面", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "文档侧边栏", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "关闭导航栏", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← 回到主菜单", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "切换导航栏", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": { + "message": "Expand the dropdown", + "description": "The ARIA label of the button to expand the mobile dropdown navbar item" + }, + "theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": { + "message": "Collapse the dropdown", + "description": "The ARIA label of the button to collapse the mobile dropdown navbar item" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.SearchBar.noResultsText": { + "message": "没有找到任何文档" + }, + "theme.SearchBar.seeAllOutsideContext": { + "message": "查看“{context}”以外的全部结果" + }, + "theme.SearchBar.searchInContext": { + "message": "查看“{context}”以内的全部结果" + }, + "theme.SearchBar.seeAll": { + "message": "查看全部结果" + }, + "theme.SearchBar.label": { + "message": "搜索", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "“{query}”的搜索结果", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "搜索文档", + "description": "The search page title for empty query" + }, + "theme.SearchPage.searchContext.everywhere": { + "message": "所有" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "共找到 {count} 篇文档", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.noResultsText": { + "message": "没有找到任何文档", + "description": "The paragraph for empty search result" + }, + "theme.blog.post.plurals": { + "message": "{count} 篇博文", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} 含有标签「{tagName}」", + "description": "The title of the page for a blog tag" + }, + "theme.blog.author.pageTitle": { + "message": "{authorName} - {nPosts}", + "description": "The title of the page for a blog author" + }, + "theme.blog.authorsList.pageTitle": { + "message": "作者", + "description": "The title of the authors page" + }, + "theme.blog.authorsList.viewAll": { + "message": "查看所有作者", + "description": "The label of the link targeting the blog authors page" + }, + "theme.blog.author.noPosts": { + "message": "该作者尚未撰写任何文章。", + "description": "The text for authors with 0 blog post" + }, + "theme.contentVisibility.unlistedBanner.title": { + "message": "未列出页", + "description": "The unlisted content banner title" + }, + "theme.contentVisibility.unlistedBanner.message": { + "message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。", + "description": "The unlisted content banner message" + }, + "theme.contentVisibility.draftBanner.title": { + "message": "草稿页", + "description": "The draft content banner title" + }, + "theme.contentVisibility.draftBanner.message": { + "message": "此页面是草稿,仅在开发环境中可见,不会包含在正式版本中。", + "description": "The draft content banner message" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "重试", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.common.skipToMainContent": { + "message": "跳到主要内容", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "标签", + "description": "The title of the tag list page" + } +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-blog/options.json b/i18n/zh-Hans/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000000000000000000000000000000..9239ff706c28811b3931968257fffe5465d4cb0e --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Recent posts", + "description": "The label for the left sidebar" + } +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json new file mode 100644 index 0000000000000000000000000000000000000000..41965fc83f6c9d9d0a776d068158cca6b11c0773 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,82 @@ +{ + "version.label": { + "message": "Next", + "description": "The label for version current" + }, + "sidebar.docs.category.功能实践": { + "message": "功能实践", + "description": "The label for category 功能实践 in sidebar docs" + }, + "sidebar.docs.category.🔥 模型广场 (Serverless API)": { + "message": "🔥 模型广场 (Serverless API)", + "description": "The label for category 🔥 模型广场 (Serverless API) in sidebar docs" + }, + "sidebar.docs.category.文本生成与补全": { + "message": "文本生成与补全", + "description": "The label for category 文本生成与补全 in sidebar docs" + }, + "sidebar.docs.category.图像与视觉": { + "message": "图像与视觉", + "description": "The label for category 图像与视觉 in sidebar docs" + }, + "sidebar.docs.category.语音识别与合成": { + "message": "语音识别与合成", + "description": "The label for category 语音识别与合成 in sidebar docs" + }, + "sidebar.docs.category.文档处理/OCR": { + "message": "文档处理/OCR", + "description": "The label for category 文档处理/OCR in sidebar docs" + }, + "sidebar.docs.category.模型库": { + "message": "模型库", + "description": "The label for category 模型库 in sidebar docs" + }, + "sidebar.docs.category.数据集": { + "message": "数据集", + "description": "The label for category 数据集 in sidebar docs" + }, + "sidebar.docs.category.API 流水线": { + "message": "API 流水线", + "description": "The label for category API 流水线 in sidebar docs" + }, + "sidebar.docs.category.模型微调": { + "message": "模型微调", + "description": "The label for category 模型微调 in sidebar docs" + }, + "sidebar.docs.category.AI 应用市场": { + "message": "AI 应用市场", + "description": "The label for category AI 应用市场 in sidebar docs" + }, + "sidebar.docs.category.算力市场": { + "message": "算力市场", + "description": "The label for category 算力市场 in sidebar docs" + }, + "sidebar.docs.category.第三方应用集成指南": { + "message": "第三方应用集成指南", + "description": "The label for category 第三方应用集成指南 in sidebar docs" + }, + "sidebar.docs.category.开发工具": { + "message": "开发工具", + "description": "The label for category 开发工具 in sidebar docs" + }, + "sidebar.docs.category. AI 助手": { + "message": " AI 助手", + "description": "The label for category AI 助手 in sidebar docs" + }, + "sidebar.docs.category.浏览器插件": { + "message": "浏览器插件", + "description": "The label for category 浏览器插件 in sidebar docs" + }, + "sidebar.docs.category.账号与组织管理": { + "message": "账号与组织管理", + "description": "The label for category 账号与组织管理 in sidebar docs" + }, + "sidebar.docs.category.资源包与计费": { + "message": "资源包与计费", + "description": "The label for category 资源包与计费 in sidebar docs" + }, + "sidebar.docs.category.附录": { + "message": "附录", + "description": "The label for category 附录 in sidebar docs" + } +} diff --git a/i18n/zh-Hans/docusaurus-theme-classic/footer.json b/i18n/zh-Hans/docusaurus-theme-classic/footer.json new file mode 100644 index 0000000000000000000000000000000000000000..344b959dbec8df94dc1f7d3e01e268ddc8dc1bd2 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-theme-classic/footer.json @@ -0,0 +1,6 @@ +{ + "copyright": { + "message": "Copyright © 2025 模力方舟.", + "description": "The footer copyright" + } +} diff --git a/i18n/zh-Hans/docusaurus-theme-classic/navbar.json b/i18n/zh-Hans/docusaurus-theme-classic/navbar.json new file mode 100644 index 0000000000000000000000000000000000000000..74aeb6dc0e4769ce3f74d74c1f52c4bf9180b134 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-theme-classic/navbar.json @@ -0,0 +1,66 @@ +{ + "logo.alt": { + "message": "moark logo", + "description": "The alt text of navbar logo" + }, + "item.label.模型广场": { + "message": "模型广场", + "description": "Navbar item with label 模型广场" + }, + "item.label.应用市场": { + "message": "应用市场", + "description": "Navbar item with label 应用市场" + }, + "item.label.算力市场": { + "message": "算力市场", + "description": "Navbar item with label 算力市场" + }, + "item.label.模型下载": { + "message": "模型下载", + "description": "Navbar item with label 模型下载" + }, + "item.label.专区": { + "message": "专区", + "description": "Navbar item with label 专区" + }, + "item.label.文档": { + "message": "文档", + "description": "Navbar item with label 文档" + }, + "item.label.数据集下载": { + "message": "数据集下载", + "description": "Navbar item with label 数据集下载" + }, + "item.label.昇腾计算": { + "message": "昇腾计算", + "description": "Navbar item with label 昇腾计算" + }, + "item.label.昇腾 AI 开发板": { + "message": "昇腾 AI 开发板", + "description": "Navbar item with label 昇腾 AI 开发板" + }, + "item.label.天数智芯": { + "message": "天数智芯", + "description": "Navbar item with label 天数智芯" + }, + "item.label.沐曦": { + "message": "沐曦", + "description": "Navbar item with label 沐曦" + }, + "item.label.科华(壁仞)": { + "message": "科华(壁仞)", + "description": "Navbar item with label 科华(壁仞)" + }, + "item.label.燧原": { + "message": "燧原", + "description": "Navbar item with label 燧原" + }, + "item.label.国产大模型": { + "message": "国产大模型", + "description": "Navbar item with label 国产大模型" + }, + "item.label.AI 编程": { + "message": "AI 编程", + "description": "Navbar item with label AI 编程" + } +} diff --git a/package.json b/package.json index 6b92916064d693500e3c6de03d150671165eb5ee..42f41ccaee8bb28dfaa4756b445e0f3a43153216 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,14 @@ "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", + "start:overseas": "docusaurus start --config docusaurus.config.overseas.ts", "build": "docusaurus build", + "build:overseas": "docusaurus build --config docusaurus.config.overseas.ts", "swizzle": "docusaurus swizzle", - "deploy": "GITHUB_HOST=gitee.com docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", + "write-translations:overseas": "docusaurus write-translations --config docusaurus.config.overseas.ts", "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc", "postinstall": "patch-package" diff --git a/sidebars.overseas.ts b/sidebars.overseas.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7b50a37cad99a8d85874aaec6224a794cb0583b --- /dev/null +++ b/sidebars.overseas.ts @@ -0,0 +1,19 @@ +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +/** + * Creating a sidebar enables you to: + - create an ordered group of docs + - render a sidebar for each doc of that group + - provide next/previous navigation + + The sidebars can be generated from the filesystem, or explicitly defined here. + + Create as many sidebars as you want. + */ +const sidebars: SidebarsConfig = { + // By default, Docusaurus generates a sidebar from the docs folder structure + // tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], + docs: [{ type: 'autogenerated', dirName: '.' }], +}; + +export default sidebars; diff --git a/src/css/custom.css b/src/css/custom.css index bafb69e714b0e3ad71f936e4e7a04fa29cd75cab..89fb2d6f03c454241e796271ee2b76e493dd170e 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -283,6 +283,13 @@ div[id^='headlessui-disclosure-panel'] tr td.relative:nth-child(2) { } } +.gai-navbar-item-disable { + pointer-events: none; + color: gray; /* 可选:通常也会调整样式提示不可点击 */ + text-decoration: none; /* 可选:去除下划线 */ + cursor: default; /* 可选:鼠标样式 */ +} + /* 修复左侧边栏样式,使其固定不滚动 */ .t-doc__sidebar { max-height: calc(100dvh - (var(--ifm-navbar-height) * 2)) !important; diff --git a/src/theme/Navbar/index.tsx b/src/theme/Navbar/index.tsx index e25d5170d4a9fa03efe316db08d7967248393fa1..5f7da527556b2611be4d46733406a6ba1c15157b 100644 --- a/src/theme/Navbar/index.tsx +++ b/src/theme/Navbar/index.tsx @@ -3,9 +3,10 @@ import NavbarLayout from '@theme/Navbar/Layout'; import NavbarContent from '@theme/Navbar/Content'; import clsx from 'clsx'; import { useLocation } from 'react-router-dom'; +import { translate } from '@docusaurus/Translate'; import style from './style.module.css'; -export default function NavBar(): JSX.Element { +export default function NavBar() { const location = useLocation(); const isActive = (path) => { @@ -26,7 +27,7 @@ export default function NavBar(): JSX.Element { className={clsx(style.navItem, isIntroActive() && style.active)} href="/docs" > - 使用指南 + {translate({ message: 'User Guides', id: 'navbar.user_guides' })} - 接口文档 + {translate({ + message: 'API Reference', + id: 'navbar.api_reference', + })} diff --git a/static/img/logo-overseas-full.svg b/static/img/logo-overseas-full.svg new file mode 100644 index 0000000000000000000000000000000000000000..95000b37bc51e02c0ff68407145fbe73b63ab063 --- /dev/null +++ b/static/img/logo-overseas-full.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +