From 8a5df2f5efb3bc56db3805c0aae97b8371ca3e2d Mon Sep 17 00:00:00 2001 From: imeepos Date: Mon, 18 Aug 2025 10:38:52 +0800 Subject: [PATCH] Add text-video-agent Rust SDK and update OpenAPI documentation --- cargos/text-video-agent-rust-sdk/.gitignore | 3 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 50 + .../.openapi-generator/VERSION | 1 + cargos/text-video-agent-rust-sdk/.travis.yml | 1 + cargos/text-video-agent-rust-sdk/CHANGELOG.md | 71 + cargos/text-video-agent-rust-sdk/Cargo.toml | 27 + .../text-video-agent-rust-sdk/LICENSE-APACHE | 200 + cargos/text-video-agent-rust-sdk/LICENSE-MIT | 21 + cargos/text-video-agent-rust-sdk/README.md | 276 ++ .../text-video-agent-rust-sdk/docs/Api0Api.md | 285 ++ .../text-video-agent-rust-sdk/docs/ApiApi.md | 131 + .../docs/Class302Api.md | 155 + .../docs/Class302aiApiApi.md | 104 + .../docs/Class302aiMidjourneyApi.md | 290 ++ .../docs/Class302aiVeoApi.md | 102 + .../docs/ComfyuiApi.md | 124 + .../docs/DefaultApi.md | 34 + .../docs/FileUploadResponse.md | 13 + .../docs/Hedra20Api.md | 96 + .../docs/Hedra30Api.md | 100 + .../docs/HttpValidationError.md | 11 + .../text-video-agent-rust-sdk/docs/LlmApi.md | 219 ++ .../docs/MidjourneyApi.md | 256 ++ .../docs/MidjourneyapiApi.md | 125 + .../docs/OmniHumanApi.md | 104 + .../docs/TaskRequest.md | 14 + .../docs/ValidationError.md | 13 + .../docs/ValidationErrorLocInner.md | 10 + .../examples/simple_usage.rs | 38 + cargos/text-video-agent-rust-sdk/git_push.sh | 57 + .../src/apis/api_0_api.rs | 474 +++ .../src/apis/api_api.rs | 236 ++ .../src/apis/class302_api.rs | 259 ++ .../src/apis/class302ai_api_api.rs | 189 + .../src/apis/class302ai_midjourney_api.rs | 497 +++ .../src/apis/class302ai_veo_api.rs | 173 + .../src/apis/comfyui_api.rs | 204 + .../src/apis/configuration.rs | 51 + .../src/apis/default_api.rs | 59 + .../src/apis/hedra20_api.rs | 159 + .../src/apis/hedra30_api.rs | 175 + .../src/apis/llm_api.rs | 365 ++ .../src/apis/midjourney_api.rs | 426 +++ .../src/apis/midjourneyapi_api.rs | 210 ++ .../text-video-agent-rust-sdk/src/apis/mod.rs | 128 + .../src/apis/omni_human_api.rs | 177 + cargos/text-video-agent-rust-sdk/src/lib.rs | 11 + .../src/models/file_upload_response.rs | 37 + .../src/models/http_validation_error.rs | 27 + .../src/models/mod.rs | 10 + .../src/models/task_request.rs | 38 + .../src/models/validation_error.rs | 33 + .../src/models/validation_error_loc_inner.rs | 24 + openapi.json | 3314 ++++++++++++----- openapi.md | 870 +++-- openapitools.json | 7 + 57 files changed, 9933 insertions(+), 1174 deletions(-) create mode 100644 cargos/text-video-agent-rust-sdk/.gitignore create mode 100644 cargos/text-video-agent-rust-sdk/.openapi-generator-ignore create mode 100644 cargos/text-video-agent-rust-sdk/.openapi-generator/FILES create mode 100644 cargos/text-video-agent-rust-sdk/.openapi-generator/VERSION create mode 100644 cargos/text-video-agent-rust-sdk/.travis.yml create mode 100644 cargos/text-video-agent-rust-sdk/CHANGELOG.md create mode 100644 cargos/text-video-agent-rust-sdk/Cargo.toml create mode 100644 cargos/text-video-agent-rust-sdk/LICENSE-APACHE create mode 100644 cargos/text-video-agent-rust-sdk/LICENSE-MIT create mode 100644 cargos/text-video-agent-rust-sdk/README.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Api0Api.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/ApiApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Class302Api.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Class302aiApiApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Class302aiMidjourneyApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Class302aiVeoApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/ComfyuiApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/DefaultApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/FileUploadResponse.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Hedra20Api.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/Hedra30Api.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/HttpValidationError.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/LlmApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/MidjourneyApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/MidjourneyapiApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/OmniHumanApi.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/TaskRequest.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/ValidationError.md create mode 100644 cargos/text-video-agent-rust-sdk/docs/ValidationErrorLocInner.md create mode 100644 cargos/text-video-agent-rust-sdk/examples/simple_usage.rs create mode 100644 cargos/text-video-agent-rust-sdk/git_push.sh create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/api_0_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/api_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/class302_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/class302ai_api_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/class302ai_midjourney_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/class302ai_veo_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/comfyui_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/configuration.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/default_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/hedra20_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/hedra30_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/llm_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/midjourney_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/midjourneyapi_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/mod.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/apis/omni_human_api.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/lib.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/file_upload_response.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/http_validation_error.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/mod.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/task_request.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/validation_error.rs create mode 100644 cargos/text-video-agent-rust-sdk/src/models/validation_error_loc_inner.rs create mode 100644 openapitools.json diff --git a/cargos/text-video-agent-rust-sdk/.gitignore b/cargos/text-video-agent-rust-sdk/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/cargos/text-video-agent-rust-sdk/.openapi-generator-ignore b/cargos/text-video-agent-rust-sdk/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/cargos/text-video-agent-rust-sdk/.openapi-generator/FILES b/cargos/text-video-agent-rust-sdk/.openapi-generator/FILES new file mode 100644 index 0000000..ce7b556 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/.openapi-generator/FILES @@ -0,0 +1,50 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Api0Api.md +docs/ApiApi.md +docs/Class302Api.md +docs/Class302aiApiApi.md +docs/Class302aiMidjourneyApi.md +docs/Class302aiVeoApi.md +docs/ComfyuiApi.md +docs/DefaultApi.md +docs/DefaultApi.md +docs/FileUploadResponse.md +docs/Hedra20Api.md +docs/Hedra30Api.md +docs/HttpValidationError.md +docs/LlmApi.md +docs/MidjourneyApi.md +docs/MidjourneyapiApi.md +docs/OmniHumanApi.md +docs/TaskRequest.md +docs/ValidationError.md +docs/ValidationErrorLocInner.md +git_push.sh +src/apis/api_0_api.rs +src/apis/api_api.rs +src/apis/class302_api.rs +src/apis/class302ai_api_api.rs +src/apis/class302ai_midjourney_api.rs +src/apis/class302ai_veo_api.rs +src/apis/comfyui_api.rs +src/apis/configuration.rs +src/apis/default_api.rs +src/apis/default_api.rs +src/apis/hedra20_api.rs +src/apis/hedra30_api.rs +src/apis/llm_api.rs +src/apis/midjourney_api.rs +src/apis/midjourneyapi_api.rs +src/apis/mod.rs +src/apis/omni_human_api.rs +src/lib.rs +src/models/file_upload_response.rs +src/models/http_validation_error.rs +src/models/mod.rs +src/models/task_request.rs +src/models/validation_error.rs +src/models/validation_error_loc_inner.rs diff --git a/cargos/text-video-agent-rust-sdk/.openapi-generator/VERSION b/cargos/text-video-agent-rust-sdk/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/cargos/text-video-agent-rust-sdk/.travis.yml b/cargos/text-video-agent-rust-sdk/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/cargos/text-video-agent-rust-sdk/CHANGELOG.md b/cargos/text-video-agent-rust-sdk/CHANGELOG.md new file mode 100644 index 0000000..54b05f7 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/CHANGELOG.md @@ -0,0 +1,71 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.6] - 2024-12-19 + +### Added +- Initial release of the Text Video Agent Rust client +- Complete API coverage for Text Video Agent API v1.0.6 +- Support for all major API categories: + - Image generation (multiple models) + - Video generation (multiple providers) + - Audio synthesis and voice cloning + - Lip sync with Hedra 2.0 and 3.0 + - Digital human creation and animation + - LLM integration with multi-modal analysis + - ComfyUI workflow execution + - File upload and management + - Template management +- Async/await support with `reqwest` and `tokio` +- Type-safe API with comprehensive error handling +- Multipart form data support for file uploads +- Examples demonstrating basic usage and advanced features +- Complete documentation and README + +### Features +- **DefaultApi**: Core functionality, templates, file operations +- **ApiApi**: Task management and basic operations +- **Class302Api**: 302AI integration services +- **Class302aiApiApi**: 302AI JiMeng video generation +- **Class302aiMidjourneyApi**: 302AI Midjourney integration +- **Class302aiVeoApi**: 302AI VEO video generation +- **ComfyuiApi**: ComfyUI workflow execution +- **Hedra20Api**: Hedra 2.0 lip sync services +- **Hedra30Api**: Hedra 3.0 lip sync services +- **LlmApi**: Large Language Model integration +- **MidjourneyApi**: Midjourney image generation +- **MidjourneyapiApi**: Midjourney video generation +- **OmniHumanApi**: Digital human services + +### Technical Details +- Generated from OpenAPI 3.1 specification +- Built with OpenAPI Generator 7.14.0 +- Rust edition 2021 +- MIT OR Apache-2.0 dual license +- Comprehensive test coverage (auto-generated) +- Full documentation with examples + +### Dependencies +- `serde` ^1.0 with derive feature +- `serde_with` ^3.8 for advanced serialization +- `serde_json` ^1.0 for JSON handling +- `serde_repr` ^0.1 for enum representations +- `url` ^2.5 for URL parsing +- `reqwest` ^0.12 with JSON and multipart support + +### Examples +- Basic usage example showing health checks and model queries +- Advanced image and video generation example +- Task status polling implementation +- File upload handling patterns + +### Documentation +- Complete API reference +- Usage examples +- Integration guide +- Error handling patterns +- Best practices for async operations diff --git a/cargos/text-video-agent-rust-sdk/Cargo.toml b/cargos/text-video-agent-rust-sdk/Cargo.toml new file mode 100644 index 0000000..aaf8af8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "text_video_agent_client" +version = "1.0.6" +authors = ["OpenAPI Generator team and contributors"] +description = "Rust client for Text Video Agent API - A comprehensive AI content generation service supporting image generation, video generation, audio synthesis, lip sync, digital human creation, and LLM inference" +keywords = ["api", "client", "video", "ai", "generation"] +categories = ["api-bindings", "multimedia", "web-programming::http-client"] +license = "MIT OR Apache-2.0" +edition = "2021" +repository = "https://github.com/your-repo/text-video-agent-rust-sdk" +homepage = "https://github.com/your-repo/text-video-agent-rust-sdk" +documentation = "https://docs.rs/text_video_agent_client" +readme = "README.md" + +[workspace] +# This is a standalone package, not part of a workspace + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } + +[dev-dependencies] +tokio = { version = "1.0", features = ["full"] } diff --git a/cargos/text-video-agent-rust-sdk/LICENSE-APACHE b/cargos/text-video-agent-rust-sdk/LICENSE-APACHE new file mode 100644 index 0000000..7266c9c --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/LICENSE-APACHE @@ -0,0 +1,200 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (which shall not include communications that are solely written + by individuals acting on their own behalf as opposed to on behalf + of the copyright owner or entity granting the License). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based upon (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and derivative works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control + systems, and issue tracking systems that are managed by, or on behalf + of, the Licensor for the purpose of discussing and improving the Work, + but excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to use, reproduce, modify, display, perform, + sublicense, and distribute the Work and such Derivative Works in + Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright notice to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Support. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or other liability + obligations and/or rights consistent with this License. However, in + accepting such obligations, You may act only on Your own behalf and on + Your sole responsibility, not on behalf of any other Contributor, and + only if You agree to indemnify, defend, and hold each Contributor + harmless for any liability incurred by, or claims asserted against, + such Contributor by reason of your accepting any such warranty or support. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same page as the copyright notice for easier identification within + third-party archives. + + Copyright 2024 Text Video Agent Client + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cargos/text-video-agent-rust-sdk/LICENSE-MIT b/cargos/text-video-agent-rust-sdk/LICENSE-MIT new file mode 100644 index 0000000..b733a95 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/LICENSE-MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Text Video Agent Client + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cargos/text-video-agent-rust-sdk/README.md b/cargos/text-video-agent-rust-sdk/README.md new file mode 100644 index 0000000..9e27170 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/README.md @@ -0,0 +1,276 @@ +# Text Video Agent Client + +[![Crates.io](https://img.shields.io/crates/v/text_video_agent_client.svg)](https://crates.io/crates/text_video_agent_client) +[![Documentation](https://docs.rs/text_video_agent_client/badge.svg)](https://docs.rs/text_video_agent_client) +[![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](https://github.com/your-repo/text-video-agent-rust-sdk) + +A comprehensive Rust client for the Text Video Agent API - an AI content generation service that supports: + +- 🎨 **Image Generation** - Multiple AI models (Midjourney, Stable Diffusion, etc.) +- 🎬 **Video Generation** - Text-to-video and image-to-video conversion +- 🎵 **Audio Synthesis** - Text-to-speech and voice cloning +- 💋 **Lip Sync** - Advanced lip synchronization with Hedra +- 🤖 **Digital Human** - Create and animate digital avatars +- 🧠 **LLM Integration** - Multi-modal AI analysis and inference +- 🔧 **Workflow Automation** - ComfyUI workflow execution + +## Features + +- **Type-safe API** - Generated from OpenAPI 3.1 specification +- **Async/await support** - Built on `reqwest` and `tokio` +- **Comprehensive coverage** - All API endpoints included +- **File upload support** - Multipart form data handling +- **Error handling** - Structured error responses +- **Documentation** - Complete API documentation + +## Installation + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +text_video_agent_client = "1.0.6" +tokio = { version = "1.0", features = ["full"] } +``` + +## Quick Start + +```rust +use text_video_agent_client::{apis::configuration::Configuration, apis::default_api}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let config = Configuration { + base_path: "https://your-api-endpoint.com".to_string(), + ..Default::default() + }; + + // Generate an image + let response = default_api::submit_image_task_api_custom_image_submit_task_post( + &config, + // Add your parameters here + ).await?; + + println!("Task submitted: {:?}", response); + Ok(()) +} +``` + +## API Overview + +This client was generated from the Text Video Agent API specification and provides access to all available endpoints: + +- **API version**: 1.0.6 +- **Package version**: 1.0.6 +- **Generated with**: OpenAPI Generator 7.14.0 + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**check_template_task_type_api_template_check_task_type_get**](docs/DefaultApi.md#check_template_task_type_api_template_check_task_type_get) | **GET** /api/template/check/task_type | 检查任务类型是否可用 +*DefaultApi* | [**create_higgsfield_character_api_custom_extend_higgsfield_create_character_post**](docs/DefaultApi.md#create_higgsfield_character_api_custom_extend_higgsfield_create_character_post) | **POST** /api/custom/extend/higgsfield/create/character | 提交创建生成角色任务 +*DefaultApi* | [**get_sample_prompt_api_prompt_default_get**](docs/DefaultApi.md#get_sample_prompt_api_prompt_default_get) | **GET** /api/prompt/default | 获取示例提示词 +*DefaultApi* | [**get_supported_model_api_custom_extend_model_list_get**](docs/DefaultApi.md#get_supported_model_api_custom_extend_model_list_get) | **GET** /api/custom/extend/model/list | 获取支持的模型列表 +*DefaultApi* | [**get_supported_model_api_custom_model_list_get**](docs/DefaultApi.md#get_supported_model_api_custom_model_list_get) | **GET** /api/custom/model/list | 获取支持的模型列表 +*DefaultApi* | [**handler_create_digital_api_ark_digital_create_post**](docs/DefaultApi.md#handler_create_digital_api_ark_digital_create_post) | **POST** /api/ark/digital/create | 提交创建数字人任务 +*DefaultApi* | [**handler_create_video_template_api_template_create_post**](docs/DefaultApi.md#handler_create_video_template_api_template_create_post) | **POST** /api/template/create | 创建新的视频模板 +*DefaultApi* | [**handler_delete_video_template_api_template_delete_template_id_delete**](docs/DefaultApi.md#handler_delete_video_template_api_template_delete_template_id_delete) | **DELETE** /api/template/delete/{template_id} | 删除视频模板 +*DefaultApi* | [**handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post**](docs/DefaultApi.md#handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post) | **POST** /api/custom/extend/higgsfield/submit/task | higgsfield Soul(文生图片)模型 +*DefaultApi* | [**handler_submit_generate_video_api_ark_digital_video_submit_task_post**](docs/DefaultApi.md#handler_submit_generate_video_api_ark_digital_video_submit_task_post) | **POST** /api/ark/digital/video/submit/task | 生成数字人视频 +*DefaultApi* | [**handler_update_video_template_api_template_update_put**](docs/DefaultApi.md#handler_update_video_template_api_template_update_put) | **PUT** /api/template/update | 更新视频模板 +*DefaultApi* | [**health_check_api_file_health_get**](docs/DefaultApi.md#health_check_api_file_health_get) | **GET** /api/file/health | 健康检测 +*DefaultApi* | [**health_check_api_prompt_health_get**](docs/DefaultApi.md#health_check_api_prompt_health_get) | **GET** /api/prompt/health | 健康检测 +*DefaultApi* | [**query_frame_task_status_api_custom_extend_frame_task_status_get**](docs/DefaultApi.md#query_frame_task_status_api_custom_extend_frame_task_status_get) | **GET** /api/custom/extend/frame/task/status | 查询首尾帧任务状态 +*DefaultApi* | [**query_higgsfield_character_status_api_custom_extend_higgsfield_character_status_post**](docs/DefaultApi.md#query_higgsfield_character_status_api_custom_extend_higgsfield_character_status_post) | **POST** /api/custom/extend/higgsfield/character/status | 查询创建角色状态 +*DefaultApi* | [**query_higgsfield_task_status_api_custom_extend_higgsfield_task_status_get**](docs/DefaultApi.md#query_higgsfield_task_status_api_custom_extend_higgsfield_task_status_get) | **GET** /api/custom/extend/higgsfield/task/status | higgsfield 查询任务执行状态 +*DefaultApi* | [**query_task_status_api_ark_digital_task_status_get**](docs/DefaultApi.md#query_task_status_api_ark_digital_task_status_get) | **GET** /api/ark/digital/task/status | 查询任务状态 +*DefaultApi* | [**query_task_status_api_custom_task_status_get**](docs/DefaultApi.md#query_task_status_api_custom_task_status_get) | **GET** /api/custom/task/status | Query Task Status +*DefaultApi* | [**query_video_template_v2_api_template_default_get**](docs/DefaultApi.md#query_video_template_v2_api_template_default_get) | **GET** /api/template/default | 获取视频模板列表 +*DefaultApi* | [**submit_frame_video_task_api_custom_extend_frame_submit_task_post**](docs/DefaultApi.md#submit_frame_video_task_api_custom_extend_frame_submit_task_post) | **POST** /api/custom/extend/frame/submit/task | 【首尾帧生成视频】 +*DefaultApi* | [**submit_image_task_api_custom_image_submit_task_post**](docs/DefaultApi.md#submit_image_task_api_custom_image_submit_task_post) | **POST** /api/custom/image/submit/task | 提交图片生成任务 +*DefaultApi* | [**submit_video_task_api_custom_video_submit_task_post**](docs/DefaultApi.md#submit_video_task_api_custom_video_submit_task_post) | **POST** /api/custom/video/submit/task | 提交视频生成任务 +*DefaultApi* | [**upload_file2cloud_api_ark_digital_url2vid_post**](docs/DefaultApi.md#upload_file2cloud_api_ark_digital_url2vid_post) | **POST** /api/ark/digital/url2vid | 【异步】上传视频生成视频云id, 仅仅支持mp4格式的视频,视频时长较时时,建议使用链接 +*DefaultApi* | [**upload_file_api_file_upload_post**](docs/DefaultApi.md#upload_file_api_file_upload_post) | **POST** /api/file/upload | 上传文件到COS +*DefaultApi* | [**upload_s3_api_file_upload_s3_post**](docs/DefaultApi.md#upload_s3_api_file_upload_s3_post) | **POST** /api/file/upload/s3 | 上传文件到s3【推荐 cdn加速】 +*ApiApi* | [**get_voices_hl_api302_hl_router_sync_get_voices_get**](docs/ApiApi.md#get_voices_hl_api302_hl_router_sync_get_voices_get) | **GET** /api/302/hl_router/sync/get/voices | 查询克隆的音色ID, 【接口来自官方, 302没有对应的中转接口】 +*ApiApi* | [**hl_tts_api302_hl_router_sync_generate_speech_post**](docs/ApiApi.md#hl_tts_api302_hl_router_sync_generate_speech_post) | **POST** /api/302/hl_router/sync/generate/speech | 海螺同步生成音频 +*ApiApi* | [**upload_material_file_api302_hl_router_sync_file_upload_post**](docs/ApiApi.md#upload_material_file_api302_hl_router_sync_file_upload_post) | **POST** /api/302/hl_router/sync/file/upload | 上传素材到302ai,用于复刻 +*ApiApi* | [**voice_clone_api302_hl_router_sync_voice_clone_post**](docs/ApiApi.md#voice_clone_api302_hl_router_sync_voice_clone_post) | **POST** /api/302/hl_router/sync/voice/clone | 声音克隆 +*ApiApi* | [**async_gen_video_api_jm_async_generate_video_post**](docs/ApiApi.md#async_gen_video_api_jm_async_generate_video_post) | **POST** /api/jm/async/generate/video | 异步生成视频,提交任务 +*ApiApi* | [**async_query_video_status_api_jm_async_query_status_get**](docs/ApiApi.md#async_query_video_status_api_jm_async_query_status_get) | **GET** /api/jm/async/query/status | 异步查询生成视频的任务状态 +*ApiApi* | [**generate_video_api_api_jm_generate_video_post**](docs/ApiApi.md#generate_video_api_api_jm_generate_video_post) | **POST** /api/jm/generate-video | 生成视频 +*ApiApi* | [**get_task_status_v2_api_task_status_task_id_get**](docs/ApiApi.md#get_task_status_v2_api_task_status_task_id_get) | **GET** /api/task/status/{task_id} | 异步查询任务状态 +*ApiApi* | [**health_check_api_jm_health_get**](docs/ApiApi.md#health_check_api_jm_health_get) | **GET** /api/jm/health | 健康检查 +*ApiApi* | [**health_check_api_task_health_get**](docs/ApiApi.md#health_check_api_task_health_get) | **GET** /api/task/health | 健康检测 +*ApiApi* | [**submit_task_v2_api_task_create_task_post**](docs/ApiApi.md#submit_task_v2_api_task_create_task_post) | **POST** /api/task/create/task | 新版异步提交任务) +*ApiApi* | [**submit_task_v3_api_task_create_task_v2_post**](docs/ApiApi.md#submit_task_v3_api_task_create_task_v2_post) | **POST** /api/task/create/task/v2 | 新版本异步提交任务 +*ApiApi* | [**sync_generate_video_v2_api_jm_sync_generate_video_post**](docs/ApiApi.md#sync_generate_video_v2_api_jm_sync_generate_video_post) | **POST** /api/jm/sync/generate/video | 同步:生成视频v2,支持通过图片文件生成视频 +*Class302Api* | [**fetch_supported_model_api_union_img_model_list_get**](docs/Class302Api.md#fetch_supported_model_api_union_img_model_list_get) | **GET** /api/union/img/model/list | 获取支持的模型列表 +*Class302Api* | [**fetch_supported_model_api_union_video_model_list_get**](docs/Class302Api.md#fetch_supported_model_api_union_video_model_list_get) | **GET** /api/union/video/model/list | 获取支持的模型列表 +*Class302Api* | [**query_task_status_api_union_video_async_task_id_status_get**](docs/Class302Api.md#query_task_status_api_union_video_async_task_id_status_get) | **GET** /api/union/video/async/{task_id}/status | 异步查询任务状态 +*Class302Api* | [**submit_task_api_union_video_async_generate_video_post**](docs/Class302Api.md#submit_task_api_union_video_async_generate_video_post) | **POST** /api/union/video/async/generate/video | 异步提交任务 +*Class302Api* | [**sync_gen_image_api_union_img_sync_generate_image_post**](docs/Class302Api.md#sync_gen_image_api_union_img_sync_generate_image_post) | **POST** /api/union/img/sync/generate/image | 生图 +*Class302aiApiApi* | [**async_gen_video_api302_jm_async_generate_video_post**](docs/Class302aiApiApi.md#async_gen_video_api302_jm_async_generate_video_post) | **POST** /api/302/jm/async/generate/video | 异步生成视频,提交任务 +*Class302aiApiApi* | [**async_query_video_status_api302_jm_async_query_status_get**](docs/Class302aiApiApi.md#async_query_video_status_api302_jm_async_query_status_get) | **GET** /api/302/jm/async/query/status | 异步查询生成视频的任务状态 +*Class302aiApiApi* | [**sync_generate_video_v2_api302_jm_sync_generate_video_post**](docs/Class302aiApiApi.md#sync_generate_video_v2_api302_jm_sync_generate_video_post) | **POST** /api/302/jm/sync/generate/video | 【302ai】同步:生成视频v2,支持通过图片文件生成视频 +*Class302aiMidjourneyApi* | [**async_gen_image_api302_mj_async_generate_image_post**](docs/Class302aiMidjourneyApi.md#async_gen_image_api302_mj_async_generate_image_post) | **POST** /api/302/mj/async/generate/image | 异步提交生图任务 +*Class302aiMidjourneyApi* | [**async_query_status_api302_mj_async_query_status_get**](docs/Class302aiMidjourneyApi.md#async_query_status_api302_mj_async_query_status_get) | **GET** /api/302/mj/async/query/status | 异步查询任务状态 +*Class302aiMidjourneyApi* | [**async_query_task_status_api302_mj_video_async_task_status_post**](docs/Class302aiMidjourneyApi.md#async_query_task_status_api302_mj_video_async_task_status_post) | **POST** /api/302/mj/video/async/task/status | 异步查询生成任务进度 +*Class302aiMidjourneyApi* | [**cancel_task_api302_mj_task_cancel_post**](docs/Class302aiMidjourneyApi.md#cancel_task_api302_mj_task_cancel_post) | **POST** /api/302/mj/task/cancel | 取消任务 +*Class302aiMidjourneyApi* | [**desc_img_by_file_api302_mj_sync_file_img_describe_post**](docs/Class302aiMidjourneyApi.md#desc_img_by_file_api302_mj_sync_file_img_describe_post) | **POST** /api/302/mj/sync/file/img/describe | 通过文件获取生图的提示词 +*Class302aiMidjourneyApi* | [**describe_image_api_api302_mj_sync_img_describe_post**](docs/Class302aiMidjourneyApi.md#describe_image_api_api302_mj_sync_img_describe_post) | **POST** /api/302/mj/sync/img/describe | 获取图像描述 +*Class302aiMidjourneyApi* | [**generate_image_sync_api302_mj_sync_image_post**](docs/Class302aiMidjourneyApi.md#generate_image_sync_api302_mj_sync_image_post) | **POST** /api/302/mj/sync/image | 同步生成图片接口 +*Class302aiMidjourneyApi* | [**submit_task_api302_mj_video_async_submit_post**](docs/Class302aiMidjourneyApi.md#submit_task_api302_mj_video_async_submit_post) | **POST** /api/302/mj/video/async/submit | 异步提交生成视频任务 +*Class302aiMidjourneyApi* | [**sync_gen_video_api302_mj_video_sync_generate_video_post**](docs/Class302aiMidjourneyApi.md#sync_gen_video_api302_mj_video_sync_generate_video_post) | **POST** /api/302/mj/video/sync/generate/video | 同步生成视频【text+img-->video】 +*Class302aiVeoApi* | [**get_task_status_api302_veo_video_task_task_id_get**](docs/Class302aiVeoApi.md#get_task_status_api302_veo_video_task_task_id_get) | **GET** /api/302/veo/video/task/{task_id} | 异步: 获取任务执行状态 +*Class302aiVeoApi* | [**submit_iv_submit_api302_veo_video_async_submit_post**](docs/Class302aiVeoApi.md#submit_iv_submit_api302_veo_video_async_submit_post) | **POST** /api/302/veo/video/async/submit | 异步:text-->video or text + img --> video +*Class302aiVeoApi* | [**sync_img2video_api302_veo_video_sync_generate_video_post**](docs/Class302aiVeoApi.md#sync_img2video_api302_veo_video_sync_generate_video_post) | **POST** /api/302/veo/video/sync/generate/video | 同步: 生成视频【文本+图片 OR 文生成视频】 +*ComfyuiApi* | [**get_running_node_api_comfy_fetch_running_node_get**](docs/ComfyuiApi.md#get_running_node_api_comfy_fetch_running_node_get) | **GET** /api/comfy/fetch/running/node | 根据任务数,获取运行节点 +*ComfyuiApi* | [**query_task_status_api_comfy_async_task_status_get**](docs/ComfyuiApi.md#query_task_status_api_comfy_async_task_status_get) | **GET** /api/comfy/async/task/status | 查询任务状态 +*ComfyuiApi* | [**submit_task_api_comfy_async_submit_task_post**](docs/ComfyuiApi.md#submit_task_api_comfy_async_submit_task_post) | **POST** /api/comfy/async/submit/task | 异步提交任务 +*ComfyuiApi* | [**sync_execute_workflow_api_comfy_sync_execute_workflow_post**](docs/ComfyuiApi.md#sync_execute_workflow_api_comfy_sync_execute_workflow_post) | **POST** /api/comfy/sync/execute/workflow | 同步执行comfy工作流 +*DefaultApi* | [**root_get**](docs/DefaultApi.md#root_get) | **GET** / | Root +*Hedra20Api* | [**internal_upload_file_api302_hedra_v2_upload_post**](docs/Hedra20Api.md#internal_upload_file_api302_hedra_v2_upload_post) | **POST** /api/302/hedra/v2/upload | 上传文件到hedra服务器仅支持,image, audio +*Hedra20Api* | [**query_task_status_api302_hedra_v2_task_status_get**](docs/Hedra20Api.md#query_task_status_api302_hedra_v2_task_status_get) | **GET** /api/302/hedra/v2/task/status | 查询任务状态 +*Hedra20Api* | [**submit_character_task_api302_hedra_v2_submit_task_post**](docs/Hedra20Api.md#submit_character_task_api302_hedra_v2_submit_task_post) | **POST** /api/302/hedra/v2/submit/task | 提交口型合成任务 +*Hedra30Api* | [**handler_hedra_task_submit_api302_hedra_v3_submit_task_post**](docs/Hedra30Api.md#handler_hedra_task_submit_api302_hedra_v3_submit_task_post) | **POST** /api/302/hedra/v3/submit/task | 异步提交任务 +*Hedra30Api* | [**handler_query_task_status_api302_hedra_v3_task_status_get**](docs/Hedra30Api.md#handler_query_task_status_api302_hedra_v3_task_status_get) | **GET** /api/302/hedra/v3/task/status | 查询任务状态 +*Hedra30Api* | [**upload_file_to_hedra_api302_hedra_v3_file_upload_post**](docs/Hedra30Api.md#upload_file_to_hedra_api302_hedra_v3_file_upload_post) | **POST** /api/302/hedra/v3/file/upload | 上传文件到hedra平台,返回资源的id +*LlmApi* | [**google_file_upload**](docs/LlmApi.md#google_file_upload) | **POST** /api/llm/google/vertex-ai/upload | 上传文件到谷歌存储,用于gemini视觉功能 +*LlmApi* | [**invoke_gemini_ai_api_llm_google_chat_post**](docs/LlmApi.md#invoke_gemini_ai_api_llm_google_chat_post) | **POST** /api/llm/google/chat | 调用google推理 +*LlmApi* | [**invoke_media_analysis_api_llm_google_sync_media_analysis_post**](docs/LlmApi.md#invoke_media_analysis_api_llm_google_sync_media_analysis_post) | **POST** /api/llm/google/sync/media/analysis | 【同步适合小文件】gemini多模态分析,支持视频,音频,图片 +*LlmApi* | [**llm_chat**](docs/LlmApi.md#llm_chat) | **POST** /api/llm/chat | 调用大模型进行推理 +*LlmApi* | [**llm_supported_models**](docs/LlmApi.md#llm_supported_models) | **GET** /api/llm/model/list | 获取支持的模型列表 +*LlmApi* | [**llm_task_id**](docs/LlmApi.md#llm_task_id) | **GET** /api/llm/task/status | 查询推理过程结果 +*LlmApi* | [**submit_media_inference_api_llm_google_async_media_analysis_post**](docs/LlmApi.md#submit_media_inference_api_llm_google_async_media_analysis_post) | **POST** /api/llm/google/async/media/analysis | 【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片 +*MidjourneyApi* | [**async_gen_image_api_mj_async_generate_image_post**](docs/MidjourneyApi.md#async_gen_image_api_mj_async_generate_image_post) | **POST** /api/mj/async/generate/image | 异步提交生图任务 +*MidjourneyApi* | [**async_query_status_api_mj_async_query_status_get**](docs/MidjourneyApi.md#async_query_status_api_mj_async_query_status_get) | **GET** /api/mj/async/query/status | 异步查询任务状态 +*MidjourneyApi* | [**desc_img_by_file_api_mj_sync_file_img_describe_post**](docs/MidjourneyApi.md#desc_img_by_file_api_mj_sync_file_img_describe_post) | **POST** /api/mj/sync/file/img/describe | 通过文件获取生图的提示词 +*MidjourneyApi* | [**describe_image_api_api_mj_sync_img_describe_post**](docs/MidjourneyApi.md#describe_image_api_api_mj_sync_img_describe_post) | **POST** /api/mj/sync/img/describe | 获取图像描述 +*MidjourneyApi* | [**generate_image_api_api_mj_generate_image_post**](docs/MidjourneyApi.md#generate_image_api_api_mj_generate_image_post) | **POST** /api/mj/generate-image | 生成图片 +*MidjourneyApi* | [**generate_image_sync_api_mj_sync_image_post**](docs/MidjourneyApi.md#generate_image_sync_api_mj_sync_image_post) | **POST** /api/mj/sync/image | 同步生成图片接口 +*MidjourneyApi* | [**health_check_api_mj_health_get**](docs/MidjourneyApi.md#health_check_api_mj_health_get) | **GET** /api/mj/health | 健康检查 +*MidjourneyApi* | [**prompt_check_api_mj_prompt_check_get**](docs/MidjourneyApi.md#prompt_check_api_mj_prompt_check_get) | **GET** /api/mj/prompt/check | 🔥图片提示词预审 +*MidjourneyapiApi* | [**async_query_task_status_api_mj_video_async_task_status_post**](docs/MidjourneyapiApi.md#async_query_task_status_api_mj_video_async_task_status_post) | **POST** /api/mj/video/async/task/status | 异步查询生成任务进度 +*MidjourneyapiApi* | [**health_check_api_mj_video_health_get**](docs/MidjourneyapiApi.md#health_check_api_mj_video_health_get) | **GET** /api/mj/video/health | 健康检查 +*MidjourneyapiApi* | [**submit_video_task_api_mj_video_async_submit_post**](docs/MidjourneyapiApi.md#submit_video_task_api_mj_video_async_submit_post) | **POST** /api/mj/video/async/submit | 异步提交生成视频任务 +*MidjourneyapiApi* | [**sync_submit_task_api_mj_video_sync_gen_post**](docs/MidjourneyapiApi.md#sync_submit_task_api_mj_video_sync_gen_post) | **POST** /api/mj/video/sync/gen | 同步生成视频视频 +*OmniHumanApi* | [**query_img_recognition_status_api_ark_omnihuman_task_status_get**](docs/OmniHumanApi.md#query_img_recognition_status_api_ark_omnihuman_task_status_get) | **GET** /api/ark/omnihuman/task/status | 查询任务状态 +*OmniHumanApi* | [**submit_img_recognition_api_ark_omnihuman_img_recognition_post**](docs/OmniHumanApi.md#submit_img_recognition_api_ark_omnihuman_img_recognition_post) | **POST** /api/ark/omnihuman/img/recognition | 提交图片检测任务,图片中是否包含人、类人、拟人等主体 +*OmniHumanApi* | [**submit_video_generate_task_api_ark_omnihuman_video_submit_task_post**](docs/OmniHumanApi.md#submit_video_generate_task_api_ark_omnihuman_video_submit_task_post) | **POST** /api/ark/omnihuman/video/submit/task | 提交视频生成任务 + + +## Documentation For Models + + - [FileUploadResponse](docs/FileUploadResponse.md) + - [HttpValidationError](docs/HttpValidationError.md) + - [TaskRequest](docs/TaskRequest.md) + - [ValidationError](docs/ValidationError.md) + - [ValidationErrorLocInner](docs/ValidationErrorLocInner.md) + + +## Examples + +### Image Generation + +```rust +use text_video_agent_client::{apis::configuration::Configuration, apis::default_api}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let config = Configuration::default(); + + // Submit image generation task + let response = default_api::submit_image_task_api_custom_image_submit_task_post( + &config, + // Add your parameters + ).await?; + + Ok(()) +} +``` + +### Video Generation + +```rust +use text_video_agent_client::{apis::configuration::Configuration, apis::default_api}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let config = Configuration::default(); + + // Submit video generation task + let response = default_api::submit_video_task_api_custom_video_submit_task_post( + &config, + // Add your parameters + ).await?; + + Ok(()) +} +``` + +### LLM Integration + +```rust +use text_video_agent_client::{apis::configuration::Configuration, apis::llm_api}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let config = Configuration::default(); + + // Get supported models + let models = llm_api::llm_supported_models(&config).await?; + println!("Available models: {:?}", models); + + Ok(()) +} +``` + +## API Categories + +The client provides access to the following API categories: + +- **DefaultApi** - Core functionality (templates, file upload, health checks) +- **ApiApi** - Task management and basic operations +- **Class302Api** - 302AI integration services +- **Class302aiApiApi** - 302AI JiMeng video generation +- **Class302aiMidjourneyApi** - 302AI Midjourney integration +- **Class302aiVeoApi** - 302AI VEO video generation +- **ComfyuiApi** - ComfyUI workflow execution +- **Hedra20Api** - Hedra 2.0 lip sync services +- **Hedra30Api** - Hedra 3.0 lip sync services +- **LlmApi** - Large Language Model integration +- **MidjourneyApi** - Midjourney image generation +- **MidjourneyapiApi** - Midjourney video generation +- **OmniHumanApi** - Digital human services + +## Documentation + +To access the complete API documentation: + +```bash +cargo doc --open +``` + +Or visit [docs.rs/text_video_agent_client](https://docs.rs/text_video_agent_client) + +## Contributing + +This client is auto-generated from the OpenAPI specification. For issues related to the API itself, please contact the API provider. For issues with this Rust client, please open an issue in the repository. + +## License + +Licensed under either of + +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +## Author + + + diff --git a/cargos/text-video-agent-rust-sdk/docs/Api0Api.md b/cargos/text-video-agent-rust-sdk/docs/Api0Api.md new file mode 100644 index 0000000..b7db1b9 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Api0Api.md @@ -0,0 +1,285 @@ +# \ApiApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**async_gen_video_api_jm_async_generate_video_post**](ApiApi.md#async_gen_video_api_jm_async_generate_video_post) | **POST** /api/jm/async/generate/video | 异步生成视频,提交任务 +[**async_query_video_status_api_jm_async_query_status_get**](ApiApi.md#async_query_video_status_api_jm_async_query_status_get) | **GET** /api/jm/async/query/status | 异步查询生成视频的任务状态 +[**generate_video_api_api_jm_generate_video_post**](ApiApi.md#generate_video_api_api_jm_generate_video_post) | **POST** /api/jm/generate-video | 生成视频 +[**get_task_status_v2_api_task_status_task_id_get**](ApiApi.md#get_task_status_v2_api_task_status_task_id_get) | **GET** /api/task/status/{task_id} | 异步查询任务状态 +[**health_check_api_jm_health_get**](ApiApi.md#health_check_api_jm_health_get) | **GET** /api/jm/health | 健康检查 +[**health_check_api_task_health_get**](ApiApi.md#health_check_api_task_health_get) | **GET** /api/task/health | 健康检测 +[**submit_task_v2_api_task_create_task_post**](ApiApi.md#submit_task_v2_api_task_create_task_post) | **POST** /api/task/create/task | 新版异步提交任务) +[**submit_task_v3_api_task_create_task_v2_post**](ApiApi.md#submit_task_v3_api_task_create_task_v2_post) | **POST** /api/task/create/task/v2 | 新版本异步提交任务 +[**sync_generate_video_v2_api_jm_sync_generate_video_post**](ApiApi.md#sync_generate_video_v2_api_jm_sync_generate_video_post) | **POST** /api/jm/sync/generate/video | 同步:生成视频v2,支持通过图片文件生成视频 + + + +## async_gen_video_api_jm_async_generate_video_post + +> serde_json::Value async_gen_video_api_jm_async_generate_video_post(prompt, img_url, img_file, duration, model_type) +异步生成视频,提交任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 视频生成提示词 | [required] | +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | +**duration** | Option<**String**> | 视频时长(秒) | |[default to 5] +**model_type** | Option<**String**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## async_query_video_status_api_jm_async_query_status_get + +> serde_json::Value async_query_video_status_api_jm_async_query_status_get(task_id) +异步查询生成视频的任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## generate_video_api_api_jm_generate_video_post + +> serde_json::Value generate_video_api_api_jm_generate_video_post(prompt, img_url, duration, max_wait_time, poll_interval, model_type) +生成视频 + +生成视频接口 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 视频生成提示词 | [required] | +**img_url** | **String** | 图片URL地址 | [required] | +**duration** | Option<**String**> | 视频时长(秒) | |[default to 5] +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 300] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 5] +**model_type** | Option<**String**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_task_status_v2_api_task_status_task_id_get + +> serde_json::Value get_task_status_v2_api_task_status_task_id_get(task_id) +异步查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## health_check_api_jm_health_get + +> serde_json::Value health_check_api_jm_health_get() +健康检查 + +健康检查接口 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## health_check_api_task_health_get + +> serde_json::Value health_check_api_task_health_get() +健康检测 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_task_v2_api_task_create_task_post + +> serde_json::Value submit_task_v2_api_task_create_task_post(task_request) +新版异步提交任务) + +异步提交任务到 Modal 进行处理(不阻塞,立即返回任务ID) - **task_type**: 任务类型 (tea/chop/lady/vlog) - **prompt**: 生成提示词 - **img_url**: 可选的参考图片URL,如果提供会先进行图片描述 - **ar**: 生成图片的长宽比 默认为9:16 立即返回 Modal 任务ID,任务在后台异步执行 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_request** | [**TaskRequest**](TaskRequest.md) | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_task_v3_api_task_create_task_v2_post + +> serde_json::Value submit_task_v3_api_task_create_task_v2_post(task_request) +新版本异步提交任务 + +异步提交任务到 Modal 进行处理(不阻塞,立即返回任务ID) - **task_type**: 任务类型 (tea/chop/lady/vlog) - **prompt**: 生成提示词 - **img_url**: 可选的参考图片URL,如果提供会先进行图片描述 - **ar**: 生成图片的长宽比 默认为9:16 立即返回 Modal 任务ID,任务在后台异步执行 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_request** | [**TaskRequest**](TaskRequest.md) | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_generate_video_v2_api_jm_sync_generate_video_post + +> serde_json::Value sync_generate_video_v2_api_jm_sync_generate_video_post(prompt, img_file, duration, max_wait_time, poll_interval, model_type) +同步:生成视频v2,支持通过图片文件生成视频 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | **std::path::PathBuf** | 生成视频的图片 | [required] | +**duration** | Option<**String**> | 视频时长(秒) | |[default to 5] +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 300] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 5] +**model_type** | Option<**String**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/ApiApi.md b/cargos/text-video-agent-rust-sdk/docs/ApiApi.md new file mode 100644 index 0000000..61604a8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/ApiApi.md @@ -0,0 +1,131 @@ +# \ApiApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_voices_hl_api302_hl_router_sync_get_voices_get**](ApiApi.md#get_voices_hl_api302_hl_router_sync_get_voices_get) | **GET** /api/302/hl_router/sync/get/voices | 查询克隆的音色ID, 【接口来自官方, 302没有对应的中转接口】 +[**hl_tts_api302_hl_router_sync_generate_speech_post**](ApiApi.md#hl_tts_api302_hl_router_sync_generate_speech_post) | **POST** /api/302/hl_router/sync/generate/speech | 海螺同步生成音频 +[**upload_material_file_api302_hl_router_sync_file_upload_post**](ApiApi.md#upload_material_file_api302_hl_router_sync_file_upload_post) | **POST** /api/302/hl_router/sync/file/upload | 上传素材到302ai,用于复刻 +[**voice_clone_api302_hl_router_sync_voice_clone_post**](ApiApi.md#voice_clone_api302_hl_router_sync_voice_clone_post) | **POST** /api/302/hl_router/sync/voice/clone | 声音克隆 + + + +## get_voices_hl_api302_hl_router_sync_get_voices_get + +> serde_json::Value get_voices_hl_api302_hl_router_sync_get_voices_get() +查询克隆的音色ID, 【接口来自官方, 302没有对应的中转接口】 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## hl_tts_api302_hl_router_sync_generate_speech_post + +> serde_json::Value hl_tts_api302_hl_router_sync_generate_speech_post(text, voice_id, speed, vol, emotion) +海螺同步生成音频 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**text** | **String** | tts文本内容 | [required] | +**voice_id** | **String** | Voice ID | [required] | +**speed** | Option<**f64**> | 语速, [0.5, 2] | |[default to 1.0] +**vol** | Option<**f64**> | 音量(0,10]默认1.0 | |[default to 1.0] +**emotion** | Option<**String**> | 情感, [\\\"happy\\\", \\\"sad\\\", \\\"angry\\\", \\\"fearful\\\", \\\"disgusted\\\", \\\"surprised\\\", \\\"calm\\\"] | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## upload_material_file_api302_hl_router_sync_file_upload_post + +> serde_json::Value upload_material_file_api302_hl_router_sync_file_upload_post(audio_file, purpose) +上传素材到302ai,用于复刻 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**audio_file** | **std::path::PathBuf** | 音频文件 | [required] | +**purpose** | Option<**String**> | 意图,默认voice_clone | |[default to voice_clone] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## voice_clone_api302_hl_router_sync_voice_clone_post + +> serde_json::Value voice_clone_api302_hl_router_sync_voice_clone_post(text, model, need_noise_reduction, voice_id, prefix, audio_file) +声音克隆 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**text** | **String** | 复刻的文本 | [required] | +**model** | Option<**String**> | 支持的模型有:speech-02-hd,speech-02-turbo,speech-01-hd,speech-01-turbo | |[default to speech-02-hd] +**need_noise_reduction** | Option<**bool**> | 是否开启降噪 | |[default to true] +**voice_id** | Option<**String**> | 音色克隆voice_id | | +**prefix** | Option<**String**> | 音色voice_id前缀 | |[default to BoWong-] +**audio_file** | Option<**std::path::PathBuf**> | 参考音频文件 | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/Class302Api.md b/cargos/text-video-agent-rust-sdk/docs/Class302Api.md new file mode 100644 index 0000000..a1a42b3 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Class302Api.md @@ -0,0 +1,155 @@ +# \Class302Api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fetch_supported_model_api_union_img_model_list_get**](Class302Api.md#fetch_supported_model_api_union_img_model_list_get) | **GET** /api/union/img/model/list | 获取支持的模型列表 +[**fetch_supported_model_api_union_video_model_list_get**](Class302Api.md#fetch_supported_model_api_union_video_model_list_get) | **GET** /api/union/video/model/list | 获取支持的模型列表 +[**query_task_status_api_union_video_async_task_id_status_get**](Class302Api.md#query_task_status_api_union_video_async_task_id_status_get) | **GET** /api/union/video/async/{task_id}/status | 异步查询任务状态 +[**submit_task_api_union_video_async_generate_video_post**](Class302Api.md#submit_task_api_union_video_async_generate_video_post) | **POST** /api/union/video/async/generate/video | 异步提交任务 +[**sync_gen_image_api_union_img_sync_generate_image_post**](Class302Api.md#sync_gen_image_api_union_img_sync_generate_image_post) | **POST** /api/union/img/sync/generate/image | 生图 + + + +## fetch_supported_model_api_union_img_model_list_get + +> serde_json::Value fetch_supported_model_api_union_img_model_list_get() +获取支持的模型列表 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## fetch_supported_model_api_union_video_model_list_get + +> serde_json::Value fetch_supported_model_api_union_video_model_list_get() +获取支持的模型列表 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## query_task_status_api_union_video_async_task_id_status_get + +> serde_json::Value query_task_status_api_union_video_async_task_id_status_get(task_id) +异步查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_task_api_union_video_async_generate_video_post + +> serde_json::Value submit_task_api_union_video_async_generate_video_post(prompt, img_file, model, duration) +异步提交任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生图的提示词 | [required] | +**img_file** | Option<**std::path::PathBuf**> | 首帧图片 | | +**model** | Option<**String**> | 生图的模型 | |[default to 302/seedance_i2v] +**duration** | Option<**i32**> | 视频时长 | |[default to 5] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_gen_image_api_union_img_sync_generate_image_post + +> serde_json::Value sync_gen_image_api_union_img_sync_generate_image_post(prompt, model, img_file, aspect_ratio) +生图 + +详细参考: https://doc.302.ai/286288228e0 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生图的提示词 | [required] | +**model** | Option<**String**> | 生图的模型默认.mj | |[default to 302/midjourney-v7-t2i] +**img_file** | Option<**std::path::PathBuf**> | 参考图 | | +**aspect_ratio** | Option<**String**> | 图片的尺寸 | |[default to 9:16] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/Class302aiApiApi.md b/cargos/text-video-agent-rust-sdk/docs/Class302aiApiApi.md new file mode 100644 index 0000000..496afe8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Class302aiApiApi.md @@ -0,0 +1,104 @@ +# \Class302aiApiApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**async_gen_video_api302_jm_async_generate_video_post**](Class302aiApiApi.md#async_gen_video_api302_jm_async_generate_video_post) | **POST** /api/302/jm/async/generate/video | 异步生成视频,提交任务 +[**async_query_video_status_api302_jm_async_query_status_get**](Class302aiApiApi.md#async_query_video_status_api302_jm_async_query_status_get) | **GET** /api/302/jm/async/query/status | 异步查询生成视频的任务状态 +[**sync_generate_video_v2_api302_jm_sync_generate_video_post**](Class302aiApiApi.md#sync_generate_video_v2_api302_jm_sync_generate_video_post) | **POST** /api/302/jm/sync/generate/video | 【302ai】同步:生成视频v2,支持通过图片文件生成视频 + + + +## async_gen_video_api302_jm_async_generate_video_post + +> serde_json::Value async_gen_video_api302_jm_async_generate_video_post(prompt, img_url, img_file, duration, model_type) +异步生成视频,提交任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 视频生成提示词 | [required] | +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | +**duration** | Option<**String**> | 视频时长(秒) | |[default to 5] +**model_type** | Option<**String**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## async_query_video_status_api302_jm_async_query_status_get + +> serde_json::Value async_query_video_status_api302_jm_async_query_status_get(task_id) +异步查询生成视频的任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_generate_video_v2_api302_jm_sync_generate_video_post + +> serde_json::Value sync_generate_video_v2_api302_jm_sync_generate_video_post(prompt, img_file, duration, max_wait_time, poll_interval, model_type) +【302ai】同步:生成视频v2,支持通过图片文件生成视频 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | **std::path::PathBuf** | 生成视频的图片 | [required] | +**duration** | Option<**String**> | 视频时长(秒) | |[default to 5] +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 300] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 5] +**model_type** | Option<**String**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/Class302aiMidjourneyApi.md b/cargos/text-video-agent-rust-sdk/docs/Class302aiMidjourneyApi.md new file mode 100644 index 0000000..00838fe --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Class302aiMidjourneyApi.md @@ -0,0 +1,290 @@ +# \Class302aiMidjourneyApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**async_gen_image_api302_mj_async_generate_image_post**](Class302aiMidjourneyApi.md#async_gen_image_api302_mj_async_generate_image_post) | **POST** /api/302/mj/async/generate/image | 异步提交生图任务 +[**async_query_status_api302_mj_async_query_status_get**](Class302aiMidjourneyApi.md#async_query_status_api302_mj_async_query_status_get) | **GET** /api/302/mj/async/query/status | 异步查询任务状态 +[**async_query_task_status_api302_mj_video_async_task_status_post**](Class302aiMidjourneyApi.md#async_query_task_status_api302_mj_video_async_task_status_post) | **POST** /api/302/mj/video/async/task/status | 异步查询生成任务进度 +[**cancel_task_api302_mj_task_cancel_post**](Class302aiMidjourneyApi.md#cancel_task_api302_mj_task_cancel_post) | **POST** /api/302/mj/task/cancel | 取消任务 +[**desc_img_by_file_api302_mj_sync_file_img_describe_post**](Class302aiMidjourneyApi.md#desc_img_by_file_api302_mj_sync_file_img_describe_post) | **POST** /api/302/mj/sync/file/img/describe | 通过文件获取生图的提示词 +[**describe_image_api_api302_mj_sync_img_describe_post**](Class302aiMidjourneyApi.md#describe_image_api_api302_mj_sync_img_describe_post) | **POST** /api/302/mj/sync/img/describe | 获取图像描述 +[**generate_image_sync_api302_mj_sync_image_post**](Class302aiMidjourneyApi.md#generate_image_sync_api302_mj_sync_image_post) | **POST** /api/302/mj/sync/image | 同步生成图片接口 +[**submit_task_api302_mj_video_async_submit_post**](Class302aiMidjourneyApi.md#submit_task_api302_mj_video_async_submit_post) | **POST** /api/302/mj/video/async/submit | 异步提交生成视频任务 +[**sync_gen_video_api302_mj_video_sync_generate_video_post**](Class302aiMidjourneyApi.md#sync_gen_video_api302_mj_video_sync_generate_video_post) | **POST** /api/302/mj/video/sync/generate/video | 同步生成视频【text+img-->video】 + + + +## async_gen_image_api302_mj_async_generate_image_post + +> serde_json::Value async_gen_image_api302_mj_async_generate_image_post(prompt, img_file, mode) +异步提交生图任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | +**mode** | Option<**String**> | 运行模式,支持 turbo, fast | |[default to fast] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## async_query_status_api302_mj_async_query_status_get + +> serde_json::Value async_query_status_api302_mj_async_query_status_get(task_id, task_type, cdn_flag, mode) +异步查询任务状态 + +Args: cdn_flag: 是否cdn转换,默认为False 【cnd 转换耗时】 task_id: 任务id task_type: 任务类型:image【生图】, describe【反推提示词】 Returns: + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | +**task_type** | Option<**String**> | | |[default to image] +**cdn_flag** | Option<**bool**> | | |[default to false] +**mode** | Option<**String**> | | |[default to fast] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## async_query_task_status_api302_mj_video_async_task_status_post + +> serde_json::Value async_query_task_status_api302_mj_video_async_task_status_post(task_id) +异步查询生成任务进度 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## cancel_task_api302_mj_task_cancel_post + +> serde_json::Value cancel_task_api302_mj_task_cancel_post(task_id) +取消任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## desc_img_by_file_api302_mj_sync_file_img_describe_post + +> serde_json::Value desc_img_by_file_api302_mj_sync_file_img_describe_post(img_file, max_wait_time, poll_interval) +通过文件获取生图的提示词 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**img_file** | **std::path::PathBuf** | 上传的图片 | [required] | +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 120] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 2] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## describe_image_api_api302_mj_sync_img_describe_post + +> serde_json::Value describe_image_api_api302_mj_sync_img_describe_post(image_url, max_wait_time, poll_interval) +获取图像描述 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**image_url** | **String** | 图片URL地址 | [required] | +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 120] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 2] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## generate_image_sync_api302_mj_sync_image_post + +> serde_json::Value generate_image_sync_api302_mj_sync_image_post(prompt, max_wait_time, poll_interval, mode, img_file) +同步生成图片接口 + +Args: mode: 模式 支持 fast turbo 模式 Returns: + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**max_wait_time** | Option<**i32**> | | |[default to 500] +**poll_interval** | Option<**i32**> | | |[default to 4] +**mode** | Option<**String**> | | |[default to fast] +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_task_api302_mj_video_async_submit_post + +> serde_json::Value submit_task_api302_mj_video_async_submit_post(prompt, img_file) +异步提交生成视频任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_gen_video_api302_mj_video_sync_generate_video_post + +> serde_json::Value sync_gen_video_api302_mj_video_sync_generate_video_post(prompt, img_file, timeout, interval) +同步生成视频【text+img-->video】 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | **std::path::PathBuf** | 首帧参考图文件 | [required] | +**timeout** | Option<**i32**> | 超时时间 | |[default to 300] +**interval** | Option<**i32**> | 轮询间隔 | |[default to 3] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/Class302aiVeoApi.md b/cargos/text-video-agent-rust-sdk/docs/Class302aiVeoApi.md new file mode 100644 index 0000000..a5865cd --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Class302aiVeoApi.md @@ -0,0 +1,102 @@ +# \Class302aiVeoApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_task_status_api302_veo_video_task_task_id_get**](Class302aiVeoApi.md#get_task_status_api302_veo_video_task_task_id_get) | **GET** /api/302/veo/video/task/{task_id} | 异步: 获取任务执行状态 +[**submit_iv_submit_api302_veo_video_async_submit_post**](Class302aiVeoApi.md#submit_iv_submit_api302_veo_video_async_submit_post) | **POST** /api/302/veo/video/async/submit | 异步:text-->video or text + img --> video +[**sync_img2video_api302_veo_video_sync_generate_video_post**](Class302aiVeoApi.md#sync_img2video_api302_veo_video_sync_generate_video_post) | **POST** /api/302/veo/video/sync/generate/video | 同步: 生成视频【文本+图片 OR 文生成视频】 + + + +## get_task_status_api302_veo_video_task_task_id_get + +> serde_json::Value get_task_status_api302_veo_video_task_task_id_get(task_id, img_mode) +异步: 获取任务执行状态 + +Args: task_id: 任务id img_mode: True:图文到视频 False 文生视频 Returns: + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | +**img_mode** | Option<**bool**> | | |[default to false] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_iv_submit_api302_veo_video_async_submit_post + +> serde_json::Value submit_iv_submit_api302_veo_video_async_submit_post(prompt, img_file) +异步:text-->video or text + img --> video + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_img2video_api302_veo_video_sync_generate_video_post + +> serde_json::Value sync_img2video_api302_veo_video_sync_generate_video_post(prompt, img_file, max_wait_time, interval) +同步: 生成视频【文本+图片 OR 文生成视频】 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 生成视频的提示词 | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | +**max_wait_time** | Option<**i32**> | 最大等待时间,单位秒 | |[default to 500] +**interval** | Option<**i32**> | 轮询间隔,单位秒 | |[default to 5] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/ComfyuiApi.md b/cargos/text-video-agent-rust-sdk/docs/ComfyuiApi.md new file mode 100644 index 0000000..d096beb --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/ComfyuiApi.md @@ -0,0 +1,124 @@ +# \ComfyuiApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_running_node_api_comfy_fetch_running_node_get**](ComfyuiApi.md#get_running_node_api_comfy_fetch_running_node_get) | **GET** /api/comfy/fetch/running/node | 根据任务数,获取运行节点 +[**query_task_status_api_comfy_async_task_status_get**](ComfyuiApi.md#query_task_status_api_comfy_async_task_status_get) | **GET** /api/comfy/async/task/status | 查询任务状态 +[**submit_task_api_comfy_async_submit_task_post**](ComfyuiApi.md#submit_task_api_comfy_async_submit_task_post) | **POST** /api/comfy/async/submit/task | 异步提交任务 +[**sync_execute_workflow_api_comfy_sync_execute_workflow_post**](ComfyuiApi.md#sync_execute_workflow_api_comfy_sync_execute_workflow_post) | **POST** /api/comfy/sync/execute/workflow | 同步执行comfy工作流 + + + +## get_running_node_api_comfy_fetch_running_node_get + +> serde_json::Value get_running_node_api_comfy_fetch_running_node_get(task_count) +根据任务数,获取运行节点 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_count** | Option<**i32**> | 运行任务的数目 | |[default to 1] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## query_task_status_api_comfy_async_task_status_get + +> serde_json::Value query_task_status_api_comfy_async_task_status_get(task_id) +查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | 任务id | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_task_api_comfy_async_submit_task_post + +> serde_json::Value submit_task_api_comfy_async_submit_task_post(prompt) +异步提交任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 工作流节点数据 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_execute_workflow_api_comfy_sync_execute_workflow_post + +> serde_json::Value sync_execute_workflow_api_comfy_sync_execute_workflow_post(prompt) +同步执行comfy工作流 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 工作流json字符穿 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/DefaultApi.md b/cargos/text-video-agent-rust-sdk/docs/DefaultApi.md new file mode 100644 index 0000000..c4eeaec --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**root_get**](DefaultApi.md#root_get) | **GET** / | Root + + + +## root_get + +> serde_json::Value root_get() +Root + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/FileUploadResponse.md b/cargos/text-video-agent-rust-sdk/docs/FileUploadResponse.md new file mode 100644 index 0000000..c420082 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/FileUploadResponse.md @@ -0,0 +1,13 @@ +# FileUploadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | 上传状态 | +**msg** | **String** | 响应消息 | +**data** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/cargos/text-video-agent-rust-sdk/docs/Hedra20Api.md b/cargos/text-video-agent-rust-sdk/docs/Hedra20Api.md new file mode 100644 index 0000000..da48b23 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Hedra20Api.md @@ -0,0 +1,96 @@ +# \Hedra20Api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**internal_upload_file_api302_hedra_v2_upload_post**](Hedra20Api.md#internal_upload_file_api302_hedra_v2_upload_post) | **POST** /api/302/hedra/v2/upload | 上传文件到hedra服务器仅支持,image, audio +[**query_task_status_api302_hedra_v2_task_status_get**](Hedra20Api.md#query_task_status_api302_hedra_v2_task_status_get) | **GET** /api/302/hedra/v2/task/status | 查询任务状态 +[**submit_character_task_api302_hedra_v2_submit_task_post**](Hedra20Api.md#submit_character_task_api302_hedra_v2_submit_task_post) | **POST** /api/302/hedra/v2/submit/task | 提交口型合成任务 + + + +## internal_upload_file_api302_hedra_v2_upload_post + +> serde_json::Value internal_upload_file_api302_hedra_v2_upload_post(file) +上传文件到hedra服务器仅支持,image, audio + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**file** | **std::path::PathBuf** | 上传文件到hedra服务器,仅支持image与audio | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## query_task_status_api302_hedra_v2_task_status_get + +> serde_json::Value query_task_status_api302_hedra_v2_task_status_get(task_id) +查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | task_id | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_character_task_api302_hedra_v2_submit_task_post + +> serde_json::Value submit_character_task_api302_hedra_v2_submit_task_post(avatar_file, audio_file) +提交口型合成任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**avatar_file** | **std::path::PathBuf** | 人像照片 | [required] | +**audio_file** | **std::path::PathBuf** | 音频文件 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/Hedra30Api.md b/cargos/text-video-agent-rust-sdk/docs/Hedra30Api.md new file mode 100644 index 0000000..93f9d59 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/Hedra30Api.md @@ -0,0 +1,100 @@ +# \Hedra30Api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**handler_hedra_task_submit_api302_hedra_v3_submit_task_post**](Hedra30Api.md#handler_hedra_task_submit_api302_hedra_v3_submit_task_post) | **POST** /api/302/hedra/v3/submit/task | 异步提交任务 +[**handler_query_task_status_api302_hedra_v3_task_status_get**](Hedra30Api.md#handler_query_task_status_api302_hedra_v3_task_status_get) | **GET** /api/302/hedra/v3/task/status | 查询任务状态 +[**upload_file_to_hedra_api302_hedra_v3_file_upload_post**](Hedra30Api.md#upload_file_to_hedra_api302_hedra_v3_file_upload_post) | **POST** /api/302/hedra/v3/file/upload | 上传文件到hedra平台,返回资源的id + + + +## handler_hedra_task_submit_api302_hedra_v3_submit_task_post + +> serde_json::Value handler_hedra_task_submit_api302_hedra_v3_submit_task_post(img_file, audio_file, prompt, resolution, aspect_ratio) +异步提交任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**img_file** | **std::path::PathBuf** | 图片文件 | [required] | +**audio_file** | **std::path::PathBuf** | 音频文件 | [required] | +**prompt** | Option<**String**> | 文本提示词 | |[default to ] +**resolution** | Option<**String**> | 分辨率支持: 720p, 540p | |[default to 720p] +**aspect_ratio** | Option<**String**> | 尺寸: 1:1, 16:9, 9:16 | |[default to 1:1] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## handler_query_task_status_api302_hedra_v3_task_status_get + +> serde_json::Value handler_query_task_status_api302_hedra_v3_task_status_get(task_id) +查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | 任务id | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## upload_file_to_hedra_api302_hedra_v3_file_upload_post + +> serde_json::Value upload_file_to_hedra_api302_hedra_v3_file_upload_post(local_file, purpose) +上传文件到hedra平台,返回资源的id + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**local_file** | **std::path::PathBuf** | 待上传的文件,支持音频,图片 | [required] | +**purpose** | Option<**String**> | 上传文件的用途: 支持\\\"image\\\" \\\"audio\\\" \\\"video\\\" \\\"voice\\\" | |[default to image] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/HttpValidationError.md b/cargos/text-video-agent-rust-sdk/docs/HttpValidationError.md new file mode 100644 index 0000000..d111ad5 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/HttpValidationError.md @@ -0,0 +1,11 @@ +# HttpValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail** | Option<[**Vec**](ValidationError.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/cargos/text-video-agent-rust-sdk/docs/LlmApi.md b/cargos/text-video-agent-rust-sdk/docs/LlmApi.md new file mode 100644 index 0000000..ed3d3c3 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/LlmApi.md @@ -0,0 +1,219 @@ +# \LlmApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**google_file_upload**](LlmApi.md#google_file_upload) | **POST** /api/llm/google/vertex-ai/upload | 上传文件到谷歌存储,用于gemini视觉功能 +[**invoke_gemini_ai_api_llm_google_chat_post**](LlmApi.md#invoke_gemini_ai_api_llm_google_chat_post) | **POST** /api/llm/google/chat | 调用google推理 +[**invoke_media_analysis_api_llm_google_sync_media_analysis_post**](LlmApi.md#invoke_media_analysis_api_llm_google_sync_media_analysis_post) | **POST** /api/llm/google/sync/media/analysis | 【同步适合小文件】gemini多模态分析,支持视频,音频,图片 +[**llm_chat**](LlmApi.md#llm_chat) | **POST** /api/llm/chat | 调用大模型进行推理 +[**llm_supported_models**](LlmApi.md#llm_supported_models) | **GET** /api/llm/model/list | 获取支持的模型列表 +[**llm_task_id**](LlmApi.md#llm_task_id) | **GET** /api/llm/task/status | 查询推理过程结果 +[**submit_media_inference_api_llm_google_async_media_analysis_post**](LlmApi.md#submit_media_inference_api_llm_google_async_media_analysis_post) | **POST** /api/llm/google/async/media/analysis | 【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片 + + + +## google_file_upload + +> serde_json::Value google_file_upload(local_file) +上传文件到谷歌存储,用于gemini视觉功能 + +Args: local_file: 本地文件支持 音频,视频, 图片 Returns: { \"status\": \"状态信息, true 成功, false 失败\", \"data\": \"gs://fashion_image_block/gallery_v2/mp4/1f76996f-a13e-450e-8c86-029c398932c4.mp4\", 分析媒体时候使用该字段 \"msg\": \"\", \"extra\": 原始信息 } + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**local_file** | **std::path::PathBuf** | 本地文件 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## invoke_gemini_ai_api_llm_google_chat_post + +> serde_json::Value invoke_gemini_ai_api_llm_google_chat_post(prompt, timeout) +调用google推理 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | prompt输入 | [required] | +**timeout** | Option<**f64**> | 超时时间 | |[default to 180] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## invoke_media_analysis_api_llm_google_sync_media_analysis_post + +> serde_json::Value invoke_media_analysis_api_llm_google_sync_media_analysis_post(text_prompt, media_uri) +【同步适合小文件】gemini多模态分析,支持视频,音频,图片 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**text_prompt** | **String** | 文本提示词 | [required] | +**media_uri** | **String** | gs:xxxx, 上传到谷歌vertex ai 上的链接 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## llm_chat + +> serde_json::Value llm_chat(prompt, model_name, temperature, max_tokens, timeout) +调用大模型进行推理 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | prompt输入 | [required] | +**model_name** | Option<**String**> | 模型名称, 从/model/list接口获取 | |[default to gemini-2.5-flash] +**temperature** | Option<**f64**> | 模型的温度值 | |[default to 0.7] +**max_tokens** | Option<**i32**> | 最大token值 | |[default to 4096] +**timeout** | Option<**f64**> | 超时时间,推理 | |[default to 180] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## llm_supported_models + +> serde_json::Value llm_supported_models() +获取支持的模型列表 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## llm_task_id + +> serde_json::Value llm_task_id(task_id) +查询推理过程结果 + +Args: task_id: 任务id Returns: {'status': '值为字符串的时候标识任务运行的状态,为布尔值时,标识任务运行完毕!', 'data': '', 'msg': ''} + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | 任务id | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_media_inference_api_llm_google_async_media_analysis_post + +> serde_json::Value submit_media_inference_api_llm_google_async_media_analysis_post(text_prompt, media_uri) +【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**text_prompt** | **String** | 文本提示词 | [required] | +**media_uri** | **String** | gs:xxxx, 上传到谷歌vertex ai 上的链接 | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/MidjourneyApi.md b/cargos/text-video-agent-rust-sdk/docs/MidjourneyApi.md new file mode 100644 index 0000000..283b194 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/MidjourneyApi.md @@ -0,0 +1,256 @@ +# \MidjourneyApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**async_gen_image_api_mj_async_generate_image_post**](MidjourneyApi.md#async_gen_image_api_mj_async_generate_image_post) | **POST** /api/mj/async/generate/image | 异步提交生图任务 +[**async_query_status_api_mj_async_query_status_get**](MidjourneyApi.md#async_query_status_api_mj_async_query_status_get) | **GET** /api/mj/async/query/status | 异步查询任务状态 +[**desc_img_by_file_api_mj_sync_file_img_describe_post**](MidjourneyApi.md#desc_img_by_file_api_mj_sync_file_img_describe_post) | **POST** /api/mj/sync/file/img/describe | 通过文件获取生图的提示词 +[**describe_image_api_api_mj_sync_img_describe_post**](MidjourneyApi.md#describe_image_api_api_mj_sync_img_describe_post) | **POST** /api/mj/sync/img/describe | 获取图像描述 +[**generate_image_api_api_mj_generate_image_post**](MidjourneyApi.md#generate_image_api_api_mj_generate_image_post) | **POST** /api/mj/generate-image | 生成图片 +[**generate_image_sync_api_mj_sync_image_post**](MidjourneyApi.md#generate_image_sync_api_mj_sync_image_post) | **POST** /api/mj/sync/image | 同步生成图片接口 +[**health_check_api_mj_health_get**](MidjourneyApi.md#health_check_api_mj_health_get) | **GET** /api/mj/health | 健康检查 +[**prompt_check_api_mj_prompt_check_get**](MidjourneyApi.md#prompt_check_api_mj_prompt_check_get) | **GET** /api/mj/prompt/check | 🔥图片提示词预审 + + + +## async_gen_image_api_mj_async_generate_image_post + +> serde_json::Value async_gen_image_api_mj_async_generate_image_post(prompt, img_file) +异步提交生图任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## async_query_status_api_mj_async_query_status_get + +> serde_json::Value async_query_status_api_mj_async_query_status_get(task_id) +异步查询任务状态 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## desc_img_by_file_api_mj_sync_file_img_describe_post + +> serde_json::Value desc_img_by_file_api_mj_sync_file_img_describe_post(img_file, max_wait_time, poll_interval) +通过文件获取生图的提示词 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**img_file** | **std::path::PathBuf** | 上传的图片 | [required] | +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 120] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 2] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## describe_image_api_api_mj_sync_img_describe_post + +> serde_json::Value describe_image_api_api_mj_sync_img_describe_post(image_url, max_wait_time, poll_interval) +获取图像描述 + +获取图像描述接口 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**image_url** | **String** | 图片URL地址 | [required] | +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 120] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 2] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## generate_image_api_api_mj_generate_image_post + +> serde_json::Value generate_image_api_api_mj_generate_image_post(prompt, img_file, max_wait_time, poll_interval) +生成图片 + +生成图片接口 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | 图片生成提示词 | [required] | +**img_file** | Option<**std::path::PathBuf**> | | | +**max_wait_time** | Option<**i32**> | 最大等待时间(秒) | |[default to 120] +**poll_interval** | Option<**i32**> | 轮询间隔(秒) | |[default to 2] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## generate_image_sync_api_mj_sync_image_post + +> serde_json::Value generate_image_sync_api_mj_sync_image_post(prompt, max_wait_time, poll_interval, img_file) +同步生成图片接口 + +同步生成图片接口 - 提交任务并轮询结果 Args: prompt (str): 图片生成提示词 img_file: 样貌参考 --oref max_wait_time (int): 最大等待时间,默认120秒 poll_interval (int): 轮询间隔,默认2秒 Returns: dict: 包含status, msg, data的响应字典 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**max_wait_time** | Option<**i32**> | | |[default to 120] +**poll_interval** | Option<**i32**> | | |[default to 2] +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## health_check_api_mj_health_get + +> serde_json::Value health_check_api_mj_health_get() +健康检查 + +健康检查接口 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## prompt_check_api_mj_prompt_check_get + +> serde_json::Value prompt_check_api_mj_prompt_check_get(prompt) +🔥图片提示词预审 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/MidjourneyapiApi.md b/cargos/text-video-agent-rust-sdk/docs/MidjourneyapiApi.md new file mode 100644 index 0000000..49a7388 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/MidjourneyapiApi.md @@ -0,0 +1,125 @@ +# \MidjourneyapiApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**async_query_task_status_api_mj_video_async_task_status_post**](MidjourneyapiApi.md#async_query_task_status_api_mj_video_async_task_status_post) | **POST** /api/mj/video/async/task/status | 异步查询生成任务进度 +[**health_check_api_mj_video_health_get**](MidjourneyapiApi.md#health_check_api_mj_video_health_get) | **GET** /api/mj/video/health | 健康检查 +[**submit_video_task_api_mj_video_async_submit_post**](MidjourneyapiApi.md#submit_video_task_api_mj_video_async_submit_post) | **POST** /api/mj/video/async/submit | 异步提交生成视频任务 +[**sync_submit_task_api_mj_video_sync_gen_post**](MidjourneyapiApi.md#sync_submit_task_api_mj_video_sync_gen_post) | **POST** /api/mj/video/sync/gen | 同步生成视频视频 + + + +## async_query_task_status_api_mj_video_async_task_status_post + +> serde_json::Value async_query_task_status_api_mj_video_async_task_status_post(task_id) +异步查询生成任务进度 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## health_check_api_mj_video_health_get + +> serde_json::Value health_check_api_mj_video_health_get() +健康检查 + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_video_task_api_mj_video_async_submit_post + +> serde_json::Value submit_video_task_api_mj_video_async_submit_post(prompt, img_url, img_file) +异步提交生成视频任务 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## sync_submit_task_api_mj_video_sync_gen_post + +> serde_json::Value sync_submit_task_api_mj_video_sync_gen_post(prompt, img_url, img_file) +同步生成视频视频 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prompt** | **String** | | [required] | +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/OmniHumanApi.md b/cargos/text-video-agent-rust-sdk/docs/OmniHumanApi.md new file mode 100644 index 0000000..a438caf --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/OmniHumanApi.md @@ -0,0 +1,104 @@ +# \OmniHumanApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**query_img_recognition_status_api_ark_omnihuman_task_status_get**](OmniHumanApi.md#query_img_recognition_status_api_ark_omnihuman_task_status_get) | **GET** /api/ark/omnihuman/task/status | 查询任务状态 +[**submit_img_recognition_api_ark_omnihuman_img_recognition_post**](OmniHumanApi.md#submit_img_recognition_api_ark_omnihuman_img_recognition_post) | **POST** /api/ark/omnihuman/img/recognition | 提交图片检测任务,图片中是否包含人、类人、拟人等主体 +[**submit_video_generate_task_api_ark_omnihuman_video_submit_task_post**](OmniHumanApi.md#submit_video_generate_task_api_ark_omnihuman_video_submit_task_post) | **POST** /api/ark/omnihuman/video/submit/task | 提交视频生成任务 + + + +## query_img_recognition_status_api_ark_omnihuman_task_status_get + +> serde_json::Value query_img_recognition_status_api_ark_omnihuman_task_status_get(task_id, task_type) +查询任务状态 + +Args: task_type: face_detect: 人脸检测结果, video_generate: 视频生成结果 Returns: + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task_id** | **String** | 任务id | [required] | +**task_type** | Option<**String**> | 任务类型,支持 face_detect, video_generate | |[default to face_detect] + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_img_recognition_api_ark_omnihuman_img_recognition_post + +> serde_json::Value submit_img_recognition_api_ark_omnihuman_img_recognition_post(img_url, img_file) +提交图片检测任务,图片中是否包含人、类人、拟人等主体 + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_video_generate_task_api_ark_omnihuman_video_submit_task_post + +> serde_json::Value submit_video_generate_task_api_ark_omnihuman_video_submit_task_post(img_url, img_file, audio_url, audio_file) +提交视频生成任务 + +Args: img_input: 输入的图片, 支持链接 + 文件流 audio_input: 输入的音频, 支持链接 + 文件流 Returns: {\"status\": True, 'data': '任务id', 'msg': '信息'} + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**img_url** | Option<**String**> | | | +**img_file** | Option<**std::path::PathBuf**> | | | +**audio_url** | Option<**String**> | | | +**audio_file** | Option<**std::path::PathBuf**> | | | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/cargos/text-video-agent-rust-sdk/docs/TaskRequest.md b/cargos/text-video-agent-rust-sdk/docs/TaskRequest.md new file mode 100644 index 0000000..678c861 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/TaskRequest.md @@ -0,0 +1,14 @@ +# TaskRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_type** | Option<**String**> | | [optional] +**prompt** | **String** | 生图的提示词 | +**img_url** | Option<**String**> | | [optional] +**ar** | Option<**String**> | 生成图片,视频的分辨率 | [optional][default to 9:16] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/cargos/text-video-agent-rust-sdk/docs/ValidationError.md b/cargos/text-video-agent-rust-sdk/docs/ValidationError.md new file mode 100644 index 0000000..25688c2 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/ValidationError.md @@ -0,0 +1,13 @@ +# ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loc** | [**Vec**](ValidationError_loc_inner.md) | | +**msg** | **String** | | +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/cargos/text-video-agent-rust-sdk/docs/ValidationErrorLocInner.md b/cargos/text-video-agent-rust-sdk/docs/ValidationErrorLocInner.md new file mode 100644 index 0000000..90cb4e3 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/docs/ValidationErrorLocInner.md @@ -0,0 +1,10 @@ +# ValidationErrorLocInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/cargos/text-video-agent-rust-sdk/examples/simple_usage.rs b/cargos/text-video-agent-rust-sdk/examples/simple_usage.rs new file mode 100644 index 0000000..0ce8629 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/examples/simple_usage.rs @@ -0,0 +1,38 @@ +use text_video_agent_client::apis::configuration::Configuration; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Create configuration + let config = Configuration { + base_path: "https://bowongai-dev--text-video-agent-fastapi-app.modal.run".to_string(), + user_agent: Some("text-video-agent-rust-client/1.0.6".to_string()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + }; + + println!("Text Video Agent Rust Client"); + println!("============================"); + println!("Configuration created successfully!"); + println!("Base path: {}", config.base_path); + println!("User agent: {:?}", config.user_agent); + + println!("\nThis is a basic example showing how to create a configuration."); + println!("To use the actual API endpoints, you would:"); + println!("1. Replace 'https://your-api-endpoint.com' with the real API URL"); + println!("2. Add authentication if required"); + println!("3. Call the specific API functions you need"); + + println!("\nAvailable API modules:"); + println!("- default_api: Core functionality"); + println!("- api_api: Task management"); + println!("- class302_api: 302AI services"); + println!("- llm_api: LLM integration"); + println!("- hedra30_api: Lip sync services"); + println!("- omni_human_api: Digital human services"); + println!("- And many more..."); + + Ok(()) +} diff --git a/cargos/text-video-agent-rust-sdk/git_push.sh b/cargos/text-video-agent-rust-sdk/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/cargos/text-video-agent-rust-sdk/src/apis/api_0_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/api_0_api.rs new file mode 100644 index 0000000..9ad04b5 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/api_0_api.rs @@ -0,0 +1,474 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`async_gen_video_api_jm_async_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncGenVideoApiJmAsyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`async_query_video_status_api_jm_async_query_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryVideoStatusApiJmAsyncQueryStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`generate_video_api_api_jm_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GenerateVideoApiApiJmGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_task_status_v2_api_task_status_task_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTaskStatusV2ApiTaskStatusTaskIdGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`health_check_api_jm_health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthCheckApiJmHealthGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`health_check_api_task_health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthCheckApiTaskHealthGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_task_v2_api_task_create_task_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitTaskV2ApiTaskCreateTaskPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_task_v3_api_task_create_task_v2_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitTaskV3ApiTaskCreateTaskV2PostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_generate_video_v2_api_jm_sync_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncGenerateVideoV2ApiJmSyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn async_gen_video_api_jm_async_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_url: Option<&str>, img_file: Option, duration: Option<&str>, model_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_url = img_url; + let p_img_file = img_file; + let p_duration = duration; + let p_model_type = model_type; + + let uri_str = format!("{}/api/jm/async/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + if let Some(param_value) = p_img_url { + multipart_form = multipart_form.text("img_url", param_value.to_string()); + } + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_duration { + multipart_form = multipart_form.text("duration", param_value.to_string()); + } + if let Some(param_value) = p_model_type { + multipart_form = multipart_form.text("model_type", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn async_query_video_status_api_jm_async_query_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/jm/async/query/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 生成视频接口 +pub async fn generate_video_api_api_jm_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_url: &str, duration: Option<&str>, max_wait_time: Option, poll_interval: Option, model_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_url = img_url; + let p_duration = duration; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + let p_model_type = model_type; + + let uri_str = format!("{}/api/jm/generate-video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("prompt", p_prompt.to_string()); + multipart_form_params.insert("img_url", p_img_url.to_string()); + if let Some(param_value) = p_duration { + multipart_form_params.insert("duration", param_value.to_string()); + } + if let Some(param_value) = p_max_wait_time { + multipart_form_params.insert("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form_params.insert("poll_interval", param_value.to_string()); + } + if let Some(param_value) = p_model_type { + multipart_form_params.insert("model_type", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn get_task_status_v2_api_task_status_task_id_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/task/status/{task_id}", configuration.base_path, task_id=crate::apis::urlencode(p_task_id)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 健康检查接口 +pub async fn health_check_api_jm_health_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/jm/health", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn health_check_api_task_health_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/task/health", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 异步提交任务到 Modal 进行处理(不阻塞,立即返回任务ID) - **task_type**: 任务类型 (tea/chop/lady/vlog) - **prompt**: 生成提示词 - **img_url**: 可选的参考图片URL,如果提供会先进行图片描述 - **ar**: 生成图片的长宽比 默认为9:16 立即返回 Modal 任务ID,任务在后台异步执行 +pub async fn submit_task_v2_api_task_create_task_post(configuration: &configuration::Configuration, task_request: models::TaskRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_request = task_request; + + let uri_str = format!("{}/api/task/create/task", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_task_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 异步提交任务到 Modal 进行处理(不阻塞,立即返回任务ID) - **task_type**: 任务类型 (tea/chop/lady/vlog) - **prompt**: 生成提示词 - **img_url**: 可选的参考图片URL,如果提供会先进行图片描述 - **ar**: 生成图片的长宽比 默认为9:16 立即返回 Modal 任务ID,任务在后台异步执行 +pub async fn submit_task_v3_api_task_create_task_v2_post(configuration: &configuration::Configuration, task_request: models::TaskRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_request = task_request; + + let uri_str = format!("{}/api/task/create/task/v2", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_task_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_generate_video_v2_api_jm_sync_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_file: std::path::PathBuf, duration: Option<&str>, max_wait_time: Option, poll_interval: Option, model_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_duration = duration; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + let p_model_type = model_type; + + let uri_str = format!("{}/api/jm/sync/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_duration { + multipart_form = multipart_form.text("duration", param_value.to_string()); + } + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form = multipart_form.text("poll_interval", param_value.to_string()); + } + if let Some(param_value) = p_model_type { + multipart_form = multipart_form.text("model_type", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/api_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/api_api.rs new file mode 100644 index 0000000..b934193 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/api_api.rs @@ -0,0 +1,236 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`get_voices_hl_api302_hl_router_sync_get_voices_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetVoicesHlApi302HlRouterSyncGetVoicesGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`hl_tts_api302_hl_router_sync_generate_speech_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HlTtsApi302HlRouterSyncGenerateSpeechPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`upload_material_file_api302_hl_router_sync_file_upload_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UploadMaterialFileApi302HlRouterSyncFileUploadPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`voice_clone_api302_hl_router_sync_voice_clone_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum VoiceCloneApi302HlRouterSyncVoiceClonePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn get_voices_hl_api302_hl_router_sync_get_voices_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/302/hl_router/sync/get/voices", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn hl_tts_api302_hl_router_sync_generate_speech_post(configuration: &configuration::Configuration, text: &str, voice_id: &str, speed: Option, vol: Option, emotion: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_text = text; + let p_voice_id = voice_id; + let p_speed = speed; + let p_vol = vol; + let p_emotion = emotion; + + let uri_str = format!("{}/api/302/hl_router/sync/generate/speech", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("text", p_text.to_string()); + multipart_form_params.insert("voice_id", p_voice_id.to_string()); + if let Some(param_value) = p_speed { + multipart_form_params.insert("speed", param_value.to_string()); + } + if let Some(param_value) = p_vol { + multipart_form_params.insert("vol", param_value.to_string()); + } + if let Some(param_value) = p_emotion { + multipart_form_params.insert("emotion", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn upload_material_file_api302_hl_router_sync_file_upload_post(configuration: &configuration::Configuration, audio_file: std::path::PathBuf, purpose: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_audio_file = audio_file; + let p_purpose = purpose; + + let uri_str = format!("{}/api/302/hl_router/sync/file/upload", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'audio_file' parameter + if let Some(param_value) = p_purpose { + multipart_form = multipart_form.text("purpose", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn voice_clone_api302_hl_router_sync_voice_clone_post(configuration: &configuration::Configuration, text: &str, model: Option<&str>, need_noise_reduction: Option, voice_id: Option<&str>, prefix: Option<&str>, audio_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_text = text; + let p_model = model; + let p_need_noise_reduction = need_noise_reduction; + let p_voice_id = voice_id; + let p_prefix = prefix; + let p_audio_file = audio_file; + + let uri_str = format!("{}/api/302/hl_router/sync/voice/clone", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("text", p_text.to_string()); + if let Some(param_value) = p_model { + multipart_form = multipart_form.text("model", param_value.to_string()); + } + if let Some(param_value) = p_need_noise_reduction { + multipart_form = multipart_form.text("need_noise_reduction", param_value.to_string()); + } + if let Some(param_value) = p_voice_id { + multipart_form = multipart_form.text("voice_id", param_value.to_string()); + } + if let Some(param_value) = p_prefix { + multipart_form = multipart_form.text("prefix", param_value.to_string()); + } + // TODO: support file upload for 'audio_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/class302_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/class302_api.rs new file mode 100644 index 0000000..018e2bc --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/class302_api.rs @@ -0,0 +1,259 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`fetch_supported_model_api_union_img_model_list_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FetchSupportedModelApiUnionImgModelListGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`fetch_supported_model_api_union_video_model_list_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FetchSupportedModelApiUnionVideoModelListGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`query_task_status_api_union_video_async_task_id_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum QueryTaskStatusApiUnionVideoAsyncTaskIdStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_task_api_union_video_async_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitTaskApiUnionVideoAsyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_gen_image_api_union_img_sync_generate_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncGenImageApiUnionImgSyncGenerateImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn fetch_supported_model_api_union_img_model_list_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/union/img/model/list", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn fetch_supported_model_api_union_video_model_list_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/union/video/model/list", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn query_task_status_api_union_video_async_task_id_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/union/video/async/{task_id}/status", configuration.base_path, task_id=crate::apis::urlencode(p_task_id)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_task_api_union_video_async_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option, model: Option<&str>, duration: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_model = model; + let p_duration = duration; + + let uri_str = format!("{}/api/union/video/async/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_model { + multipart_form = multipart_form.text("model", param_value.to_string()); + } + if let Some(param_value) = p_duration { + multipart_form = multipart_form.text("duration", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 详细参考: https://doc.302.ai/286288228e0 +pub async fn sync_gen_image_api_union_img_sync_generate_image_post(configuration: &configuration::Configuration, prompt: &str, model: Option<&str>, img_file: Option, aspect_ratio: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_model = model; + let p_img_file = img_file; + let p_aspect_ratio = aspect_ratio; + + let uri_str = format!("{}/api/union/img/sync/generate/image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + if let Some(param_value) = p_model { + multipart_form = multipart_form.text("model", param_value.to_string()); + } + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_aspect_ratio { + multipart_form = multipart_form.text("aspect_ratio", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/class302ai_api_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_api_api.rs new file mode 100644 index 0000000..2dfdd7d --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_api_api.rs @@ -0,0 +1,189 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`async_gen_video_api302_jm_async_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncGenVideoApi302JmAsyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`async_query_video_status_api302_jm_async_query_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryVideoStatusApi302JmAsyncQueryStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_generate_video_v2_api302_jm_sync_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncGenerateVideoV2Api302JmSyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn async_gen_video_api302_jm_async_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_url: Option<&str>, img_file: Option, duration: Option<&str>, model_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_url = img_url; + let p_img_file = img_file; + let p_duration = duration; + let p_model_type = model_type; + + let uri_str = format!("{}/api/302/jm/async/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + if let Some(param_value) = p_img_url { + multipart_form = multipart_form.text("img_url", param_value.to_string()); + } + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_duration { + multipart_form = multipart_form.text("duration", param_value.to_string()); + } + if let Some(param_value) = p_model_type { + multipart_form = multipart_form.text("model_type", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn async_query_video_status_api302_jm_async_query_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/302/jm/async/query/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_generate_video_v2_api302_jm_sync_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_file: std::path::PathBuf, duration: Option<&str>, max_wait_time: Option, poll_interval: Option, model_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_duration = duration; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + let p_model_type = model_type; + + let uri_str = format!("{}/api/302/jm/sync/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_duration { + multipart_form = multipart_form.text("duration", param_value.to_string()); + } + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form = multipart_form.text("poll_interval", param_value.to_string()); + } + if let Some(param_value) = p_model_type { + multipart_form = multipart_form.text("model_type", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/class302ai_midjourney_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_midjourney_api.rs new file mode 100644 index 0000000..a9e2c98 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_midjourney_api.rs @@ -0,0 +1,497 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`async_gen_image_api302_mj_async_generate_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncGenImageApi302MjAsyncGenerateImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`async_query_status_api302_mj_async_query_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryStatusApi302MjAsyncQueryStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`async_query_task_status_api302_mj_video_async_task_status_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryTaskStatusApi302MjVideoAsyncTaskStatusPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`cancel_task_api302_mj_task_cancel_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CancelTaskApi302MjTaskCancelPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`desc_img_by_file_api302_mj_sync_file_img_describe_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescImgByFileApi302MjSyncFileImgDescribePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`describe_image_api_api302_mj_sync_img_describe_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeImageApiApi302MjSyncImgDescribePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`generate_image_sync_api302_mj_sync_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GenerateImageSyncApi302MjSyncImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_task_api302_mj_video_async_submit_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitTaskApi302MjVideoAsyncSubmitPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_gen_video_api302_mj_video_sync_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncGenVideoApi302MjVideoSyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn async_gen_image_api302_mj_async_generate_image_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option, mode: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_mode = mode; + + let uri_str = format!("{}/api/302/mj/async/generate/image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_mode { + multipart_form = multipart_form.text("mode", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Args: cdn_flag: 是否cdn转换,默认为False 【cnd 转换耗时】 task_id: 任务id task_type: 任务类型:image【生图】, describe【反推提示词】 Returns: +pub async fn async_query_status_api302_mj_async_query_status_get(configuration: &configuration::Configuration, task_id: &str, task_type: Option<&str>, cdn_flag: Option, mode: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + let p_task_type = task_type; + let p_cdn_flag = cdn_flag; + let p_mode = mode; + + let uri_str = format!("{}/api/302/mj/async/query/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref param_value) = p_task_type { + req_builder = req_builder.query(&[("task_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_cdn_flag { + req_builder = req_builder.query(&[("cdn_flag", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_mode { + req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn async_query_task_status_api302_mj_video_async_task_status_post(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/302/mj/video/async/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn cancel_task_api302_mj_task_cancel_post(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/302/mj/task/cancel", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn desc_img_by_file_api302_mj_sync_file_img_describe_post(configuration: &configuration::Configuration, img_file: std::path::PathBuf, max_wait_time: Option, poll_interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_img_file = img_file; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + + let uri_str = format!("{}/api/302/mj/sync/file/img/describe", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form = multipart_form.text("poll_interval", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn describe_image_api_api302_mj_sync_img_describe_post(configuration: &configuration::Configuration, image_url: &str, max_wait_time: Option, poll_interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_image_url = image_url; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + + let uri_str = format!("{}/api/302/mj/sync/img/describe", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("image_url", p_image_url.to_string()); + if let Some(param_value) = p_max_wait_time { + multipart_form_params.insert("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form_params.insert("poll_interval", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Args: mode: 模式 支持 fast turbo 模式 Returns: +pub async fn generate_image_sync_api302_mj_sync_image_post(configuration: &configuration::Configuration, prompt: &str, max_wait_time: Option, poll_interval: Option, mode: Option<&str>, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + let p_mode = mode; + let p_img_file = img_file; + + let uri_str = format!("{}/api/302/mj/sync/image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref param_value) = p_max_wait_time { + req_builder = req_builder.query(&[("max_wait_time", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_poll_interval { + req_builder = req_builder.query(&[("poll_interval", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_mode { + req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_task_api302_mj_video_async_submit_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + + let uri_str = format!("{}/api/302/mj/video/async/submit", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_gen_video_api302_mj_video_sync_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_file: std::path::PathBuf, timeout: Option, interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_timeout = timeout; + let p_interval = interval; + + let uri_str = format!("{}/api/302/mj/video/sync/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_timeout { + multipart_form = multipart_form.text("timeout", param_value.to_string()); + } + if let Some(param_value) = p_interval { + multipart_form = multipart_form.text("interval", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/class302ai_veo_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_veo_api.rs new file mode 100644 index 0000000..62c6a90 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/class302ai_veo_api.rs @@ -0,0 +1,173 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`get_task_status_api302_veo_video_task_task_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTaskStatusApi302VeoVideoTaskTaskIdGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_iv_submit_api302_veo_video_async_submit_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitIvSubmitApi302VeoVideoAsyncSubmitPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_img2video_api302_veo_video_sync_generate_video_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncImg2videoApi302VeoVideoSyncGenerateVideoPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +/// Args: task_id: 任务id img_mode: True:图文到视频 False 文生视频 Returns: +pub async fn get_task_status_api302_veo_video_task_task_id_get(configuration: &configuration::Configuration, task_id: &str, img_mode: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + let p_img_mode = img_mode; + + let uri_str = format!("{}/api/302/veo/video/task/{task_id}", configuration.base_path, task_id=crate::apis::urlencode(p_task_id)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_img_mode { + req_builder = req_builder.query(&[("img_mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_iv_submit_api302_veo_video_async_submit_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + + let uri_str = format!("{}/api/302/veo/video/async/submit", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_img2video_api302_veo_video_sync_generate_video_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option, max_wait_time: Option, interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_max_wait_time = max_wait_time; + let p_interval = interval; + + let uri_str = format!("{}/api/302/veo/video/sync/generate/video", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_interval { + multipart_form = multipart_form.text("interval", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/comfyui_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/comfyui_api.rs new file mode 100644 index 0000000..0702282 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/comfyui_api.rs @@ -0,0 +1,204 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`get_running_node_api_comfy_fetch_running_node_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRunningNodeApiComfyFetchRunningNodeGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`query_task_status_api_comfy_async_task_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum QueryTaskStatusApiComfyAsyncTaskStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_task_api_comfy_async_submit_task_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitTaskApiComfyAsyncSubmitTaskPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_execute_workflow_api_comfy_sync_execute_workflow_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncExecuteWorkflowApiComfySyncExecuteWorkflowPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn get_running_node_api_comfy_fetch_running_node_get(configuration: &configuration::Configuration, task_count: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_count = task_count; + + let uri_str = format!("{}/api/comfy/fetch/running/node", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_task_count { + req_builder = req_builder.query(&[("task_count", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn query_task_status_api_comfy_async_task_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/comfy/async/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_task_api_comfy_async_submit_task_post(configuration: &configuration::Configuration, prompt: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + + let uri_str = format!("{}/api/comfy/async/submit/task", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("prompt", p_prompt.to_string()); + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_execute_workflow_api_comfy_sync_execute_workflow_post(configuration: &configuration::Configuration, prompt: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + + let uri_str = format!("{}/api/comfy/sync/execute/workflow", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("prompt", p_prompt.to_string()); + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/configuration.rs b/cargos/text-video-agent-rust-sdk/src/apis/configuration.rs new file mode 100644 index 0000000..44d186f --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.6/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/cargos/text-video-agent-rust-sdk/src/apis/default_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/default_api.rs new file mode 100644 index 0000000..84c5999 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/default_api.rs @@ -0,0 +1,59 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`root_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RootGetError { + UnknownValue(serde_json::Value), +} + + +pub async fn root_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/hedra20_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/hedra20_api.rs new file mode 100644 index 0000000..889f0c0 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/hedra20_api.rs @@ -0,0 +1,159 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`internal_upload_file_api302_hedra_v2_upload_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InternalUploadFileApi302HedraV2UploadPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`query_task_status_api302_hedra_v2_task_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum QueryTaskStatusApi302HedraV2TaskStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_character_task_api302_hedra_v2_submit_task_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitCharacterTaskApi302HedraV2SubmitTaskPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn internal_upload_file_api302_hedra_v2_upload_post(configuration: &configuration::Configuration, file: std::path::PathBuf) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_file = file; + + let uri_str = format!("{}/api/302/hedra/v2/upload", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn query_task_status_api302_hedra_v2_task_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/302/hedra/v2/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_character_task_api302_hedra_v2_submit_task_post(configuration: &configuration::Configuration, avatar_file: std::path::PathBuf, audio_file: std::path::PathBuf) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_avatar_file = avatar_file; + let p_audio_file = audio_file; + + let uri_str = format!("{}/api/302/hedra/v2/submit/task", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'avatar_file' parameter + // TODO: support file upload for 'audio_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/hedra30_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/hedra30_api.rs new file mode 100644 index 0000000..003ce93 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/hedra30_api.rs @@ -0,0 +1,175 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`handler_hedra_task_submit_api302_hedra_v3_submit_task_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HandlerHedraTaskSubmitApi302HedraV3SubmitTaskPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`handler_query_task_status_api302_hedra_v3_task_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HandlerQueryTaskStatusApi302HedraV3TaskStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`upload_file_to_hedra_api302_hedra_v3_file_upload_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UploadFileToHedraApi302HedraV3FileUploadPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn handler_hedra_task_submit_api302_hedra_v3_submit_task_post(configuration: &configuration::Configuration, img_file: std::path::PathBuf, audio_file: std::path::PathBuf, prompt: Option<&str>, resolution: Option<&str>, aspect_ratio: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_img_file = img_file; + let p_audio_file = audio_file; + let p_prompt = prompt; + let p_resolution = resolution; + let p_aspect_ratio = aspect_ratio; + + let uri_str = format!("{}/api/302/hedra/v3/submit/task", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + // TODO: support file upload for 'audio_file' parameter + if let Some(param_value) = p_prompt { + multipart_form = multipart_form.text("prompt", param_value.to_string()); + } + if let Some(param_value) = p_resolution { + multipart_form = multipart_form.text("resolution", param_value.to_string()); + } + if let Some(param_value) = p_aspect_ratio { + multipart_form = multipart_form.text("aspect_ratio", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn handler_query_task_status_api302_hedra_v3_task_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/302/hedra/v3/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn upload_file_to_hedra_api302_hedra_v3_file_upload_post(configuration: &configuration::Configuration, local_file: std::path::PathBuf, purpose: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_local_file = local_file; + let p_purpose = purpose; + + let uri_str = format!("{}/api/302/hedra/v3/file/upload", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'local_file' parameter + if let Some(param_value) = p_purpose { + multipart_form = multipart_form.text("purpose", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/llm_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/llm_api.rs new file mode 100644 index 0000000..719d2a8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/llm_api.rs @@ -0,0 +1,365 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`google_file_upload`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GoogleFileUploadError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`invoke_gemini_ai_api_llm_google_chat_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InvokeGeminiAiApiLlmGoogleChatPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`invoke_media_analysis_api_llm_google_sync_media_analysis_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InvokeMediaAnalysisApiLlmGoogleSyncMediaAnalysisPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`llm_chat`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LlmChatError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`llm_supported_models`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LlmSupportedModelsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`llm_task_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LlmTaskIdError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_media_inference_api_llm_google_async_media_analysis_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitMediaInferenceApiLlmGoogleAsyncMediaAnalysisPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +/// Args: local_file: 本地文件支持 音频,视频, 图片 Returns: { \"status\": \"状态信息, true 成功, false 失败\", \"data\": \"gs://fashion_image_block/gallery_v2/mp4/1f76996f-a13e-450e-8c86-029c398932c4.mp4\", 分析媒体时候使用该字段 \"msg\": \"\", \"extra\": 原始信息 } +pub async fn google_file_upload(configuration: &configuration::Configuration, local_file: std::path::PathBuf) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_local_file = local_file; + + let uri_str = format!("{}/api/llm/google/vertex-ai/upload", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'local_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn invoke_gemini_ai_api_llm_google_chat_post(configuration: &configuration::Configuration, prompt: &str, timeout: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_timeout = timeout; + + let uri_str = format!("{}/api/llm/google/chat", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("prompt", p_prompt.to_string()); + if let Some(param_value) = p_timeout { + multipart_form_params.insert("timeout", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn invoke_media_analysis_api_llm_google_sync_media_analysis_post(configuration: &configuration::Configuration, text_prompt: &str, media_uri: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_text_prompt = text_prompt; + let p_media_uri = media_uri; + + let uri_str = format!("{}/api/llm/google/sync/media/analysis", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("text_prompt", p_text_prompt.to_string()); + multipart_form_params.insert("media_uri", p_media_uri.to_string()); + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn llm_chat(configuration: &configuration::Configuration, prompt: &str, model_name: Option<&str>, temperature: Option, max_tokens: Option, timeout: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_model_name = model_name; + let p_temperature = temperature; + let p_max_tokens = max_tokens; + let p_timeout = timeout; + + let uri_str = format!("{}/api/llm/chat", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("prompt", p_prompt.to_string()); + if let Some(param_value) = p_model_name { + multipart_form_params.insert("model_name", param_value.to_string()); + } + if let Some(param_value) = p_temperature { + multipart_form_params.insert("temperature", param_value.to_string()); + } + if let Some(param_value) = p_max_tokens { + multipart_form_params.insert("max_tokens", param_value.to_string()); + } + if let Some(param_value) = p_timeout { + multipart_form_params.insert("timeout", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn llm_supported_models(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/llm/model/list", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Args: task_id: 任务id Returns: {'status': '值为字符串的时候标识任务运行的状态,为布尔值时,标识任务运行完毕!', 'data': '', 'msg': ''} +pub async fn llm_task_id(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/llm/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_media_inference_api_llm_google_async_media_analysis_post(configuration: &configuration::Configuration, text_prompt: &str, media_uri: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_text_prompt = text_prompt; + let p_media_uri = media_uri; + + let uri_str = format!("{}/api/llm/google/async/media/analysis", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("text_prompt", p_text_prompt.to_string()); + multipart_form_params.insert("media_uri", p_media_uri.to_string()); + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/midjourney_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/midjourney_api.rs new file mode 100644 index 0000000..5d05f1a --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/midjourney_api.rs @@ -0,0 +1,426 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`async_gen_image_api_mj_async_generate_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncGenImageApiMjAsyncGenerateImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`async_query_status_api_mj_async_query_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryStatusApiMjAsyncQueryStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`desc_img_by_file_api_mj_sync_file_img_describe_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescImgByFileApiMjSyncFileImgDescribePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`describe_image_api_api_mj_sync_img_describe_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DescribeImageApiApiMjSyncImgDescribePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`generate_image_api_api_mj_generate_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GenerateImageApiApiMjGenerateImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`generate_image_sync_api_mj_sync_image_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GenerateImageSyncApiMjSyncImagePostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`health_check_api_mj_health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthCheckApiMjHealthGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`prompt_check_api_mj_prompt_check_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PromptCheckApiMjPromptCheckGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn async_gen_image_api_mj_async_generate_image_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + + let uri_str = format!("{}/api/mj/async/generate/image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn async_query_status_api_mj_async_query_status_get(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/mj/async/query/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn desc_img_by_file_api_mj_sync_file_img_describe_post(configuration: &configuration::Configuration, img_file: std::path::PathBuf, max_wait_time: Option, poll_interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_img_file = img_file; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + + let uri_str = format!("{}/api/mj/sync/file/img/describe", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form = multipart_form.text("poll_interval", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 获取图像描述接口 +pub async fn describe_image_api_api_mj_sync_img_describe_post(configuration: &configuration::Configuration, image_url: &str, max_wait_time: Option, poll_interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_image_url = image_url; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + + let uri_str = format!("{}/api/mj/sync/img/describe", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form_params = std::collections::HashMap::new(); + multipart_form_params.insert("image_url", p_image_url.to_string()); + if let Some(param_value) = p_max_wait_time { + multipart_form_params.insert("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form_params.insert("poll_interval", param_value.to_string()); + } + req_builder = req_builder.form(&multipart_form_params); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 生成图片接口 +pub async fn generate_image_api_api_mj_generate_image_post(configuration: &configuration::Configuration, prompt: &str, img_file: Option, max_wait_time: Option, poll_interval: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_file = img_file; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + + let uri_str = format!("{}/api/mj/generate-image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("prompt", p_prompt.to_string()); + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_max_wait_time { + multipart_form = multipart_form.text("max_wait_time", param_value.to_string()); + } + if let Some(param_value) = p_poll_interval { + multipart_form = multipart_form.text("poll_interval", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 同步生成图片接口 - 提交任务并轮询结果 Args: prompt (str): 图片生成提示词 img_file: 样貌参考 --oref max_wait_time (int): 最大等待时间,默认120秒 poll_interval (int): 轮询间隔,默认2秒 Returns: dict: 包含status, msg, data的响应字典 +pub async fn generate_image_sync_api_mj_sync_image_post(configuration: &configuration::Configuration, prompt: &str, max_wait_time: Option, poll_interval: Option, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_max_wait_time = max_wait_time; + let p_poll_interval = poll_interval; + let p_img_file = img_file; + + let uri_str = format!("{}/api/mj/sync/image", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref param_value) = p_max_wait_time { + req_builder = req_builder.query(&[("max_wait_time", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_poll_interval { + req_builder = req_builder.query(&[("poll_interval", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// 健康检查接口 +pub async fn health_check_api_mj_health_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/mj/health", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn prompt_check_api_mj_prompt_check_get(configuration: &configuration::Configuration, prompt: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + + let uri_str = format!("{}/api/mj/prompt/check", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/midjourneyapi_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/midjourneyapi_api.rs new file mode 100644 index 0000000..9f7ccc6 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/midjourneyapi_api.rs @@ -0,0 +1,210 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`async_query_task_status_api_mj_video_async_task_status_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AsyncQueryTaskStatusApiMjVideoAsyncTaskStatusPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`health_check_api_mj_video_health_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum HealthCheckApiMjVideoHealthGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_video_task_api_mj_video_async_submit_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitVideoTaskApiMjVideoAsyncSubmitPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sync_submit_task_api_mj_video_sync_gen_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SyncSubmitTaskApiMjVideoSyncGenPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +pub async fn async_query_task_status_api_mj_video_async_task_status_post(configuration: &configuration::Configuration, task_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + + let uri_str = format!("{}/api/mj/video/async/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn health_check_api_mj_video_health_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/api/mj/video/health", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_video_task_api_mj_video_async_submit_post(configuration: &configuration::Configuration, prompt: &str, img_url: Option<&str>, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_url = img_url; + let p_img_file = img_file; + + let uri_str = format!("{}/api/mj/video/async/submit", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref param_value) = p_img_url { + req_builder = req_builder.query(&[("img_url", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn sync_submit_task_api_mj_video_sync_gen_post(configuration: &configuration::Configuration, prompt: &str, img_url: Option<&str>, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_prompt = prompt; + let p_img_url = img_url; + let p_img_file = img_file; + + let uri_str = format!("{}/api/mj/video/sync/gen", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("prompt", &p_prompt.to_string())]); + if let Some(ref param_value) = p_img_url { + req_builder = req_builder.query(&[("img_url", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/apis/mod.rs b/cargos/text-video-agent-rust-sdk/src/apis/mod.rs new file mode 100644 index 0000000..12f2786 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/mod.rs @@ -0,0 +1,128 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String) +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +pub mod default_api; +pub mod api_api; +pub mod class302_api; +pub mod class302ai_api_api; +pub mod class302ai_midjourney_api; +pub mod class302ai_veo_api; +pub mod comfyui_api; +pub mod hedra20_api; +pub mod hedra30_api; +pub mod llm_api; +pub mod midjourney_api; +pub mod midjourneyapi_api; +pub mod omni_human_api; + +pub mod configuration; diff --git a/cargos/text-video-agent-rust-sdk/src/apis/omni_human_api.rs b/cargos/text-video-agent-rust-sdk/src/apis/omni_human_api.rs new file mode 100644 index 0000000..0181be8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/apis/omni_human_api.rs @@ -0,0 +1,177 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`query_img_recognition_status_api_ark_omnihuman_task_status_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum QueryImgRecognitionStatusApiArkOmnihumanTaskStatusGetError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_img_recognition_api_ark_omnihuman_img_recognition_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitImgRecognitionApiArkOmnihumanImgRecognitionPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_video_generate_task_api_ark_omnihuman_video_submit_task_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitVideoGenerateTaskApiArkOmnihumanVideoSubmitTaskPostError { + Status422(models::HttpValidationError), + UnknownValue(serde_json::Value), +} + + +/// Args: task_type: face_detect: 人脸检测结果, video_generate: 视频生成结果 Returns: +pub async fn query_img_recognition_status_api_ark_omnihuman_task_status_get(configuration: &configuration::Configuration, task_id: &str, task_type: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_task_id = task_id; + let p_task_type = task_type; + + let uri_str = format!("{}/api/ark/omnihuman/task/status", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("task_id", &p_task_id.to_string())]); + if let Some(ref param_value) = p_task_type { + req_builder = req_builder.query(&[("task_type", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn submit_img_recognition_api_ark_omnihuman_img_recognition_post(configuration: &configuration::Configuration, img_url: Option<&str>, img_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_img_url = img_url; + let p_img_file = img_file; + + let uri_str = format!("{}/api/ark/omnihuman/img/recognition", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + if let Some(param_value) = p_img_url { + multipart_form = multipart_form.text("img_url", param_value.to_string()); + } + // TODO: support file upload for 'img_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Args: img_input: 输入的图片, 支持链接 + 文件流 audio_input: 输入的音频, 支持链接 + 文件流 Returns: {\"status\": True, 'data': '任务id', 'msg': '信息'} +pub async fn submit_video_generate_task_api_ark_omnihuman_video_submit_task_post(configuration: &configuration::Configuration, img_url: Option<&str>, img_file: Option, audio_url: Option<&str>, audio_file: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_img_url = img_url; + let p_img_file = img_file; + let p_audio_url = audio_url; + let p_audio_file = audio_file; + + let uri_str = format!("{}/api/ark/omnihuman/video/submit/task", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + let mut multipart_form = reqwest::multipart::Form::new(); + if let Some(param_value) = p_img_url { + multipart_form = multipart_form.text("img_url", param_value.to_string()); + } + // TODO: support file upload for 'img_file' parameter + if let Some(param_value) = p_audio_url { + multipart_form = multipart_form.text("audio_url", param_value.to_string()); + } + // TODO: support file upload for 'audio_file' parameter + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/lib.rs b/cargos/text-video-agent-rust-sdk/src/lib.rs new file mode 100644 index 0000000..e152062 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/cargos/text-video-agent-rust-sdk/src/models/file_upload_response.rs b/cargos/text-video-agent-rust-sdk/src/models/file_upload_response.rs new file mode 100644 index 0000000..d3746f8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/file_upload_response.rs @@ -0,0 +1,37 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// FileUploadResponse : 文件上传响应模型 +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileUploadResponse { + /// 上传状态 + #[serde(rename = "status")] + pub status: bool, + /// 响应消息 + #[serde(rename = "msg")] + pub msg: String, + #[serde(rename = "data", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub data: Option>, +} + +impl FileUploadResponse { + /// 文件上传响应模型 + pub fn new(status: bool, msg: String) -> FileUploadResponse { + FileUploadResponse { + status, + msg, + data: None, + } + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/models/http_validation_error.rs b/cargos/text-video-agent-rust-sdk/src/models/http_validation_error.rs new file mode 100644 index 0000000..2d9b2bd --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/http_validation_error.rs @@ -0,0 +1,27 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpValidationError { + #[serde(rename = "detail", skip_serializing_if = "Option::is_none")] + pub detail: Option>, +} + +impl HttpValidationError { + pub fn new() -> HttpValidationError { + HttpValidationError { + detail: None, + } + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/models/mod.rs b/cargos/text-video-agent-rust-sdk/src/models/mod.rs new file mode 100644 index 0000000..f8db03a --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/mod.rs @@ -0,0 +1,10 @@ +pub mod file_upload_response; +pub use self::file_upload_response::FileUploadResponse; +pub mod http_validation_error; +pub use self::http_validation_error::HttpValidationError; +pub mod task_request; +pub use self::task_request::TaskRequest; +pub mod validation_error; +pub use self::validation_error::ValidationError; +pub mod validation_error_loc_inner; +pub use self::validation_error_loc_inner::ValidationErrorLocInner; diff --git a/cargos/text-video-agent-rust-sdk/src/models/task_request.rs b/cargos/text-video-agent-rust-sdk/src/models/task_request.rs new file mode 100644 index 0000000..6892973 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/task_request.rs @@ -0,0 +1,38 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TaskRequest { + #[serde(rename = "task_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub task_type: Option>, + /// 生图的提示词 + #[serde(rename = "prompt")] + pub prompt: String, + #[serde(rename = "img_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub img_url: Option>, + /// 生成图片,视频的分辨率 + #[serde(rename = "ar", skip_serializing_if = "Option::is_none")] + pub ar: Option, +} + +impl TaskRequest { + pub fn new(prompt: String) -> TaskRequest { + TaskRequest { + task_type: None, + prompt, + img_url: None, + ar: None, + } + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/models/validation_error.rs b/cargos/text-video-agent-rust-sdk/src/models/validation_error.rs new file mode 100644 index 0000000..4893be8 --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/validation_error.rs @@ -0,0 +1,33 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ValidationError { + #[serde(rename = "loc")] + pub loc: Vec, + #[serde(rename = "msg")] + pub msg: String, + #[serde(rename = "type")] + pub r#type: String, +} + +impl ValidationError { + pub fn new(loc: Vec, msg: String, r#type: String) -> ValidationError { + ValidationError { + loc, + msg, + r#type, + } + } +} + diff --git a/cargos/text-video-agent-rust-sdk/src/models/validation_error_loc_inner.rs b/cargos/text-video-agent-rust-sdk/src/models/validation_error_loc_inner.rs new file mode 100644 index 0000000..54a9f4d --- /dev/null +++ b/cargos/text-video-agent-rust-sdk/src/models/validation_error_loc_inner.rs @@ -0,0 +1,24 @@ +/* + * Text Video Agent Api + * + * 文本生成视频API服务 + * + * The version of the OpenAPI document: 1.0.6 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ValidationErrorLocInner { +} + +impl ValidationErrorLocInner { + pub fn new() -> ValidationErrorLocInner { + ValidationErrorLocInner { + } + } +} + diff --git a/openapi.json b/openapi.json index 69b5c3e..65d6136 100644 --- a/openapi.json +++ b/openapi.json @@ -6,60 +6,10 @@ "version": "1.0.6" }, "paths": { - "/api/prompt/default": { + "/": { "get": { - "tags": [ - "提示词预处理" - ], - "summary": "获取示例提示词", - "operationId": "get_sample_prompt_api_prompt_default_get", - "parameters": [ - { - "name": "task_type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Task Type" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/prompt/health": { - "get": { - "tags": [ - "提示词预处理" - ], - "summary": "健康检测", - "operationId": "health_check_api_prompt_health_get", + "summary": "Root", + "operationId": "root__get", "responses": { "200": { "description": "Successful Response", @@ -428,344 +378,6 @@ } } }, - "/api/mj/prompt/check": { - "get": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "🔥图片提示词预审", - "operationId": "prompt_check_api_mj_prompt_check_get", - "parameters": [ - { - "name": "prompt", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Prompt" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/sync/image": { - "post": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "同步生成图片接口", - "description": "同步生成图片接口 - 提交任务并轮询结果\n\nArgs:\n prompt (str): 图片生成提示词\n img_file: 样貌参考 --oref\n max_wait_time (int): 最大等待时间,默认120秒\n poll_interval (int): 轮询间隔,默认2秒\n\nReturns:\n dict: 包含status, msg, data的响应字典", - "operationId": "generate_image_sync_api_mj_sync_image_post", - "parameters": [ - { - "name": "prompt", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Prompt" - } - }, - { - "name": "max_wait_time", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 120, - "title": "Max Wait Time" - } - }, - { - "name": "poll_interval", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 2, - "title": "Poll Interval" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_generate_image_sync_api_mj_sync_image_post" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/generate-image": { - "post": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "生成图片", - "description": "生成图片接口", - "operationId": "generate_image_api_api_mj_generate_image_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_generate_image_api_api_mj_generate_image_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/sync/img/describe": { - "post": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "获取图像描述", - "description": "获取图像描述接口", - "operationId": "describe_image_api_api_mj_sync_img_describe_post", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/Body_describe_image_api_api_mj_sync_img_describe_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/sync/file/img/describe": { - "post": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "通过文件获取生图的提示词", - "operationId": "desc_img_by_file_api_mj_sync_file_img_describe_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_desc_img_by_file_api_mj_sync_file_img_describe_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/health": { - "get": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "健康检查", - "description": "健康检查接口", - "operationId": "health_check_api_mj_health_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/mj/async/generate/image": { - "post": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "异步提交生图任务", - "operationId": "async_gen_image_api_mj_async_generate_image_post", - "parameters": [ - { - "name": "prompt", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Prompt" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_async_gen_image_api_mj_async_generate_image_post" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/async/query/status": { - "get": { - "tags": [ - "Midjourney图片生成" - ], - "summary": "异步查询任务状态", - "operationId": "async_query_status_api_mj_async_query_status_get", - "parameters": [ - { - "name": "task_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Task Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, "/api/jm/generate-video": { "post": { "tags": [ @@ -1083,195 +695,6 @@ } } }, - "/api/mj/video/async/submit": { - "post": { - "tags": [ - "midjourney视频生成api" - ], - "summary": "异步提交生成视频任务", - "operationId": "submit_video_task_api_mj_video_async_submit_post", - "parameters": [ - { - "name": "prompt", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Prompt" - } - }, - { - "name": "img_url", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Img Url" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_submit_video_task_api_mj_video_async_submit_post" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/video/async/task/status": { - "post": { - "tags": [ - "midjourney视频生成api" - ], - "summary": "异步查询生成任务进度", - "operationId": "async_query_task_status_api_mj_video_async_task_status_post", - "parameters": [ - { - "name": "task_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Task Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/video/sync/gen": { - "post": { - "tags": [ - "midjourney视频生成api" - ], - "summary": "同步生成视频视频", - "operationId": "sync_submit_task_api_mj_video_sync_gen_post", - "parameters": [ - { - "name": "prompt", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Prompt" - } - }, - { - "name": "img_url", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Img Url" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_sync_submit_task_api_mj_video_sync_gen_post" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/mj/video/health": { - "get": { - "tags": [ - "midjourney视频生成api" - ], - "summary": "健康检查", - "operationId": "health_check_api_mj_video_health_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, "/api/302/mj/async/generate/image": { "post": { "tags": [ @@ -1398,6 +821,16 @@ "default": false, "title": "Cdn Flag" } + }, + { + "name": "mode", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "fast", + "title": "Mode" + } } ], "responses": { @@ -1506,6 +939,7 @@ "🔥302ai Midjourney图片生成" ], "summary": "同步生成图片接口", + "description": "Args:\n\n mode: 模式 支持 fast turbo 模式\n\nReturns:", "operationId": "generate_image_sync_api_302_mj_sync_image_post", "parameters": [ { @@ -1536,6 +970,16 @@ "default": 4, "title": "Poll Interval" } + }, + { + "name": "mode", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "fast", + "title": "Mode" + } } ], "requestBody": { @@ -1934,129 +1378,6 @@ } } }, - "/api/302/hedra/v2/submit/task": { - "post": { - "tags": [ - "hedra 口型合成【2.0】" - ], - "summary": "提交口型合成任务", - "operationId": "submit_character_task_api_302_hedra_v2_submit_task_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_submit_character_task_api_302_hedra_v2_submit_task_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "deprecated": true - } - }, - "/api/302/hedra/v2/task/status": { - "get": { - "tags": [ - "hedra 口型合成【2.0】" - ], - "summary": "查询任务状态", - "operationId": "query_task_status_api_302_hedra_v2_task_status_get", - "deprecated": true, - "parameters": [ - { - "name": "task_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "description": "task_id", - "title": "Task Id" - }, - "description": "task_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/302/hedra/v2/upload": { - "post": { - "tags": [ - "hedra 口型合成【2.0】" - ], - "summary": "上传文件到hedra服务器仅支持,image, audio", - "operationId": "internal_upload_file_api_302_hedra_v2_upload_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_internal_upload_file_api_302_hedra_v2_upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "deprecated": true - } - }, "/api/302/hedra/v3/file/upload": { "post": { "tags": [ @@ -2313,163 +1634,6 @@ } } }, - "/api/union/img/model/list": { - "get": { - "tags": [ - "🔥【聚合接口】图片生成" - ], - "summary": "获取支持的模型列表", - "operationId": "fetch_supported_model_api_union_img_model_list_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/union/img/sync/generate/image": { - "post": { - "tags": [ - "🔥【聚合接口】图片生成" - ], - "summary": "生图", - "description": "详细参考: https://doc.302.ai/286288228e0", - "operationId": "sync_gen_image_api_union_img_sync_generate_image_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_sync_gen_image_api_union_img_sync_generate_image_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/union/video/model/list": { - "get": { - "tags": [ - "🔥【聚合接口】视频生成接口" - ], - "summary": "获取支持的模型列表", - "operationId": "fetch_supported_model_api_union_video_model_list_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/api/union/video/async/generate/video": { - "post": { - "tags": [ - "🔥【聚合接口】视频生成接口" - ], - "summary": "异步提交任务", - "operationId": "submit_task_api_union_video_async_generate_video_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_submit_task_api_union_video_async_generate_video_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/api/union/video/async/{task_id}/status": { - "get": { - "tags": [ - "🔥【聚合接口】视频生成接口" - ], - "summary": "异步查询任务状态", - "operationId": "query_task_status_api_union_video_async__task_id__status_get", - "parameters": [ - { - "name": "task_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Task Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, "/api/comfy/fetch/running/node": { "get": { "tags": [ @@ -2633,10 +1797,13 @@ } } }, - "/": { + "/api/union/img/model/list": { "get": { - "summary": "Root", - "operationId": "root__get", + "tags": [ + "【302 聚合图片生成接口】" + ], + "summary": "获取支持的模型列表", + "operationId": "fetch_supported_model_api_union_img_model_list_get", "responses": { "200": { "description": "Successful Response", @@ -2649,10 +1816,24 @@ } } }, - "/health": { - "get": { - "summary": "Health Check", - "operationId": "health_check_health_get", + "/api/union/img/sync/generate/image": { + "post": { + "tags": [ + "【302 聚合图片生成接口】" + ], + "summary": "生图", + "description": "详细参考: https://doc.302.ai/286288228e0", + "operationId": "sync_gen_image_api_union_img_sync_generate_image_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_sync_gen_image_api_union_img_sync_generate_image_post" + } + } + }, + "required": true + }, "responses": { "200": { "description": "Successful Response", @@ -2661,6 +1842,1830 @@ "schema": {} } } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/union/video/model/list": { + "get": { + "tags": [ + "【302 聚合视频生成接口】" + ], + "summary": "获取支持的模型列表", + "operationId": "fetch_supported_model_api_union_video_model_list_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/api/union/video/async/generate/video": { + "post": { + "tags": [ + "【302 聚合视频生成接口】" + ], + "summary": "异步提交任务", + "operationId": "submit_task_api_union_video_async_generate_video_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_task_api_union_video_async_generate_video_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/union/video/async/{task_id}/status": { + "get": { + "tags": [ + "【302 聚合视频生成接口】" + ], + "summary": "异步查询任务状态", + "operationId": "query_task_status_api_union_video_async__task_id__status_get", + "parameters": [ + { + "name": "task_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Task Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/model/list": { + "get": { + "tags": [ + "🔥【稳定:图片,视频生成接口】" + ], + "summary": "获取支持的模型列表", + "operationId": "get_supported_model_api_custom_model_list_get", + "parameters": [ + { + "name": "category", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "分类: 可取的值有: image, video", + "default": "image", + "title": "Category" + }, + "description": "分类: 可取的值有: image, video" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/image/submit/task": { + "post": { + "tags": [ + "🔥【稳定:图片,视频生成接口】" + ], + "summary": "提交图片生成任务", + "operationId": "submit_image_task_api_custom_image_submit_task_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_image_task_api_custom_image_submit_task_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/video/submit/task": { + "post": { + "tags": [ + "🔥【稳定:图片,视频生成接口】" + ], + "summary": "提交视频生成任务", + "operationId": "submit_video_task_api_custom_video_submit_task_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_video_task_api_custom_video_submit_task_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/task/status": { + "get": { + "tags": [ + "🔥【稳定:图片,视频生成接口】" + ], + "summary": "Query Task Status", + "operationId": "query_task_status_api_custom_task_status_get", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/model/list": { + "get": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "获取支持的模型列表", + "operationId": "get_supported_model_api_custom_extend_model_list_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/api/custom/extend/higgsfield/create/character": { + "post": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "提交创建生成角色任务", + "operationId": "create_higgsfield_character_api_custom_extend_higgsfield_create_character_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_create_higgsfield_character_api_custom_extend_higgsfield_create_character_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/higgsfield/character/status": { + "post": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "查询创建角色状态", + "operationId": "query_higgsfield_character_status_api_custom_extend_higgsfield_character_status_post", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/higgsfield/submit/task": { + "post": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "higgsfield Soul(文生图片)模型", + "operationId": "handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/higgsfield/task/status": { + "get": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "higgsfield 查询任务执行状态", + "operationId": "query_higgsfield_task_status_api_custom_extend_higgsfield_task_status_get", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/frame/submit/task": { + "post": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "【首尾帧生成视频】", + "operationId": "submit_frame_video_task_api_custom_extend_frame_submit_task_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_submit_frame_video_task_api_custom_extend_frame_submit_task_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/custom/extend/frame/task/status": { + "get": { + "tags": [ + "🔥【特殊模型】图片,视频生成" + ], + "summary": "查询首尾帧任务状态", + "description": "Args:\n 只要返回的 status 类型 为bool代表任务已经结束,直接从data里取值就行\n\nReturns:", + "operationId": "query_frame_task_status_api_custom_extend_frame_task_status_get", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/omnihuman/img/recognition": { + "post": { + "tags": [ + "火山OmniHuman 接口" + ], + "summary": "提交图片检测任务,图片中是否包含人、类人、拟人等主体", + "operationId": "submit_img_recognition_api_ark_omnihuman_img_recognition_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_img_recognition_api_ark_omnihuman_img_recognition_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/omnihuman/video/submit/task": { + "post": { + "tags": [ + "火山OmniHuman 接口" + ], + "summary": "提交视频生成任务", + "description": "Args:\n\n img_input: 输入的图片, 支持链接 + 文件流\n\n audio_input: 输入的音频, 支持链接 + 文件流\n\nReturns: {\"status\": True, 'data': '任务id', 'msg': '信息'}", + "operationId": "submit_video_generate_task_api_ark_omnihuman_video_submit_task_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_video_generate_task_api_ark_omnihuman_video_submit_task_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/omnihuman/task/status": { + "get": { + "tags": [ + "火山OmniHuman 接口" + ], + "summary": "查询任务状态", + "description": "Args:\n\n task_type: face_detect: 人脸检测结果, video_generate: 视频生成结果\nReturns:", + "operationId": "query_img_recognition_status_api_ark_omnihuman_task_status_get", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + }, + { + "name": "task_type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "任务类型,支持 face_detect, video_generate", + "default": "face_detect", + "title": "Task Type" + }, + "description": "任务类型,支持 face_detect, video_generate" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/digital/url2vid": { + "post": { + "tags": [ + "火山数字人接口" + ], + "summary": "【异步】上传视频生成视频云id, 仅仅支持mp4格式的视频,视频时长较时时,建议使用链接", + "operationId": "upload_file_2cloud_api_ark_digital_url2vid_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_upload_file_2cloud_api_ark_digital_url2vid_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/digital/create": { + "post": { + "tags": [ + "火山数字人接口" + ], + "summary": "提交创建数字人任务", + "operationId": "handler_create_digital_api_ark_digital_create_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_handler_create_digital_api_ark_digital_create_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/digital/video/submit/task": { + "post": { + "tags": [ + "火山数字人接口" + ], + "summary": "生成数字人视频", + "operationId": "handler_submit_generate_video_api_ark_digital_video_submit_task_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_handler_submit_generate_video_api_ark_digital_video_submit_task_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/ark/digital/task/status": { + "get": { + "tags": [ + "火山数字人接口" + ], + "summary": "查询任务状态", + "description": "Args:\n\n task_id: 任务id\n\n task_type: upload: 上传视频文件 create_digital: 创建数字人 video_generate:视频生成\n\nReturns:", + "operationId": "query_task_status_api_ark_digital_task_status_get", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "查询任务状态", + "title": "Task Id" + }, + "description": "查询任务状态" + }, + { + "name": "task_type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "任务类型: upload, create_digital, video_generate", + "default": "video_generate", + "title": "Task Type" + }, + "description": "任务类型: upload, create_digital, video_generate" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/model/list": { + "get": { + "tags": [ + "llm调用" + ], + "summary": "获取支持的模型列表", + "operationId": "llm_supported_models", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/api/llm/chat": { + "post": { + "tags": [ + "llm调用" + ], + "summary": "调用大模型进行推理", + "operationId": "llm_chat", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_llm_chat" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/google/chat": { + "post": { + "tags": [ + "llm调用" + ], + "summary": "调用google推理", + "operationId": "invoke_gemini_ai_api_llm_google_chat_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_invoke_gemini_ai_api_llm_google_chat_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/google/sync/media/analysis": { + "post": { + "tags": [ + "llm调用" + ], + "summary": "【同步适合小文件】gemini多模态分析,支持视频,音频,图片", + "operationId": "invoke_media_analysis_api_llm_google_sync_media_analysis_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_invoke_media_analysis_api_llm_google_sync_media_analysis_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/google/async/media/analysis": { + "post": { + "tags": [ + "llm调用" + ], + "summary": "【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片", + "operationId": "submit_media_inference_api_llm_google_async_media_analysis_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_submit_media_inference_api_llm_google_async_media_analysis_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/google/vertex-ai/upload": { + "post": { + "tags": [ + "llm调用" + ], + "summary": "上传文件到谷歌存储,用于gemini视觉功能", + "description": "Args:\n local_file: 本地文件支持 音频,视频, 图片\n\n\n Returns: \n {\n \"status\": \"状态信息, true 成功, false 失败\",\n \"data\": \"gs://fashion_image_block/gallery_v2/mp4/1f76996f-a13e-450e-8c86-029c398932c4.mp4\", 分析媒体时候使用该字段\n \"msg\": \"\",\n \"extra\": 原始信息\n}", + "operationId": "google_file_upload", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_google_file_upload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/llm/task/status": { + "get": { + "tags": [ + "llm调用" + ], + "summary": "查询推理过程结果", + "description": "Args:\n task_id: 任务id\n\n\nReturns:\n\n {'status': '值为字符串的时候标识任务运行的状态,为布尔值时,标识任务运行完毕!', 'data': '', 'msg': ''}", + "operationId": "llm_task_id", + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "任务id", + "title": "Task Id" + }, + "description": "任务id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/prompt/default": { + "get": { + "tags": [ + "提示词预处理" + ], + "summary": "获取示例提示词", + "operationId": "get_sample_prompt_api_prompt_default_get", + "deprecated": true, + "parameters": [ + { + "name": "task_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Task Type" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/prompt/health": { + "get": { + "tags": [ + "提示词预处理" + ], + "summary": "健康检测", + "operationId": "health_check_api_prompt_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/video/async/submit": { + "post": { + "tags": [ + "midjourney视频生成api" + ], + "summary": "异步提交生成视频任务", + "operationId": "submit_video_task_api_mj_video_async_submit_post", + "deprecated": true, + "parameters": [ + { + "name": "prompt", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Prompt" + } + }, + { + "name": "img_url", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_video_task_api_mj_video_async_submit_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/video/async/task/status": { + "post": { + "tags": [ + "midjourney视频生成api" + ], + "summary": "异步查询生成任务进度", + "operationId": "async_query_task_status_api_mj_video_async_task_status_post", + "deprecated": true, + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Task Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/video/sync/gen": { + "post": { + "tags": [ + "midjourney视频生成api" + ], + "summary": "同步生成视频视频", + "operationId": "sync_submit_task_api_mj_video_sync_gen_post", + "deprecated": true, + "parameters": [ + { + "name": "prompt", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Prompt" + } + }, + { + "name": "img_url", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_sync_submit_task_api_mj_video_sync_gen_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/video/health": { + "get": { + "tags": [ + "midjourney视频生成api" + ], + "summary": "健康检查", + "operationId": "health_check_api_mj_video_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "deprecated": true + } + }, + "/api/302/hedra/v2/submit/task": { + "post": { + "tags": [ + "hedra 口型合成【2.0】" + ], + "summary": "提交口型合成任务", + "operationId": "submit_character_task_api_302_hedra_v2_submit_task_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_submit_character_task_api_302_hedra_v2_submit_task_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true + } + }, + "/api/302/hedra/v2/task/status": { + "get": { + "tags": [ + "hedra 口型合成【2.0】" + ], + "summary": "查询任务状态", + "operationId": "query_task_status_api_302_hedra_v2_task_status_get", + "deprecated": true, + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "task_id", + "title": "Task Id" + }, + "description": "task_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/302/hedra/v2/upload": { + "post": { + "tags": [ + "hedra 口型合成【2.0】" + ], + "summary": "上传文件到hedra服务器仅支持,image, audio", + "operationId": "internal_upload_file_api_302_hedra_v2_upload_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_internal_upload_file_api_302_hedra_v2_upload_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/prompt/check": { + "get": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "🔥图片提示词预审", + "operationId": "prompt_check_api_mj_prompt_check_get", + "deprecated": true, + "parameters": [ + { + "name": "prompt", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Prompt" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/sync/image": { + "post": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "同步生成图片接口", + "description": "同步生成图片接口 - 提交任务并轮询结果\n\nArgs:\n prompt (str): 图片生成提示词\n img_file: 样貌参考 --oref\n max_wait_time (int): 最大等待时间,默认120秒\n poll_interval (int): 轮询间隔,默认2秒\n\nReturns:\n dict: 包含status, msg, data的响应字典", + "operationId": "generate_image_sync_api_mj_sync_image_post", + "deprecated": true, + "parameters": [ + { + "name": "prompt", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Prompt" + } + }, + { + "name": "max_wait_time", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 120, + "title": "Max Wait Time" + } + }, + { + "name": "poll_interval", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 2, + "title": "Poll Interval" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_generate_image_sync_api_mj_sync_image_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/generate-image": { + "post": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "生成图片", + "description": "生成图片接口", + "operationId": "generate_image_api_api_mj_generate_image_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_generate_image_api_api_mj_generate_image_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/sync/img/describe": { + "post": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "获取图像描述", + "description": "获取图像描述接口", + "operationId": "describe_image_api_api_mj_sync_img_describe_post", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/Body_describe_image_api_api_mj_sync_img_describe_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/sync/file/img/describe": { + "post": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "通过文件获取生图的提示词", + "operationId": "desc_img_by_file_api_mj_sync_file_img_describe_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_desc_img_by_file_api_mj_sync_file_img_describe_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/health": { + "get": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "健康检查", + "description": "健康检查接口", + "operationId": "health_check_api_mj_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "deprecated": true + } + }, + "/api/mj/async/generate/image": { + "post": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "异步提交生图任务", + "operationId": "async_gen_image_api_mj_async_generate_image_post", + "deprecated": true, + "parameters": [ + { + "name": "prompt", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Prompt" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_async_gen_image_api_mj_async_generate_image_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mj/async/query/status": { + "get": { + "tags": [ + "Midjourney图片生成" + ], + "summary": "异步查询任务状态", + "operationId": "async_query_status_api_mj_async_query_status_get", + "deprecated": true, + "parameters": [ + { + "name": "task_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Task Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } } } } @@ -2682,6 +3687,12 @@ ], "title": "Img File", "description": "样貌参考图片" + }, + "mode": { + "type": "string", + "title": "Mode", + "description": "运行模式,支持 turbo, fast", + "default": "fast" } }, "type": "object", @@ -2824,6 +3835,29 @@ ], "title": "Body_async_gen_video_api_jm_async_generate_video_post" }, + "Body_create_higgsfield_character_api_custom_extend_higgsfield_create_character_post": { + "properties": { + "img_urls": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Img Urls", + "description": "最多支持70张图" + }, + "name": { + "type": "string", + "title": "Name", + "description": "角色名称前缀,默认即可", + "default": "bw_hg_character" + } + }, + "type": "object", + "required": [ + "img_urls" + ], + "title": "Body_create_higgsfield_character_api_custom_extend_higgsfield_create_character_post" + }, "Body_desc_img_by_file_api_302_mj_sync_file_img_describe_post": { "properties": { "img_file": { @@ -3058,6 +4092,41 @@ ], "title": "Body_generate_video_api_api_jm_generate_video_post" }, + "Body_google_file_upload": { + "properties": { + "local_file": { + "type": "string", + "format": "binary", + "title": "Local File", + "description": "本地文件" + } + }, + "type": "object", + "required": [ + "local_file" + ], + "title": "Body_google_file_upload" + }, + "Body_handler_create_digital_api_ark_digital_create_post": { + "properties": { + "vid": { + "type": "string", + "title": "Vid", + "description": "模板视频vid,对应于@/url2vid 接口的返回值" + }, + "interaction_optimise": { + "type": "boolean", + "title": "Interaction Optimise", + "description": "是否开启针对直播的优化, 默认开启", + "default": true + } + }, + "type": "object", + "required": [ + "vid" + ], + "title": "Body_handler_create_digital_api_ark_digital_create_post" + }, "Body_handler_hedra_task_submit_api_302_hedra_v3_submit_task_post": { "properties": { "img_file": { @@ -3098,6 +4167,115 @@ ], "title": "Body_handler_hedra_task_submit_api_302_hedra_v3_submit_task_post" }, + "Body_handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "正向提示词" + }, + "negative_prompt": { + "type": "string", + "title": "Negative Prompt", + "description": "负向提示词,页面中不包含的特征,元素", + "default": "" + }, + "style_id": { + "type": "string", + "title": "Style Id", + "description": "风格样式模版, 参考:https://302ai.apifox.cn/316235557e0" + }, + "aspect_ratio": { + "type": "string", + "title": "Aspect Ratio", + "description": "尺寸长宽比支持:'9:16', '3:4', '2:3', '1:1', '4:3', '16:9', '3:2'" + }, + "custom_reference_id": { + "type": "string", + "title": "Custom Reference Id", + "description": "自定义角色特征id" + }, + "custom_reference_strength": { + "type": "number", + "title": "Custom Reference Strength", + "description": "自定义角色参数权重[0,1]之间" + }, + "quality": { + "type": "string", + "title": "Quality", + "description": "生成图片的质量, basic, high", + "default": "high" + } + }, + "type": "object", + "required": [ + "prompt", + "style_id", + "aspect_ratio" + ], + "title": "Body_handler_higgsfield_submit_task_api_custom_extend_higgsfield_submit_task_post" + }, + "Body_handler_submit_generate_video_api_ark_digital_video_submit_task_post": { + "properties": { + "resource_id": { + "type": "string", + "title": "Resource Id", + "description": "克隆数字人id", + "default": "250623-zhibo-linyunzhi" + }, + "templ_start_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Templ Start Strategy", + "description": "指定模板开始策略: 参考:https://www.volcengine.com/docs/85128/1773810" + }, + "templ_start_seconds": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Templ Start Seconds", + "description": "指定渲染模版开始时间点: 与 templ_start_strategy 搭配使用" + }, + "audio_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Audio Url", + "description": "音频url,与audio_file二选一" + }, + "audio_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Audio File", + "description": "音频文件,与audio_file二选一" + } + }, + "type": "object", + "title": "Body_handler_submit_generate_video_api_ark_digital_video_submit_task_post" + }, "Body_hl_tts_api_302_hl_router_sync_generate_speech_post": { "properties": { "text": { @@ -3150,6 +4328,84 @@ ], "title": "Body_internal_upload_file_api_302_hedra_v2_upload_post" }, + "Body_invoke_gemini_ai_api_llm_google_chat_post": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "prompt输入" + }, + "timeout": { + "type": "number", + "title": "Timeout", + "description": "超时时间", + "default": 180 + } + }, + "type": "object", + "required": [ + "prompt" + ], + "title": "Body_invoke_gemini_ai_api_llm_google_chat_post" + }, + "Body_invoke_media_analysis_api_llm_google_sync_media_analysis_post": { + "properties": { + "text_prompt": { + "type": "string", + "title": "Text Prompt", + "description": "文本提示词" + }, + "media_uri": { + "type": "string", + "title": "Media Uri", + "description": "gs:xxxx, 上传到谷歌vertex ai 上的链接" + } + }, + "type": "object", + "required": [ + "text_prompt", + "media_uri" + ], + "title": "Body_invoke_media_analysis_api_llm_google_sync_media_analysis_post" + }, + "Body_llm_chat": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "prompt输入" + }, + "model_name": { + "type": "string", + "title": "Model Name", + "description": "模型名称, 从/model/list接口获取", + "default": "gemini-2.5-flash" + }, + "temperature": { + "type": "number", + "title": "Temperature", + "description": "模型的温度值", + "default": 0.7 + }, + "max_tokens": { + "type": "integer", + "title": "Max Tokens", + "description": "最大token值", + "default": 4096 + }, + "timeout": { + "type": "number", + "title": "Timeout", + "description": "超时时间,推理", + "default": 180 + } + }, + "type": "object", + "required": [ + "prompt" + ], + "title": "Body_llm_chat" + }, "Body_submit_character_task_api_302_hedra_v2_submit_task_post": { "properties": { "avatar_file": { @@ -3172,6 +4428,156 @@ ], "title": "Body_submit_character_task_api_302_hedra_v2_submit_task_post" }, + "Body_submit_frame_video_task_api_custom_extend_frame_submit_task_post": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "正向提示词" + }, + "head_img_url": { + "type": "string", + "title": "Head Img Url", + "description": "首帧图片url" + }, + "tail_img_url": { + "type": "string", + "title": "Tail Img Url", + "description": "尾帧图片url" + }, + "model_name": { + "type": "string", + "title": "Model Name", + "description": "生成视频的模型" + }, + "duration": { + "type": "string", + "title": "Duration", + "description": "视频时长,注意部分模型不支持", + "default": "5" + }, + "aspect_ratio": { + "type": "string", + "title": "Aspect Ratio", + "description": "长宽比,部分模型支持", + "default": "9:16" + }, + "resolution": { + "type": "string", + "title": "Resolution", + "description": "分辨率,部门模型支持", + "default": "default" + }, + "webhook_flag": { + "type": "boolean", + "title": "Webhook Flag", + "description": "是否触发webhook回调", + "default": false + } + }, + "type": "object", + "required": [ + "prompt", + "head_img_url", + "tail_img_url", + "model_name" + ], + "title": "Body_submit_frame_video_task_api_custom_extend_frame_submit_task_post" + }, + "Body_submit_image_task_api_custom_image_submit_task_post": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "生图的提示词" + }, + "model_name": { + "type": "string", + "title": "Model Name", + "description": "模型名称, 从/model/list 接口获取", + "default": "ttapi/mj" + }, + "aspect_ratio": { + "type": "string", + "title": "Aspect Ratio", + "description": "尺寸", + "default": "9:16" + }, + "mode": { + "type": "string", + "title": "Mode", + "description": "部分模型支持, mj fast, turbo 两种模式", + "default": "turbo" + }, + "webhook_flag": { + "type": "boolean", + "title": "Webhook Flag", + "description": "是否触发webhook回调", + "default": false + }, + "img_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url", + "description": "图片URL,与img_file二选一" + }, + "img_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Img File", + "description": "图片文件,与img_url二选一" + } + }, + "type": "object", + "required": [ + "prompt" + ], + "title": "Body_submit_image_task_api_custom_image_submit_task_post" + }, + "Body_submit_img_recognition_api_ark_omnihuman_img_recognition_post": { + "properties": { + "img_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url", + "description": "图片URL,与img_file二选一" + }, + "img_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Img File", + "description": "图片文件,与img_url二选一" + } + }, + "type": "object", + "title": "Body_submit_img_recognition_api_ark_omnihuman_img_recognition_post" + }, "Body_submit_iv_submit_api_302_veo_video_async_submit_post": { "properties": { "prompt": { @@ -3199,6 +4605,26 @@ ], "title": "Body_submit_iv_submit_api_302_veo_video_async_submit_post" }, + "Body_submit_media_inference_api_llm_google_async_media_analysis_post": { + "properties": { + "text_prompt": { + "type": "string", + "title": "Text Prompt", + "description": "文本提示词" + }, + "media_uri": { + "type": "string", + "title": "Media Uri", + "description": "gs:xxxx, 上传到谷歌vertex ai 上的链接" + } + }, + "type": "object", + "required": [ + "text_prompt", + "media_uri" + ], + "title": "Body_submit_media_inference_api_llm_google_async_media_analysis_post" + }, "Body_submit_task_api_302_mj_video_async_submit_post": { "properties": { "prompt": { @@ -3272,6 +4698,129 @@ ], "title": "Body_submit_task_api_union_video_async_generate_video_post" }, + "Body_submit_video_generate_task_api_ark_omnihuman_video_submit_task_post": { + "properties": { + "img_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url", + "description": "图片URL,与img_file二选一" + }, + "img_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Img File", + "description": "图片文件,与img_url二选一" + }, + "audio_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Audio Url", + "description": "音频url,与audio_file二选一" + }, + "audio_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Audio File", + "description": "音频文件,与audio_file二选一" + } + }, + "type": "object", + "title": "Body_submit_video_generate_task_api_ark_omnihuman_video_submit_task_post" + }, + "Body_submit_video_task_api_custom_video_submit_task_post": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt", + "description": "生成视频的动作提示词" + }, + "model_name": { + "type": "string", + "title": "Model Name", + "description": "生成视频才用的模型, 从/model/list 接口获取" + }, + "duration": { + "type": "string", + "title": "Duration", + "description": "生成视频的时长,部分模型不支持设置时长,具体参数模型", + "default": "5" + }, + "resolution": { + "type": "string", + "title": "Resolution", + "description": "部分模型支持", + "default": "720p" + }, + "aspect_ratio": { + "type": "string", + "title": "Aspect Ratio", + "description": "长宽比,部分模型支持", + "default": "9:16" + }, + "webhook_flag": { + "type": "boolean", + "title": "Webhook Flag" + }, + "img_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Img Url", + "description": "图片URL,与img_file二选一" + }, + "img_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Img File", + "description": "图片文件,与img_url二选一" + } + }, + "type": "object", + "required": [ + "prompt", + "model_name" + ], + "title": "Body_submit_video_task_api_custom_video_submit_task_post" + }, "Body_submit_video_task_api_mj_video_async_submit_post": { "properties": { "img_file": { @@ -3530,6 +5079,37 @@ "type": "object", "title": "Body_sync_submit_task_api_mj_video_sync_gen_post" }, + "Body_upload_file_2cloud_api_ark_digital_url2vid_post": { + "properties": { + "video_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Video Url", + "description": "视频链接, video_url 与 video_file二选一" + }, + "video_file": { + "anyOf": [ + { + "type": "string", + "format": "binary" + }, + { + "type": "null" + } + ], + "title": "Video File", + "description": "视频文件,video_url 与 video_file二选一" + } + }, + "type": "object", + "title": "Body_upload_file_2cloud_api_ark_digital_url2vid_post" + }, "Body_upload_file_api_file_upload_post": { "properties": { "file": { diff --git a/openapi.md b/openapi.md index 603ea50..87648c5 100644 --- a/openapi.md +++ b/openapi.md @@ -2,90 +2,94 @@ ## 概述 -Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1.0.6。该API提供了多种AI生成服务,包括图片生成、视频生成、音频生成、口型合成等功能,支持多个AI服务提供商。 +Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1.0.6。该API提供了多种AI生成服务,包括图片生成、视频生成、音频生成、口型合成、数字人生成、LLM推理等功能,支持多个AI服务提供商。 ## API 分类概览 -### 1. 提示词预处理 (Prompt Processing) -- 获取示例提示词 -- 健康检测 - -### 2. 文件操作 (File Operations) +### 1. 文件操作 (File Operations) - 文件上传到云存储(COS/S3) - 健康检测 -### 3. 视频模板管理 (Video Template Management) +### 2. 视频模板管理 (Video Template Management) - 模板CRUD操作 - 任务类型检查 - 分页查询 -### 4. Midjourney图片生成 (Midjourney Image Generation) -- 图片生成(同步/异步) -- 图片描述反推 -- 提示词预审 - -### 5. 极梦视频生成 (JiMeng Video Generation) +### 3. 极梦视频生成 (JiMeng Video Generation) - 视频生成(同步/异步) - 任务状态查询 -### 6. 任务管理 (Task Management) +### 4. 任务管理 (Task Management) - 异步任务提交 - 任务状态查询 - 模板化任务处理 -### 7. Midjourney视频生成 (Midjourney Video Generation) +### 5. 302AI Midjourney图片生成 (302AI Midjourney Image Generation) +- 图片生成(同步/异步) +- 图片描述反推 +- 任务取消 + +### 6. 302AI 极梦视频生成 (302AI JiMeng Video Generation) +- 视频生成(同步/异步) +- 任务状态查询 + +### 7. 302AI Midjourney视频生成 (302AI Midjourney Video Generation) - 视频生成服务 - 任务状态查询 -### 8. 302AI服务集成 (302AI Integration) -- Midjourney图片生成 -- 极梦视频生成 -- Midjourney视频生成 +### 8. 302AI VEO视频生成 (302AI VEO Video Generation) - VEO视频生成 -- Hedra口型合成 +- 任务状态查询 -### 9. 聚合接口 (Union APIs) -- 统一的图片/视频生成接口 -- 支持多模型选择 +### 9. Hedra口型合成 3.0 (Hedra Lip Sync 3.0) +- 口型合成任务 +- 文件上传管理 -### 10. ComfyUI工作流 (ComfyUI Workflow) -- 工作流执行 -- 节点管理 - -### 11. 海螺API (HaiLuo API) +### 10. 海螺API (HaiLuo API) - 语音合成 - 声音克隆 -### 12. Hedra口型合成 (Hedra Lip Sync) -- 口型合成任务 -- 文件上传管理 +### 11. ComfyUI工作流 (ComfyUI Workflow) +- 工作流执行 +- 节点管理 + +### 12. 302AI聚合接口 (302AI Union APIs) +- 统一的图片/视频生成接口 +- 支持多模型选择 + +### 13. 🔥稳定图片视频生成接口 (Stable Generation APIs) +- 图片生成任务提交 +- 视频生成任务提交 +- 任务状态查询 + +### 14. 🔥特殊模型接口 (Special Model APIs) +- Higgsfield Soul模型 +- 首尾帧视频生成 + +### 15. 火山OmniHuman接口 (Volcano OmniHuman APIs) +- 图片人脸检测 +- 视频生成 + +### 16. 火山数字人接口 (Volcano Digital Human APIs) +- 数字人创建 +- 视频生成 + +### 17. LLM调用 (LLM APIs) +- 多模型推理 +- Google Gemini多模态分析 +- 文件上传到Google存储 + +### 18. 提示词预处理 (Prompt Processing) [已弃用] +- 获取示例提示词 +- 健康检测 --- ## 详细接口分析 -### 1. 提示词预处理模块 +### 1. 文件操作模块 -#### 1.1 获取示例提示词 -**接口**: `GET /api/prompt/default` - -**参数**: -- `task_type` (可选): 任务类型,用于获取特定类型的示例提示词 - -**作用**: 为用户提供不同任务类型的示例提示词,帮助用户更好地构建生成请求 - -**返回**: 示例提示词数据 - -#### 1.2 健康检测 -**接口**: `GET /api/prompt/health` - -**作用**: 检查提示词预处理服务的健康状态 - ---- - -### 2. 文件操作模块 - -#### 2.1 上传文件到COS (已弃用) +#### 1.1 上传文件到COS (已弃用) **接口**: `POST /api/file/upload` **参数**: @@ -94,7 +98,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 上传文件到腾讯云COS存储 **状态**: 已弃用,建议使用S3上传接口 -#### 2.2 上传文件到S3 (推荐) +#### 1.2 上传文件到S3 (推荐) **接口**: `POST /api/file/upload/s3` **参数**: @@ -104,14 +108,19 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **返回**: FileUploadResponse - `status`: 上传状态 -- `msg`: 响应消息 +- `msg`: 响应消息 - `data`: 文件URL +#### 1.3 健康检测 +**接口**: `GET /api/file/health` + +**作用**: 检查文件操作服务的健康状态 + --- -### 3. 视频模板管理模块 +### 2. 视频模板管理模块 -#### 3.1 获取视频模板列表 +#### 2.1 获取视频模板列表 **接口**: `GET /api/template/default` **参数**: @@ -134,7 +143,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 } ``` -#### 3.2 检查任务类型可用性 +#### 2.2 检查任务类型可用性 **接口**: `GET /api/template/check/task_type` **参数**: @@ -142,7 +151,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 检查指定的任务类型是否可用(未被占用) -#### 3.3 创建视频模板 +#### 2.3 创建视频模板 **接口**: `POST /api/template/create` **参数**: 模板数据对象,必须包含task_type字段且唯一 @@ -163,12 +172,12 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 } ``` -#### 3.4 更新视频模板 +#### 2.4 更新视频模板 **接口**: `PUT /api/template/update` **参数**: 模板数据对象,必须包含id字段 -#### 3.5 删除视频模板 +#### 2.5 删除视频模板 **接口**: `DELETE /api/template/delete/{template_id}` **参数**: @@ -178,76 +187,9 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 --- -### 4. Midjourney图片生成模块 +### 3. 极梦视频生成模块 -#### 4.1 图片提示词预审 -**接口**: `GET /api/mj/prompt/check` - -**参数**: -- `prompt`: 图片生成提示词 - -**作用**: 预审提示词是否符合Midjourney的生成要求 - -#### 4.2 同步生成图片 -**接口**: `POST /api/mj/sync/image` - -**参数**: -- `prompt`: 图片生成提示词 -- `img_file` (可选): 样貌参考图片文件 -- `max_wait_time` (可选): 最大等待时间,默认120秒 -- `poll_interval` (可选): 轮询间隔,默认2秒 - -**作用**: 同步生成图片,提交任务并轮询结果直到完成 - -#### 4.3 异步生成图片 -**接口**: `POST /api/mj/generate-image` - -**参数**: -- `prompt`: 图片生成提示词 -- `img_file` (可选): 样貌参考图片 - -**作用**: 异步提交图片生成任务,立即返回任务ID - -#### 4.4 异步提交生图任务 -**接口**: `POST /api/mj/async/generate/image` - -**参数**: -- `prompt`: 图片生成提示词 -- `img_file` (可选): 样貌参考图片 - -#### 4.5 异步查询任务状态 -**接口**: `GET /api/mj/async/query/status` - -**参数**: -- `task_id`: 任务ID - -**作用**: 查询异步图片生成任务的状态和结果 - -#### 4.6 获取图像描述 -**接口**: `POST /api/mj/sync/img/describe` - -**参数**: -- `image_url`: 图片URL地址 -- `max_wait_time` (可选): 最大等待时间,默认120秒 -- `poll_interval` (可选): 轮询间隔,默认2秒 - -**作用**: 根据图片URL反推生成该图片的提示词 - -#### 4.7 通过文件获取图片描述 -**接口**: `POST /api/mj/sync/file/img/describe` - -**参数**: -- `img_file`: 上传的图片文件 -- `max_wait_time` (可选): 最大等待时间,默认120秒 -- `poll_interval` (可选): 轮询间隔,默认2秒 - -**作用**: 通过上传图片文件反推生成提示词 - ---- - -### 5. 极梦视频生成模块 - -#### 5.1 生成视频 (基础版) +#### 3.1 生成视频 (基础版) **接口**: `POST /api/jm/generate-video` **参数**: @@ -258,7 +200,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `poll_interval` (可选): 轮询间隔,默认5秒 - `model_type` (可选): 模型类型,支持lite/pro,默认lite -#### 5.2 同步生成视频v2 +#### 3.2 同步生成视频v2 **接口**: `POST /api/jm/sync/generate/video` **参数**: @@ -271,7 +213,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 支持通过图片文件生成视频,同步返回结果 -#### 5.3 异步生成视频 +#### 3.3 异步生成视频 **接口**: `POST /api/jm/async/generate/video` **参数**: @@ -283,7 +225,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 异步提交视频生成任务 -#### 5.4 异步查询视频状态 +#### 3.4 异步查询视频状态 **接口**: `GET /api/jm/async/query/status` **参数**: @@ -291,11 +233,16 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 查询异步视频生成任务的状态和结果 +#### 3.5 健康检查 +**接口**: `GET /api/jm/health` + +**作用**: 检查极梦视频生成服务的健康状态 + --- -### 6. 任务管理模块 +### 4. 任务管理模块 -#### 6.1 新版异步提交任务 +#### 4.1 新版异步提交任务 **接口**: `POST /api/task/create/task` **参数**: TaskRequest对象 @@ -306,14 +253,14 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 异步提交任务到Modal进行处理,立即返回任务ID -#### 6.2 新版本异步提交任务v2 +#### 4.2 新版本异步提交任务v2 **接口**: `POST /api/task/create/task/v2` **参数**: 同上 **作用**: 任务管理的升级版本 -#### 6.3 异步查询任务状态 +#### 4.3 异步查询任务状态 **接口**: `GET /api/task/status/{task_id}` **参数**: @@ -321,127 +268,44 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 查询任务执行状态和结果 ---- +#### 4.4 健康检测 +**接口**: `GET /api/task/health` -### 7. VEO视频生成模块 - -#### 7.1 异步提交视频生成 (已弃用) -**接口**: `POST /api/veo/submit` - -**参数**: VideoRequest对象 -- `prompt`: 视频生成提示词 - -**作用**: 仅支持文本到视频转换 - -#### 7.2 异步提交任务 (已弃用) -**接口**: `POST /api/veo/async/submit` - -**参数**: -- `prompt`: 生成视频的提示词 -- `img_file` (可选): 首帧参考图 - -**作用**: 支持文本到视频或文本+图片到视频 - -#### 7.3 同步生成视频 (已弃用) -**接口**: `POST /api/veo/sync/generate/video` - -**参数**: -- `prompt`: 生成视频的提示词 -- `img_file` (可选): 首帧参考图 - -#### 7.4 获取任务状态 (已弃用) -**接口**: `GET /api/veo/task/{task_id}` - -**参数**: -- `task_id`: 任务ID +**作用**: 检查任务管理服务的健康状态 --- -### 8. Hedra口型合成模块 +### 5. 302AI Midjourney图片生成模块 -#### 8.1 Hedra 2.0 版本 - -##### 提交口型合成任务 -**接口**: `POST /api/302/hedra/v2/submit/task` - -**参数**: -- `img_file`: 图片文件 -- `audio_file`: 音频文件 - -**作用**: 提交口型合成任务,将音频与图片进行口型同步 - -##### 查询任务状态 (已弃用) -**接口**: `GET /api/302/hedra/v2/task/status` - -**参数**: -- `task_id`: 任务ID - -**状态**: 已弃用 - -##### 上传文件到Hedra服务器 -**接口**: `POST /api/302/hedra/v2/upload` - -**参数**: -- `local_file`: 待上传的文件,支持图片和音频 - -**作用**: 上传文件到Hedra服务器,仅支持image和audio格式 - -#### 8.2 Hedra 3.0 版本 - -##### 上传文件到Hedra平台 -**接口**: `POST /api/302/hedra/v3/file/upload` - -**参数**: -- `local_file`: 待上传的文件,支持音频、图片、视频、语音 -- `purpose` (可选): 上传文件的用途,支持"image"、"audio"、"video"、"voice",默认"image" - -**作用**: 上传文件到Hedra平台,返回资源的ID - -##### 异步提交任务 -**接口**: `POST /api/302/hedra/v3/submit/task` - -**参数**: -- `img_file`: 图片文件 -- `audio_file`: 音频文件 - -**作用**: 异步提交口型合成任务 - -##### 查询任务状态 -**接口**: `GET /api/302/hedra/v3/task/status` - -**参数**: -- `task_id`: 任务ID - -**作用**: 查询口型合成任务的执行状态和结果 - ---- - -### 9. 302AI服务集成模块 - -#### 9.1 302AI Midjourney图片生成 - -##### 异步提交生图任务 +#### 5.1 异步提交生图任务 **接口**: `POST /api/302/mj/async/generate/image` **参数**: - `prompt`: 图片生成提示词 - `img_file` (可选): 样貌参考图片 -##### 取消任务 +**作用**: 异步提交图片生成任务,立即返回任务ID + +#### 5.2 取消任务 **接口**: `POST /api/302/mj/task/cancel` **参数**: - `task_id`: 要取消的任务ID -##### 异步查询任务状态 +**作用**: 取消正在执行的图片生成任务 + +#### 5.3 异步查询任务状态 **接口**: `GET /api/302/mj/async/query/status` **参数**: - `task_id`: 任务ID - `task_type` (可选): 任务类型,image(生图)/describe(反推提示词),默认image - `cdn_flag` (可选): 是否CDN转换,默认false(CDN转换耗时) +- `mode` (可选): 模式,默认fast -##### 获取图像描述 +**作用**: 查询异步图片生成任务的状态和结果 + +#### 5.4 获取图像描述 **接口**: `POST /api/302/mj/sync/img/describe` **参数**: @@ -449,13 +313,17 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `max_wait_time` (可选): 最大等待时间,默认120秒 - `poll_interval` (可选): 轮询间隔,默认2秒 -##### 通过文件获取生图提示词 +**作用**: 根据图片URL反推生成该图片的提示词 + +#### 5.5 通过文件获取生图提示词 **接口**: `POST /api/302/mj/sync/file/img/describe` **参数**: - `img_file`: 上传的图片文件 -##### 同步生成图片 +**作用**: 通过上传图片文件反推生成提示词 + +#### 5.6 同步生成图片 **接口**: `POST /api/302/mj/sync/image` **参数**: @@ -463,10 +331,15 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `img_file` (可选): 样貌参考图片 - `max_wait_time` (可选): 最大等待时间,默认500秒 - `poll_interval` (可选): 轮询间隔,默认4秒 +- `mode` (可选): 模式,支持fast/turbo,默认fast -#### 9.2 302AI 极梦视频生成 +**作用**: 同步生成图片,等待结果返回 -##### 同步生成视频v2 +--- + +### 6. 302AI 极梦视频生成模块 + +#### 6.1 同步生成视频v2 **接口**: `POST /api/302/jm/sync/generate/video` **参数**: @@ -477,7 +350,9 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `poll_interval` (可选): 轮询间隔,默认5秒 - `model_type` (可选): 模型类型,默认lite -##### 异步生成视频 +**作用**: 同步生成视频,等待结果返回 + +#### 6.2 异步生成视频 **接口**: `POST /api/302/jm/async/generate/video` **参数**: @@ -487,28 +362,38 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `duration` (可选): 视频时长(秒),默认5 - `model_type` (可选): 模型类型,默认lite -##### 异步查询视频状态 +**作用**: 异步提交视频生成任务 + +#### 6.3 异步查询视频状态 **接口**: `GET /api/302/jm/async/query/status` **参数**: - `task_id`: 任务ID -#### 9.3 302AI Midjourney视频生成 +**作用**: 查询异步视频生成任务的状态和结果 -##### 异步提交生成视频任务 +--- + +### 7. 302AI Midjourney视频生成模块 + +#### 7.1 异步提交生成视频任务 **接口**: `POST /api/302/mj/video/async/submit` **参数**: - `prompt`: 生成视频的提示词 - `img_file` (可选): 首帧参考图文件 -##### 异步查询生成任务进度 +**作用**: 异步提交Midjourney视频生成任务 + +#### 7.2 异步查询生成任务进度 **接口**: `POST /api/302/mj/video/async/task/status` **参数**: - `task_id`: 任务ID -##### 同步生成视频 +**作用**: 查询Midjourney视频生成任务的进度和结果 + +#### 7.3 同步生成视频 **接口**: `POST /api/302/mj/video/sync/generate/video` **参数**: @@ -517,9 +402,13 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - `timeout` (可选): 超时时间,默认300秒 - `interval` (可选): 轮询间隔,默认3秒 -#### 9.4 302AI VEO视频生成 +**作用**: 同步生成Midjourney视频,等待结果返回 -##### 异步提交任务 +--- + +### 8. 302AI VEO视频生成模块 + +#### 8.1 异步提交任务 **接口**: `POST /api/302/veo/video/async/submit` **参数**: @@ -528,7 +417,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 异步提交VEO视频生成任务 -##### 同步生成视频 +#### 8.2 同步生成视频 **接口**: `POST /api/302/veo/video/sync/generate/video` **参数**: @@ -539,7 +428,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 同步生成VEO视频,等待结果返回 -##### 获取任务状态 +#### 8.3 获取任务状态 **接口**: `GET /api/302/veo/video/task/{task_id}` **参数**: @@ -550,9 +439,39 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 --- -### 11. 海螺API模块 +### 9. Hedra口型合成 3.0 模块 -#### 11.1 同步生成音频 +#### 9.1 上传文件到Hedra平台 +**接口**: `POST /api/302/hedra/v3/file/upload` + +**参数**: +- `local_file`: 待上传的文件,支持音频、图片、视频、语音 +- `purpose` (可选): 上传文件的用途,支持"image"、"audio"、"video"、"voice",默认"image" + +**作用**: 上传文件到Hedra平台,返回资源的ID + +#### 9.2 异步提交任务 +**接口**: `POST /api/302/hedra/v3/submit/task` + +**参数**: +- `img_file`: 图片文件 +- `audio_file`: 音频文件 + +**作用**: 异步提交口型合成任务 + +#### 9.3 查询任务状态 +**接口**: `GET /api/302/hedra/v3/task/status` + +**参数**: +- `task_id`: 任务ID + +**作用**: 查询口型合成任务的执行状态和结果 + +--- + +### 10. 海螺API模块 + +#### 10.1 同步生成音频 **接口**: `POST /api/302/hl_router/sync/generate/speech` **参数**: @@ -564,12 +483,12 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 使用指定音色和参数生成语音 -#### 11.2 查询克隆的音色ID +#### 10.2 查询克隆的音色ID **接口**: `GET /api/302/hl_router/sync/get/voices` **作用**: 查询可用的克隆音色ID列表,接口来自官方,302没有对应的中转接口 -#### 11.3 上传素材到302ai +#### 10.3 上传素材到302ai **接口**: `POST /api/302/hl_router/sync/file/upload` **参数**: @@ -578,7 +497,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 上传音频文件用于声音复刻 -#### 11.4 声音克隆 +#### 10.4 声音克隆 **接口**: `POST /api/302/hl_router/sync/voice/clone` **参数**: @@ -594,9 +513,45 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 --- -### 10. 聚合接口模块 +### 11. ComfyUI工作流模块 -#### 10.1 图片生成聚合接口 +#### 11.1 获取运行节点 +**接口**: `GET /api/comfy/fetch/running/node` + +**参数**: +- `task_count` (可选): 运行任务的数目,默认1 + +**作用**: 根据任务数获取可用的运行节点 + +#### 11.2 异步提交任务 +**接口**: `POST /api/comfy/async/submit/task` + +**参数**: +- `prompt`: 工作流节点数据 + +**作用**: 异步提交ComfyUI工作流任务 + +#### 11.3 查询任务状态 +**接口**: `GET /api/comfy/async/task/status` + +**参数**: +- `task_id`: 任务ID + +**作用**: 查询ComfyUI工作流任务的执行状态 + +#### 11.4 同步执行工作流 +**接口**: `POST /api/comfy/sync/execute/workflow` + +**参数**: +- `prompt`: 工作流JSON字符串 + +**作用**: 同步执行ComfyUI工作流,等待结果返回 + +--- + +### 12. 302AI聚合接口模块 + +#### 12.1 图片生成聚合接口 ##### 获取支持的模型列表 **接口**: `GET /api/union/img/model/list` @@ -615,7 +570,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 **作用**: 统一的图片生成接口,支持多种模型 **参考文档**: https://doc.302.ai/286288228e0 -#### 10.2 视频生成聚合接口 +#### 12.2 视频生成聚合接口 ##### 获取支持的模型列表 **接口**: `GET /api/union/video/model/list` @@ -639,53 +594,272 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 --- -### 12. ComfyUI工作流模块 +### 13. 🔥稳定图片视频生成接口模块 -#### 12.1 获取运行节点 -**接口**: `GET /api/comfy/fetch/running/node` +#### 13.1 获取支持的模型列表 +**接口**: `GET /api/custom/model/list` **参数**: -- `task_count` (可选): 运行任务的数目,默认1 +- `category` (可选): 分类,可取值: image, video,默认image -**作用**: 根据任务数获取可用的运行节点 +**作用**: 获取支持的图片或视频生成模型列表 -#### 12.2 异步提交任务 -**接口**: `POST /api/comfy/async/submit/task` +#### 13.2 提交图片生成任务 +**接口**: `POST /api/custom/image/submit/task` -**参数**: -- `prompt`: 工作流节点数据 +**参数**: 通过multipart/form-data提交 +- 支持多种图片生成模型 +- 支持参考图片上传 -**作用**: 异步提交ComfyUI工作流任务 +**作用**: 提交图片生成任务,返回任务ID -#### 12.3 查询任务状态 -**接口**: `GET /api/comfy/async/task/status` +#### 13.3 提交视频生成任务 +**接口**: `POST /api/custom/video/submit/task` + +**参数**: 通过multipart/form-data提交 +- 支持多种视频生成模型 +- 支持参考图片上传 + +**作用**: 提交视频生成任务,返回任务ID + +#### 13.4 查询任务状态 +**接口**: `GET /api/custom/task/status` **参数**: - `task_id`: 任务ID -**作用**: 查询ComfyUI工作流任务的执行状态 +**作用**: 查询图片或视频生成任务的状态和结果 -#### 12.4 同步执行工作流 -**接口**: `POST /api/comfy/sync/execute/workflow` +--- + +### 14. 🔥特殊模型接口模块 + +#### 14.1 获取支持的模型列表 +**接口**: `GET /api/custom/extend/model/list` + +**作用**: 获取特殊模型的支持列表 + +#### 14.2 Higgsfield Soul模型 + +##### 创建角色 +**接口**: `POST /api/custom/extend/higgsfield/create/character` + +**参数**: 通过application/x-www-form-urlencoded提交 + +**作用**: 提交创建生成角色任务 + +##### 查询创建角色状态 +**接口**: `POST /api/custom/extend/higgsfield/character/status` **参数**: -- `prompt`: 工作流JSON字符串 +- `task_id`: 任务ID + +**作用**: 查询创建角色任务的状态 + +##### 提交生图任务 +**接口**: `POST /api/custom/extend/higgsfield/submit/task` + +**参数**: 通过application/x-www-form-urlencoded提交 + +**作用**: 使用Higgsfield Soul模型进行文生图 + +##### 查询任务状态 +**接口**: `GET /api/custom/extend/higgsfield/task/status` + +**参数**: +- `task_id`: 任务ID + +**作用**: 查询Higgsfield任务执行状态 + +#### 14.3 首尾帧视频生成 + +##### 提交任务 +**接口**: `POST /api/custom/extend/frame/submit/task` + +**参数**: 通过application/x-www-form-urlencoded提交 + +**作用**: 提交首尾帧生成视频任务 + +##### 查询任务状态 +**接口**: `GET /api/custom/extend/frame/task/status` + +**参数**: +- `task_id`: 任务ID + +**作用**: 查询首尾帧任务状态 +**说明**: 只要返回的status类型为bool代表任务已经结束,直接从data里取值即可 + +--- + +### 15. 火山OmniHuman接口模块 + +#### 15.1 图片检测 +**接口**: `POST /api/ark/omnihuman/img/recognition` + +**参数**: 通过multipart/form-data提交图片文件 + +**作用**: 提交图片检测任务,检测图片中是否包含人、类人、拟人等主体 + +#### 15.2 视频生成 +**接口**: `POST /api/ark/omnihuman/video/submit/task` + +**参数**: +- `img_input`: 输入的图片,支持链接+文件流 +- `audio_input`: 输入的音频,支持链接+文件流 + +**作用**: 提交视频生成任务 +**返回**: {"status": True, 'data': '任务id', 'msg': '信息'} + +#### 15.3 查询任务状态 +**接口**: `GET /api/ark/omnihuman/task/status` + +**参数**: +- `task_id`: 任务ID +- `task_type` (可选): 任务类型,支持face_detect, video_generate,默认face_detect + +**作用**: 查询图片检测或视频生成任务的状态 + +--- + +### 16. 火山数字人接口模块 + +#### 16.1 上传视频生成云ID +**接口**: `POST /api/ark/digital/url2vid` + +**参数**: 通过multipart/form-data提交 +- 仅支持mp4格式的视频 +- 视频时长较长时,建议使用链接 + +**作用**: 异步上传视频生成视频云ID + +#### 16.2 创建数字人 +**接口**: `POST /api/ark/digital/create` + +**参数**: 通过application/x-www-form-urlencoded提交 + +**作用**: 提交创建数字人任务 + +#### 16.3 生成数字人视频 +**接口**: `POST /api/ark/digital/video/submit/task` + +**参数**: 通过multipart/form-data提交 + +**作用**: 生成数字人视频 + +#### 16.4 查询任务状态 +**接口**: `GET /api/ark/digital/task/status` + +**参数**: +- `task_id`: 任务ID +- `task_type` (可选): 任务类型,支持upload, create_digital, video_generate,默认video_generate + +**作用**: 查询不同类型任务的状态 +- upload: 上传视频文件 +- create_digital: 创建数字人 +- video_generate: 视频生成 + +--- + +### 17. LLM调用模块 + +#### 17.1 获取支持的模型列表 +**接口**: `GET /api/llm/model/list` + +**作用**: 获取支持的LLM模型列表 + +#### 17.2 调用大模型进行推理 +**接口**: `POST /api/llm/chat` + +**参数**: 通过application/x-www-form-urlencoded提交 +- 支持多种LLM模型 +- 可配置温度、最大token等参数 + +**作用**: 调用大模型进行文本推理 + +#### 17.3 调用Google推理 +**接口**: `POST /api/llm/google/chat` + +**参数**: 通过application/x-www-form-urlencoded提交 + +**作用**: 专门调用Google Gemini模型进行推理 + +#### 17.4 Gemini多模态分析(同步) +**接口**: `POST /api/llm/google/sync/media/analysis` + +**参数**: 通过application/x-www-form-urlencoded提交 +- `text_prompt`: 分析提示词 +- `media_uri`: 媒体文件URI + +**作用**: 同步进行Gemini多模态分析,支持视频、音频、图片,适合小文件 + +#### 17.5 Gemini多模态分析(异步) +**接口**: `POST /api/llm/google/async/media/analysis` + +**参数**: 通过application/x-www-form-urlencoded提交 +- `text_prompt`: 分析提示词 +- `media_uri`: 媒体文件URI + +**作用**: 异步进行Gemini多模态分析,适合需要长时间的推理过程 + +#### 17.6 上传文件到Google存储 +**接口**: `POST /api/llm/google/vertex-ai/upload` + +**参数**: 通过multipart/form-data提交 +- `local_file`: 本地文件,支持音频、视频、图片 + +**作用**: 上传文件到谷歌存储,用于Gemini视觉功能 +**返回格式**: +```json +{ + "status": "状态信息, true 成功, false 失败", + "data": "gs://fashion_image_block/gallery_v2/mp4/1f76996f-a13e-450e-8c86-029c398932c4.mp4", + "msg": "", + "extra": "原始信息" +} +``` + +#### 17.7 查询推理过程结果 +**接口**: `GET /api/llm/task/status` + +**参数**: +- `task_id`: 任务ID + +**作用**: 查询LLM推理任务的状态和结果 +**返回说明**: status值为字符串时标识任务运行状态,为布尔值时标识任务运行完毕 + +--- + +### 18. 提示词预处理模块 [已弃用] + +#### 18.1 获取示例提示词 [已弃用] +**接口**: `GET /api/prompt/default` + +**参数**: +- `task_type` (可选): 任务类型 + +**作用**: 获取示例提示词 +**状态**: 已弃用 + +#### 18.2 健康检测 +**接口**: `GET /api/prompt/health` + +**作用**: 检查提示词预处理服务的健康状态 + -**作用**: 同步执行ComfyUI工作流,等待结果返回 --- ## 接口组合调用关系与应用场景 -### 场景1: 完整的图片生成流程 +### 场景1: 稳定图片生成流程 -1. **提示词预审** → `GET /api/mj/prompt/check` - - 检查提示词是否符合要求 +1. **获取模型列表** → `GET /api/custom/model/list?category=image` + - 获取支持的图片生成模型 -2. **异步提交生图任务** → `POST /api/mj/async/generate/image` +2. **提交生成任务** → `POST /api/custom/image/submit/task` - 提交图片生成任务 -3. **轮询任务状态** → `GET /api/mj/async/query/status` +3. **轮询任务状态** → `GET /api/custom/task/status` - 定期查询任务进度直到完成 4. **文件上传** → `POST /api/file/upload/s3` @@ -696,10 +870,10 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 1. **上传参考图片** → `POST /api/file/upload/s3` - 上传用户的参考图片 -2. **提交视频生成任务** → `POST /api/jm/async/generate/video` +2. **提交视频生成任务** → `POST /api/custom/video/submit/task` - 使用图片和提示词生成视频 -3. **查询任务状态** → `GET /api/jm/async/query/status` +3. **查询任务状态** → `GET /api/custom/task/status` - 监控视频生成进度 4. **保存到模板** → `POST /api/template/create` @@ -757,14 +931,11 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 ### 场景7: 图片反推与再生成 -1. **上传图片** → `POST /api/mj/sync/file/img/describe` +1. **上传图片** → `POST /api/302/mj/sync/file/img/describe` - 上传图片获取描述提示词 -2. **优化提示词** → `GET /api/mj/prompt/check` - - 检查和优化提示词 - -3. **重新生成** → `POST /api/mj/sync/image` - - 基于优化后的提示词重新生成 +2. **重新生成** → `POST /api/302/mj/sync/image` + - 基于提示词重新生成 ### 场景8: 多平台视频生成对比 @@ -772,7 +943,7 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 - 上传参考图片 2. **并行生成**: - - `POST /api/jm/sync/generate/video` (极梦) + - `POST /api/302/jm/sync/generate/video` (302AI 极梦) - `POST /api/302/mj/video/sync/generate/video` (302AI MJ) - `POST /api/302/veo/video/sync/generate/video` (302AI VEO) @@ -796,19 +967,61 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 5. **查询结果** → `GET /api/302/hedra/v3/task/status` - 获取最终的口型合成视频 -### 场景10: 聚合接口多模型测试 +### 场景10: 数字人视频生成 -1. **获取模型列表** → `GET /api/union/img/model/list` - - 查看支持的图片生成模型 +1. **上传训练视频** → `POST /api/ark/digital/url2vid` + - 上传mp4格式的训练视频 -2. **批量测试** → `POST /api/union/img/sync/generate/image` - - 使用不同模型生成同一提示词 +2. **创建数字人** → `POST /api/ark/digital/create` + - 基于训练视频创建数字人模型 -3. **视频模型测试** → `GET /api/union/video/model/list` - - 获取视频生成模型列表 +3. **查询创建状态** → `GET /api/ark/digital/task/status?task_type=create_digital` + - 监控数字人创建进度 -4. **视频生成对比** → `POST /api/union/video/async/generate/video` - - 使用不同视频模型进行对比测试 +4. **生成数字人视频** → `POST /api/ark/digital/video/submit/task` + - 使用创建的数字人生成视频 + +5. **查询生成状态** → `GET /api/ark/digital/task/status?task_type=video_generate` + - 监控视频生成进度 + +### 场景11: LLM多模态分析 + +1. **上传媒体文件** → `POST /api/llm/google/vertex-ai/upload` + - 上传图片、视频或音频到Google存储 + +2. **提交分析任务** → `POST /api/llm/google/async/media/analysis` + - 使用Gemini进行多模态分析 + +3. **查询分析结果** → `GET /api/llm/task/status` + - 获取分析结果 + +### 场景12: 特殊模型应用 + +1. **获取特殊模型列表** → `GET /api/custom/extend/model/list` + - 查看可用的特殊模型 + +2. **Higgsfield角色创建** → `POST /api/custom/extend/higgsfield/create/character` + - 创建专属角色 + +3. **角色生图** → `POST /api/custom/extend/higgsfield/submit/task` + - 使用创建的角色生成图片 + +4. **首尾帧视频** → `POST /api/custom/extend/frame/submit/task` + - 基于首尾帧生成视频 + +### 场景13: 火山引擎OmniHuman应用 + +1. **图片人脸检测** → `POST /api/ark/omnihuman/img/recognition` + - 检测图片中的人脸信息 + +2. **查询检测结果** → `GET /api/ark/omnihuman/task/status?task_type=face_detect` + - 获取人脸检测结果 + +3. **提交视频生成** → `POST /api/ark/omnihuman/video/submit/task` + - 基于图片和音频生成视频 + +4. **查询生成结果** → `GET /api/ark/omnihuman/task/status?task_type=video_generate` + - 获取视频生成结果 --- @@ -902,16 +1115,17 @@ Text Video Agent API 是一个综合性的文本生成视频API服务,版本 1 ## 总结 -Text Video Agent API 提供了一个完整的AI内容生成生态系统,支持从简单的图片生成到复杂的多模态内容创作。通过合理的接口组合,可以实现丰富的应用场景,从个人创作工具到企业级内容生产平台。 +Text Video Agent API 提供了一个完整的AI内容生成生态系统,支持从简单的图片生成到复杂的多模态内容创作、数字人生成、LLM推理等功能。通过合理的接口组合,可以实现丰富的应用场景,从个人创作工具到企业级内容生产平台。 ### 核心优势 -1. **多平台支持**: 集成了Midjourney、极梦、VEO、302AI、Hedra、海螺等多个AI服务提供商 -2. **功能完整**: 涵盖图片生成、视频生成、音频生成、口型合成、声音克隆、工作流处理等全链路功能 +1. **多平台支持**: 集成了302AI、极梦、火山引擎、Hedra、海螺、Google Gemini等多个AI服务提供商 +2. **功能完整**: 涵盖图片生成、视频生成、音频生成、口型合成、声音克隆、数字人生成、LLM推理、工作流处理等全链路功能 3. **灵活调用**: 提供同步和异步两种调用模式,满足不同性能需求 4. **模板化**: 支持视频模板管理,便于批量生产和标准化流程 5. **聚合接口**: 提供统一的接口访问多种模型,简化开发复杂度 -6. **多模态融合**: 支持图片、视频、音频的综合处理和口型合成 +6. **多模态融合**: 支持图片、视频、音频的综合处理和分析 +7. **企业级功能**: 支持数字人创建、特殊模型应用、工作流自动化 ### 技术特点 @@ -920,17 +1134,59 @@ Text Video Agent API 提供了一个完整的AI内容生成生态系统,支持 - **文件管理**: 完善的文件上传和存储解决方案,支持多种文件格式 - **错误处理**: 统一的错误响应格式和验证机制 - **扩展性**: 模块化设计,便于功能扩展和维护 -- **版本管理**: 支持API版本迭代,如Hedra 2.0/3.0等 +- **版本管理**: 支持API版本迭代和功能升级 - **多媒体支持**: 全面支持图片、音频、视频等多种媒体格式 +- **云原生**: 支持多种云存储和计算平台 ### 新增功能亮点 -1. **Hedra口型合成**: 支持2.0和3.0版本,提供高质量的口型同步功能 -2. **海螺语音服务**: 集成专业的TTS和声音克隆功能 -3. **聚合接口**: 统一多个AI服务提供商的接口,简化集成复杂度 -4. **ComfyUI工作流**: 支持复杂的AI处理工作流 -5. **302AI全家桶**: 提供Midjourney、极梦、VEO等服务的302AI版本 +1. **🔥稳定生成接口**: 提供更稳定可靠的图片和视频生成服务 +2. **🔥特殊模型支持**: 集成Higgsfield Soul、首尾帧视频生成等特殊模型 +3. **火山引擎集成**: 支持OmniHuman人脸检测和数字人生成 +4. **LLM多模态分析**: 集成Google Gemini进行视频、音频、图片分析 +5. **Hedra 3.0口型合成**: 提供最新版本的高质量口型同步功能 +6. **海螺语音服务**: 集成专业的TTS和声音克隆功能 +7. **302AI聚合服务**: 统一多个AI服务提供商的接口 +8. **ComfyUI工作流**: 支持复杂的AI处理工作流 -建议开发者根据具体应用场景选择合适的接口组合,并实现完善的错误处理和用户反馈机制,以提供最佳的用户体验。特别是在使用声音克隆和口型合成等功能时,需要注意隐私保护和合规使用。 +### 应用场景扩展 + +- **内容创作**: 图片生成、视频制作、音频合成 +- **数字人应用**: 虚拟主播、客服机器人、教育培训 +- **多媒体分析**: 视频内容理解、音频转录、图片识别 +- **工作流自动化**: 批量处理、模板化生产 +- **企业级应用**: 品牌营销、产品展示、培训材料 + +### 开发建议 + +建议开发者根据具体应用场景选择合适的接口组合,并实现完善的错误处理和用户反馈机制。特别注意: + +1. **性能优化**: 合理使用同步/异步接口,避免长时间阻塞 +2. **资源管理**: 及时清理临时文件和任务,控制并发数量 +3. **隐私保护**: 在使用声音克隆、数字人生成等功能时注意隐私保护 +4. **合规使用**: 确保生成内容符合相关法律法规要求 +5. **监控告警**: 实现完善的任务监控和异常处理机制 + +## Rust SDK 生成指南 + +使用 OpenAPI Generator 可以快速生成 Rust SDK: + +```bash +# 使用 Docker 生成 Rust SDK +docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \ + -i /local/openapi.json \ + -g rust \ + -o /local/text-video-agent-rust-sdk \ + --additional-properties=packageName=text_video_agent_client,packageVersion=1.0.6,supportAsync=true,library=reqwest + +# 生成的 SDK 将包含: +# - 完整的 API 客户端代码 +# - 类型定义和数据结构 +# - 异步支持(基于 tokio) +# - 错误处理机制 +# - 文档和示例 +``` + +生成的 Rust SDK 将提供类型安全的 API 调用接口,支持异步操作,便于 Rust 开发者快速集成 Text Video Agent API 的各项功能。 diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..a82623d --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +}