Add text-video-agent Rust SDK and update OpenAPI documentation

This commit is contained in:
imeepos
2025-08-18 10:38:52 +08:00
parent 8afd39b056
commit 8a5df2f5ef
57 changed files with 9933 additions and 1174 deletions

View File

@@ -0,0 +1,3 @@
/target/
**/*.rs.bk
Cargo.lock

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1 @@
7.14.0

View File

@@ -0,0 +1 @@
language: rust

View File

@@ -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

View File

@@ -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"] }

View File

@@ -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.

View File

@@ -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.

View File

@@ -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<dyn std::error::Error>> {
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<dyn std::error::Error>> {
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<dyn std::error::Error>> {
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<dyn std::error::Error>> {
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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -0,0 +1,11 @@
# HttpValidationError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**detail** | Option<[**Vec<models::ValidationError>**](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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -0,0 +1,13 @@
# ValidationError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**loc** | [**Vec<models::ValidationErrorLocInner>**](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)

View File

@@ -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)

View File

@@ -0,0 +1,38 @@
use text_video_agent_client::apis::configuration::Configuration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// 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(())
}

View File

@@ -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'

View File

@@ -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<std::path::PathBuf>, duration: Option<&str>, model_type: Option<&str>) -> Result<serde_json::Value, Error<AsyncGenVideoApiJmAsyncGenerateVideoPostError>> {
// 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<AsyncGenVideoApiJmAsyncGenerateVideoPostError> = 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<serde_json::Value, Error<AsyncQueryVideoStatusApiJmAsyncQueryStatusGetError>> {
// 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<AsyncQueryVideoStatusApiJmAsyncQueryStatusGetError> = 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<i32>, poll_interval: Option<i32>, model_type: Option<&str>) -> Result<serde_json::Value, Error<GenerateVideoApiApiJmGenerateVideoPostError>> {
// 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<GenerateVideoApiApiJmGenerateVideoPostError> = 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<serde_json::Value, Error<GetTaskStatusV2ApiTaskStatusTaskIdGetError>> {
// 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<GetTaskStatusV2ApiTaskStatusTaskIdGetError> = 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<serde_json::Value, Error<HealthCheckApiJmHealthGetError>> {
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<HealthCheckApiJmHealthGetError> = 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<serde_json::Value, Error<HealthCheckApiTaskHealthGetError>> {
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<HealthCheckApiTaskHealthGetError> = 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<serde_json::Value, Error<SubmitTaskV2ApiTaskCreateTaskPostError>> {
// 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<SubmitTaskV2ApiTaskCreateTaskPostError> = 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<serde_json::Value, Error<SubmitTaskV3ApiTaskCreateTaskV2PostError>> {
// 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<SubmitTaskV3ApiTaskCreateTaskV2PostError> = 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<i32>, poll_interval: Option<i32>, model_type: Option<&str>) -> Result<serde_json::Value, Error<SyncGenerateVideoV2ApiJmSyncGenerateVideoPostError>> {
// 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<SyncGenerateVideoV2ApiJmSyncGenerateVideoPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<GetVoicesHlApi302HlRouterSyncGetVoicesGetError>> {
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<GetVoicesHlApi302HlRouterSyncGetVoicesGetError> = 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<f64>, vol: Option<f64>, emotion: Option<&str>) -> Result<serde_json::Value, Error<HlTtsApi302HlRouterSyncGenerateSpeechPostError>> {
// 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<HlTtsApi302HlRouterSyncGenerateSpeechPostError> = 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<serde_json::Value, Error<UploadMaterialFileApi302HlRouterSyncFileUploadPostError>> {
// 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<UploadMaterialFileApi302HlRouterSyncFileUploadPostError> = 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<bool>, voice_id: Option<&str>, prefix: Option<&str>, audio_file: Option<std::path::PathBuf>) -> Result<serde_json::Value, Error<VoiceCloneApi302HlRouterSyncVoiceClonePostError>> {
// 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<VoiceCloneApi302HlRouterSyncVoiceClonePostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<FetchSupportedModelApiUnionImgModelListGetError>> {
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<FetchSupportedModelApiUnionImgModelListGetError> = 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<serde_json::Value, Error<FetchSupportedModelApiUnionVideoModelListGetError>> {
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<FetchSupportedModelApiUnionVideoModelListGetError> = 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<serde_json::Value, Error<QueryTaskStatusApiUnionVideoAsyncTaskIdStatusGetError>> {
// 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<QueryTaskStatusApiUnionVideoAsyncTaskIdStatusGetError> = 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<std::path::PathBuf>, model: Option<&str>, duration: Option<i32>) -> Result<serde_json::Value, Error<SubmitTaskApiUnionVideoAsyncGenerateVideoPostError>> {
// 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<SubmitTaskApiUnionVideoAsyncGenerateVideoPostError> = 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<std::path::PathBuf>, aspect_ratio: Option<&str>) -> Result<serde_json::Value, Error<SyncGenImageApiUnionImgSyncGenerateImagePostError>> {
// 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<SyncGenImageApiUnionImgSyncGenerateImagePostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<std::path::PathBuf>, duration: Option<&str>, model_type: Option<&str>) -> Result<serde_json::Value, Error<AsyncGenVideoApi302JmAsyncGenerateVideoPostError>> {
// 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<AsyncGenVideoApi302JmAsyncGenerateVideoPostError> = 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<serde_json::Value, Error<AsyncQueryVideoStatusApi302JmAsyncQueryStatusGetError>> {
// 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<AsyncQueryVideoStatusApi302JmAsyncQueryStatusGetError> = 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<i32>, poll_interval: Option<i32>, model_type: Option<&str>) -> Result<serde_json::Value, Error<SyncGenerateVideoV2Api302JmSyncGenerateVideoPostError>> {
// 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<SyncGenerateVideoV2Api302JmSyncGenerateVideoPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<std::path::PathBuf>, mode: Option<&str>) -> Result<serde_json::Value, Error<AsyncGenImageApi302MjAsyncGenerateImagePostError>> {
// 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<AsyncGenImageApi302MjAsyncGenerateImagePostError> = 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<bool>, mode: Option<&str>) -> Result<serde_json::Value, Error<AsyncQueryStatusApi302MjAsyncQueryStatusGetError>> {
// 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", &param_value.to_string())]);
}
if let Some(ref param_value) = p_cdn_flag {
req_builder = req_builder.query(&[("cdn_flag", &param_value.to_string())]);
}
if let Some(ref param_value) = p_mode {
req_builder = req_builder.query(&[("mode", &param_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<AsyncQueryStatusApi302MjAsyncQueryStatusGetError> = 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<serde_json::Value, Error<AsyncQueryTaskStatusApi302MjVideoAsyncTaskStatusPostError>> {
// 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<AsyncQueryTaskStatusApi302MjVideoAsyncTaskStatusPostError> = 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<serde_json::Value, Error<CancelTaskApi302MjTaskCancelPostError>> {
// 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<CancelTaskApi302MjTaskCancelPostError> = 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<i32>, poll_interval: Option<i32>) -> Result<serde_json::Value, Error<DescImgByFileApi302MjSyncFileImgDescribePostError>> {
// 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<DescImgByFileApi302MjSyncFileImgDescribePostError> = 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<i32>, poll_interval: Option<i32>) -> Result<serde_json::Value, Error<DescribeImageApiApi302MjSyncImgDescribePostError>> {
// 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<DescribeImageApiApi302MjSyncImgDescribePostError> = 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<i32>, poll_interval: Option<i32>, mode: Option<&str>, img_file: Option<std::path::PathBuf>) -> Result<serde_json::Value, Error<GenerateImageSyncApi302MjSyncImagePostError>> {
// 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", &param_value.to_string())]);
}
if let Some(ref param_value) = p_poll_interval {
req_builder = req_builder.query(&[("poll_interval", &param_value.to_string())]);
}
if let Some(ref param_value) = p_mode {
req_builder = req_builder.query(&[("mode", &param_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<GenerateImageSyncApi302MjSyncImagePostError> = 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<std::path::PathBuf>) -> Result<serde_json::Value, Error<SubmitTaskApi302MjVideoAsyncSubmitPostError>> {
// 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<SubmitTaskApi302MjVideoAsyncSubmitPostError> = 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<i32>, interval: Option<i32>) -> Result<serde_json::Value, Error<SyncGenVideoApi302MjVideoSyncGenerateVideoPostError>> {
// 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<SyncGenVideoApi302MjVideoSyncGenerateVideoPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<bool>) -> Result<serde_json::Value, Error<GetTaskStatusApi302VeoVideoTaskTaskIdGetError>> {
// 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", &param_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<GetTaskStatusApi302VeoVideoTaskTaskIdGetError> = 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<std::path::PathBuf>) -> Result<serde_json::Value, Error<SubmitIvSubmitApi302VeoVideoAsyncSubmitPostError>> {
// 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<SubmitIvSubmitApi302VeoVideoAsyncSubmitPostError> = 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<std::path::PathBuf>, max_wait_time: Option<i32>, interval: Option<i32>) -> Result<serde_json::Value, Error<SyncImg2videoApi302VeoVideoSyncGenerateVideoPostError>> {
// 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<SyncImg2videoApi302VeoVideoSyncGenerateVideoPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<i32>) -> Result<serde_json::Value, Error<GetRunningNodeApiComfyFetchRunningNodeGetError>> {
// 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", &param_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<GetRunningNodeApiComfyFetchRunningNodeGetError> = 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<serde_json::Value, Error<QueryTaskStatusApiComfyAsyncTaskStatusGetError>> {
// 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<QueryTaskStatusApiComfyAsyncTaskStatusGetError> = 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<serde_json::Value, Error<SubmitTaskApiComfyAsyncSubmitTaskPostError>> {
// 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<SubmitTaskApiComfyAsyncSubmitTaskPostError> = 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<serde_json::Value, Error<SyncExecuteWorkflowApiComfySyncExecuteWorkflowPostError>> {
// 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<SyncExecuteWorkflowApiComfySyncExecuteWorkflowPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<String>,
pub client: reqwest::Client,
pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
}
pub type BasicAuth = (String, Option<String>);
#[derive(Debug, Clone)]
pub struct ApiKey {
pub prefix: Option<String>,
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,
}
}
}

View File

@@ -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<serde_json::Value, Error<RootGetError>> {
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<RootGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<InternalUploadFileApi302HedraV2UploadPostError>> {
// 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<InternalUploadFileApi302HedraV2UploadPostError> = 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<serde_json::Value, Error<QueryTaskStatusApi302HedraV2TaskStatusGetError>> {
// 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<QueryTaskStatusApi302HedraV2TaskStatusGetError> = 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<serde_json::Value, Error<SubmitCharacterTaskApi302HedraV2SubmitTaskPostError>> {
// 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<SubmitCharacterTaskApi302HedraV2SubmitTaskPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<HandlerHedraTaskSubmitApi302HedraV3SubmitTaskPostError>> {
// 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<HandlerHedraTaskSubmitApi302HedraV3SubmitTaskPostError> = 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<serde_json::Value, Error<HandlerQueryTaskStatusApi302HedraV3TaskStatusGetError>> {
// 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<HandlerQueryTaskStatusApi302HedraV3TaskStatusGetError> = 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<serde_json::Value, Error<UploadFileToHedraApi302HedraV3FileUploadPostError>> {
// 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<UploadFileToHedraApi302HedraV3FileUploadPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<GoogleFileUploadError>> {
// 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<GoogleFileUploadError> = 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<f64>) -> Result<serde_json::Value, Error<InvokeGeminiAiApiLlmGoogleChatPostError>> {
// 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<InvokeGeminiAiApiLlmGoogleChatPostError> = 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<serde_json::Value, Error<InvokeMediaAnalysisApiLlmGoogleSyncMediaAnalysisPostError>> {
// 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<InvokeMediaAnalysisApiLlmGoogleSyncMediaAnalysisPostError> = 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<f64>, max_tokens: Option<i32>, timeout: Option<f64>) -> Result<serde_json::Value, Error<LlmChatError>> {
// 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<LlmChatError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn llm_supported_models(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<LlmSupportedModelsError>> {
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<LlmSupportedModelsError> = 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<serde_json::Value, Error<LlmTaskIdError>> {
// 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<LlmTaskIdError> = 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<serde_json::Value, Error<SubmitMediaInferenceApiLlmGoogleAsyncMediaAnalysisPostError>> {
// 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<SubmitMediaInferenceApiLlmGoogleAsyncMediaAnalysisPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<std::path::PathBuf>) -> Result<serde_json::Value, Error<AsyncGenImageApiMjAsyncGenerateImagePostError>> {
// 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<AsyncGenImageApiMjAsyncGenerateImagePostError> = 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<serde_json::Value, Error<AsyncQueryStatusApiMjAsyncQueryStatusGetError>> {
// 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<AsyncQueryStatusApiMjAsyncQueryStatusGetError> = 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<i32>, poll_interval: Option<i32>) -> Result<serde_json::Value, Error<DescImgByFileApiMjSyncFileImgDescribePostError>> {
// 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<DescImgByFileApiMjSyncFileImgDescribePostError> = 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<i32>, poll_interval: Option<i32>) -> Result<serde_json::Value, Error<DescribeImageApiApiMjSyncImgDescribePostError>> {
// 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<DescribeImageApiApiMjSyncImgDescribePostError> = 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<std::path::PathBuf>, max_wait_time: Option<i32>, poll_interval: Option<i32>) -> Result<serde_json::Value, Error<GenerateImageApiApiMjGenerateImagePostError>> {
// 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<GenerateImageApiApiMjGenerateImagePostError> = 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<i32>, poll_interval: Option<i32>, img_file: Option<std::path::PathBuf>) -> Result<serde_json::Value, Error<GenerateImageSyncApiMjSyncImagePostError>> {
// 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", &param_value.to_string())]);
}
if let Some(ref param_value) = p_poll_interval {
req_builder = req_builder.query(&[("poll_interval", &param_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<GenerateImageSyncApiMjSyncImagePostError> = 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<serde_json::Value, Error<HealthCheckApiMjHealthGetError>> {
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<HealthCheckApiMjHealthGetError> = 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<serde_json::Value, Error<PromptCheckApiMjPromptCheckGetError>> {
// 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<PromptCheckApiMjPromptCheckGetError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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<serde_json::Value, Error<AsyncQueryTaskStatusApiMjVideoAsyncTaskStatusPostError>> {
// 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<AsyncQueryTaskStatusApiMjVideoAsyncTaskStatusPostError> = 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<serde_json::Value, Error<HealthCheckApiMjVideoHealthGetError>> {
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<HealthCheckApiMjVideoHealthGetError> = 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<std::path::PathBuf>) -> Result<serde_json::Value, Error<SubmitVideoTaskApiMjVideoAsyncSubmitPostError>> {
// 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", &param_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<SubmitVideoTaskApiMjVideoAsyncSubmitPostError> = 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<std::path::PathBuf>) -> Result<serde_json::Value, Error<SyncSubmitTaskApiMjVideoSyncGenPostError>> {
// 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", &param_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<SyncSubmitTaskApiMjVideoSyncGenPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -0,0 +1,128 @@
use std::error;
use std::fmt;
#[derive(Debug, Clone)]
pub struct ResponseContent<T> {
pub status: reqwest::StatusCode,
pub content: String,
pub entity: Option<T>,
}
#[derive(Debug)]
pub enum Error<T> {
Reqwest(reqwest::Error),
Serde(serde_json::Error),
Io(std::io::Error),
ResponseError(ResponseContent<T>),
}
impl <T> fmt::Display for Error<T> {
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 <T: fmt::Debug> error::Error for Error<T> {
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 <T> From<reqwest::Error> for Error<T> {
fn from(e: reqwest::Error) -> Self {
Error::Reqwest(e)
}
}
impl <T> From<serde_json::Error> for Error<T> {
fn from(e: serde_json::Error) -> Self {
Error::Serde(e)
}
}
impl <T> From<std::io::Error> for Error<T> {
fn from(e: std::io::Error) -> Self {
Error::Io(e)
}
}
pub fn urlencode<T: AsRef<str>>(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;

View File

@@ -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<serde_json::Value, Error<QueryImgRecognitionStatusApiArkOmnihumanTaskStatusGetError>> {
// 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", &param_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<QueryImgRecognitionStatusApiArkOmnihumanTaskStatusGetError> = 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<std::path::PathBuf>) -> Result<serde_json::Value, Error<SubmitImgRecognitionApiArkOmnihumanImgRecognitionPostError>> {
// 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<SubmitImgRecognitionApiArkOmnihumanImgRecognitionPostError> = 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<std::path::PathBuf>, audio_url: Option<&str>, audio_file: Option<std::path::PathBuf>) -> Result<serde_json::Value, Error<SubmitVideoGenerateTaskApiArkOmnihumanVideoSubmitTaskPostError>> {
// 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<SubmitVideoGenerateTaskApiArkOmnihumanVideoSubmitTaskPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}

View File

@@ -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;

View File

@@ -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<Option<String>>,
}
impl FileUploadResponse {
/// 文件上传响应模型
pub fn new(status: bool, msg: String) -> FileUploadResponse {
FileUploadResponse {
status,
msg,
data: None,
}
}
}

View File

@@ -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<Vec<models::ValidationError>>,
}
impl HttpValidationError {
pub fn new() -> HttpValidationError {
HttpValidationError {
detail: None,
}
}
}

View File

@@ -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;

View File

@@ -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<Option<String>>,
/// 生图的提示词
#[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<Option<String>>,
/// 生成图片,视频的分辨率
#[serde(rename = "ar", skip_serializing_if = "Option::is_none")]
pub ar: Option<String>,
}
impl TaskRequest {
pub fn new(prompt: String) -> TaskRequest {
TaskRequest {
task_type: None,
prompt,
img_url: None,
ar: None,
}
}
}

View File

@@ -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<models::ValidationErrorLocInner>,
#[serde(rename = "msg")]
pub msg: String,
#[serde(rename = "type")]
pub r#type: String,
}
impl ValidationError {
pub fn new(loc: Vec<models::ValidationErrorLocInner>, msg: String, r#type: String) -> ValidationError {
ValidationError {
loc,
msg,
r#type,
}
}
}

View File

@@ -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 {
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

7
openapitools.json Normal file
View File

@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.14.0"
}
}