完善 Rust SDK:中文化文档和注释,添加多个测试示例
- 翻译所有文档和注释为中文(README.md, CHANGELOG.md, API文档等) - 修复 reqwest TLS 支持问题,添加 rustls-tls 功能 - 新增5个测试示例: * health_check.rs - 基础健康检查 * llm_chat_test.rs - LLM聊天功能测试 * midjourney_image_test.rs - Midjourney图像生成测试 * file_upload_test.rs - 文件上传和媒体分析测试 * comprehensive_test.rs - 综合功能测试 - 添加测试脚本(PowerShell和Bash版本) - 验证API功能正常:LLM聊天、图像生成、健康检查等
This commit is contained in:
@@ -1,71 +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).
|
||||
格式基于 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
此项目遵循 [语义化版本控制](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
|
||||
### 新增
|
||||
- 文本视频智能体 Rust 客户端的初始版本
|
||||
- 完整覆盖文本视频智能体 API v1.0.6
|
||||
- 支持所有主要 API 分类:
|
||||
- 图像生成(多种模型)
|
||||
- 视频生成(多个提供商)
|
||||
- 音频合成和声音克隆
|
||||
- 使用 Hedra 2.0 和 3.0 的唇形同步
|
||||
- 数字人创建和动画
|
||||
- 大语言模型集成与多模态分析
|
||||
- ComfyUI 工作流执行
|
||||
- 文件上传和管理
|
||||
- 模板管理
|
||||
- 使用 `reqwest` 和 `tokio` 的异步/等待支持
|
||||
- 具有全面错误处理的类型安全 API
|
||||
- 文件上传的多部分表单数据支持
|
||||
- 演示基本用法和高级功能的示例
|
||||
- 完整的文档和 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
|
||||
### 功能
|
||||
- **DefaultApi**: 核心功能、模板、文件操作
|
||||
- **ApiApi**: 任务管理和基本操作
|
||||
- **Class302Api**: 302AI 集成服务
|
||||
- **Class302aiApiApi**: 302AI 即梦视频生成
|
||||
- **Class302aiMidjourneyApi**: 302AI Midjourney 集成
|
||||
- **Class302aiVeoApi**: 302AI VEO 视频生成
|
||||
- **ComfyuiApi**: ComfyUI 工作流执行
|
||||
- **Hedra20Api**: Hedra 2.0 唇形同步服务
|
||||
- **Hedra30Api**: Hedra 3.0 唇形同步服务
|
||||
- **LlmApi**: 大语言模型集成
|
||||
- **MidjourneyApi**: Midjourney 图像生成
|
||||
- **MidjourneyapiApi**: Midjourney 视频生成
|
||||
- **OmniHumanApi**: 数字人服务
|
||||
|
||||
### 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
|
||||
### 技术细节
|
||||
- 从 OpenAPI 3.1 规范生成
|
||||
- 使用 OpenAPI Generator 7.14.0 构建
|
||||
- Rust 版本 2021
|
||||
- MIT 或 Apache-2.0 双重许可证
|
||||
- 全面的测试覆盖(自动生成)
|
||||
- 包含示例的完整文档
|
||||
|
||||
### 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
|
||||
### 依赖项
|
||||
- `serde` ^1.0 带有 derive 功能
|
||||
- `serde_with` ^3.8 用于高级序列化
|
||||
- `serde_json` ^1.0 用于 JSON 处理
|
||||
- `serde_repr` ^0.1 用于枚举表示
|
||||
- `url` ^2.5 用于 URL 解析
|
||||
- `reqwest` ^0.12 带有 JSON 和多部分支持
|
||||
|
||||
### 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
|
||||
### 文档
|
||||
- 完整的 API 参考
|
||||
- 使用示例
|
||||
- 集成指南
|
||||
- 错误处理模式
|
||||
- 异步操作最佳实践
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[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"]
|
||||
authors = ["OpenAPI Generator 团队和贡献者"]
|
||||
description = "文本视频智能体 API 的 Rust 客户端 - 一个全面的 AI 内容生成服务,支持图像生成、视频生成、音频合成、唇形同步、数字人创建和大语言模型推理"
|
||||
keywords = ["api", "client", "video", "ai", "generation", "中文", "智能体"]
|
||||
categories = ["api-bindings", "multimedia", "web-programming::http-client"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
@@ -13,7 +13,7 @@ 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"] }
|
||||
@@ -21,7 +21,7 @@ serde_with = { version = "^3.8", default-features = false, features = ["base64",
|
||||
serde_json = "^1.0"
|
||||
serde_repr = "^0.1"
|
||||
url = "^2.5"
|
||||
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }
|
||||
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
# Text Video Agent Client
|
||||
# 文本视频智能体客户端
|
||||
|
||||
[](https://crates.io/crates/text_video_agent_client)
|
||||
[](https://docs.rs/text_video_agent_client)
|
||||
[](https://github.com/your-repo/text-video-agent-rust-sdk)
|
||||
[](https://docs.rs/text_video_agent_client)
|
||||
[](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:
|
||||
一个全面的 Rust 客户端,用于文本视频智能体 API - 一个支持以下功能的 AI 内容生成服务:
|
||||
|
||||
- 🎨 **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
|
||||
- 🎨 **图像生成** - 多种 AI 模型(Midjourney、Stable Diffusion 等)
|
||||
- 🎬 **视频生成** - 文本转视频和图像转视频
|
||||
- 🎵 **音频合成** - 文本转语音和声音克隆
|
||||
- 💋 **唇形同步** - 使用 Hedra 的高级唇形同步技术
|
||||
- 🤖 **数字人** - 创建和动画数字化身
|
||||
- 🧠 **大语言模型集成** - 多模态 AI 分析和推理
|
||||
- 🔧 **工作流自动化** - ComfyUI 工作流执行
|
||||
|
||||
## 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
|
||||
- **类型安全的 API** - 从 OpenAPI 3.1 规范生成
|
||||
- **异步/等待支持** - 基于 `reqwest` 和 `tokio` 构建
|
||||
- **全面覆盖** - 包含所有 API 端点
|
||||
- **文件上传支持** - 多部分表单数据处理
|
||||
- **错误处理** - 结构化错误响应
|
||||
- **文档** - 完整的 API 文档
|
||||
|
||||
## Installation
|
||||
## 安装
|
||||
|
||||
Add this to your `Cargo.toml`:
|
||||
将以下内容添加到您的 `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
@@ -33,7 +33,7 @@ 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};
|
||||
@@ -45,30 +45,30 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
..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);
|
||||
println!("任务已提交: {:?}", response);
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## API Overview
|
||||
## API 概览
|
||||
|
||||
This client was generated from the Text Video Agent API specification and provides access to all available endpoints:
|
||||
此客户端是从文本视频智能体 API 规范生成的,提供对所有可用端点的访问:
|
||||
|
||||
- **API version**: 1.0.6
|
||||
- **Package version**: 1.0.6
|
||||
- **Generated with**: OpenAPI Generator 7.14.0
|
||||
- **API 版本**: 1.0.6
|
||||
- **包版本**: 1.0.6
|
||||
- **生成工具**: OpenAPI Generator 7.14.0
|
||||
|
||||
## Documentation for API Endpoints
|
||||
## API 端点文档
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
所有 URI 都相对于 *http://localhost*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
类 | 方法 | HTTP 请求 | 描述
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*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 | 提交创建生成角色任务
|
||||
@@ -163,114 +163,180 @@ Class | Method | HTTP request | Description
|
||||
*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)
|
||||
- [FileUploadResponse](docs/FileUploadResponse.md) - 文件上传响应
|
||||
- [HttpValidationError](docs/HttpValidationError.md) - HTTP 验证错误
|
||||
- [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};
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::{default_api, llm_api};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let config = Configuration::default();
|
||||
let config = Configuration {
|
||||
base_path: "https://bowongai-dev--text-video-agent-fastapi-app.modal.run".to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
// Submit image generation task
|
||||
let response = default_api::submit_image_task_api_custom_image_submit_task_post(
|
||||
&config,
|
||||
// Add your parameters
|
||||
).await?;
|
||||
// 测试连接
|
||||
let response = default_api::root_get(&config).await?;
|
||||
println!("连接成功: {}", response);
|
||||
|
||||
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);
|
||||
println!("可用模型: {}", models);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## API Categories
|
||||
### LLM 聊天
|
||||
|
||||
The client provides access to the following API categories:
|
||||
```rust
|
||||
use text_video_agent_client::apis::{configuration::Configuration, llm_api};
|
||||
|
||||
- **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
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let config = Configuration {
|
||||
base_path: "https://bowongai-dev--text-video-agent-fastapi-app.modal.run".to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
## Documentation
|
||||
// LLM 聊天
|
||||
let response = llm_api::llm_chat(
|
||||
&config,
|
||||
"你好,请介绍一下你自己",
|
||||
None, // model_name
|
||||
Some(0.7), // temperature
|
||||
Some(1000), // max_tokens
|
||||
Some(30.0), // timeout
|
||||
).await?;
|
||||
|
||||
To access the complete API documentation:
|
||||
println!("AI 回复: {}", response);
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
### Midjourney 图像生成
|
||||
|
||||
```rust
|
||||
use text_video_agent_client::apis::{configuration::Configuration, midjourney_api};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let config = Configuration {
|
||||
base_path: "https://bowongai-dev--text-video-agent-fastapi-app.modal.run".to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
// 异步图像生成
|
||||
let response = midjourney_api::async_gen_image_api_mj_async_generate_image_post(
|
||||
&config,
|
||||
"a beautiful sunset over mountains, digital art",
|
||||
None, // img_file
|
||||
).await?;
|
||||
|
||||
println!("图像生成任务: {}", response);
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## 运行测试示例
|
||||
|
||||
我们提供了多个测试示例来验证 API 功能:
|
||||
|
||||
### 使用测试脚本(推荐)
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
cd cargos/text-video-agent-rust-sdk
|
||||
.\run_tests.ps1
|
||||
```
|
||||
|
||||
**Linux/macOS (Bash):**
|
||||
```bash
|
||||
cd cargos/text-video-agent-rust-sdk
|
||||
./run_tests.sh
|
||||
```
|
||||
|
||||
### 手动运行单个测试
|
||||
|
||||
```bash
|
||||
# 健康检查测试
|
||||
cargo run --example health_check
|
||||
|
||||
# LLM 聊天测试
|
||||
cargo run --example llm_chat_test
|
||||
|
||||
# Midjourney 图像生成测试
|
||||
cargo run --example midjourney_image_test
|
||||
|
||||
# 文件上传和媒体分析测试
|
||||
cargo run --example file_upload_test
|
||||
|
||||
# 综合功能测试
|
||||
cargo run --example comprehensive_test
|
||||
```
|
||||
|
||||
### 测试示例说明
|
||||
|
||||
1. **health_check.rs** - 基础健康检查,验证 API 连接和服务状态
|
||||
2. **llm_chat_test.rs** - 测试大语言模型聊天功能,包括交互式聊天
|
||||
3. **midjourney_image_test.rs** - 测试 Midjourney 图像生成功能
|
||||
4. **file_upload_test.rs** - 测试文件上传和媒体分析功能
|
||||
5. **comprehensive_test.rs** - 综合测试,包含性能测试和结果汇总
|
||||
|
||||
## API 分类
|
||||
|
||||
客户端提供对以下 API 分类的访问:
|
||||
|
||||
- **DefaultApi** - 核心功能(模板、文件上传、健康检查)
|
||||
- **ApiApi** - 任务管理和基本操作
|
||||
- **Class302Api** - 302AI 集成服务
|
||||
- **Class302aiApiApi** - 302AI 即梦视频生成
|
||||
- **Class302aiMidjourneyApi** - 302AI Midjourney 集成
|
||||
- **Class302aiVeoApi** - 302AI VEO 视频生成
|
||||
- **ComfyuiApi** - ComfyUI 工作流执行
|
||||
- **Hedra20Api** - Hedra 2.0 唇形同步服务
|
||||
- **Hedra30Api** - Hedra 3.0 唇形同步服务
|
||||
- **LlmApi** - 大语言模型集成
|
||||
- **MidjourneyApi** - Midjourney 图像生成
|
||||
- **MidjourneyapiApi** - Midjourney 视频生成
|
||||
- **OmniHumanApi** - 数字人服务
|
||||
|
||||
## 文档
|
||||
|
||||
要访问完整的 API 文档:
|
||||
|
||||
```bash
|
||||
cargo doc --open
|
||||
```
|
||||
|
||||
Or visit [docs.rs/text_video_agent_client](https://docs.rs/text_video_agent_client)
|
||||
或访问 [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.
|
||||
此客户端是从 OpenAPI 规范自动生成的。对于与 API 本身相关的问题,请联系 API 提供商。对于此 Rust 客户端的问题,请在仓库中提交 issue。
|
||||
|
||||
## 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)
|
||||
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) 或 http://www.apache.org/licenses/LICENSE-2.0)
|
||||
- MIT license ([LICENSE-MIT](LICENSE-MIT) 或 http://opensource.org/licenses/MIT)
|
||||
|
||||
at your option.
|
||||
您可以选择其中任何一个。
|
||||
|
||||
## Author
|
||||
## 作者
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
# \DefaultApi
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
所有 URI 都相对于 *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
方法 | HTTP 请求 | 描述
|
||||
------------- | ------------- | -------------
|
||||
[**root_get**](DefaultApi.md#root_get) | **GET** / | Root
|
||||
[**root_get**](DefaultApi.md#root_get) | **GET** / | 根路径
|
||||
|
||||
|
||||
|
||||
## 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
|
||||
### HTTP 请求头
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Content-Type**: 未定义
|
||||
- **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)
|
||||
[[返回顶部]](#) [[返回 API 列表]](../README.md#documentation-for-api-endpoints) [[返回模型列表]](../README.md#documentation-for-models) [[返回 README]](../README.md)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# \LlmApi
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
所有 URI 都相对于 *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
方法 | HTTP 请求 | 描述
|
||||
------------- | ------------- | -------------
|
||||
[**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推理
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# \MidjourneyApi
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
所有 URI 都相对于 *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
方法 | HTTP 请求 | 描述
|
||||
------------- | ------------- | -------------
|
||||
[**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 | 异步查询任务状态
|
||||
@@ -20,28 +20,28 @@ Method | HTTP request | Description
|
||||
> 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**> | | |
|
||||
**prompt** | **String** | 提示词 | [必需] |
|
||||
**img_file** | Option<**std::path::PathBuf**> | 图片文件 | |
|
||||
|
||||
### Return type
|
||||
### 返回类型
|
||||
|
||||
[**serde_json::Value**](serde_json::Value.md)
|
||||
|
||||
### Authorization
|
||||
### 授权
|
||||
|
||||
No authorization required
|
||||
无需授权
|
||||
|
||||
### HTTP request headers
|
||||
### HTTP 请求头
|
||||
|
||||
- **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)
|
||||
[[返回顶部]](#) [[返回 API 列表]](../README.md#documentation-for-api-endpoints) [[返回模型列表]](../README.md#documentation-for-models) [[返回 README]](../README.md)
|
||||
|
||||
|
||||
## async_query_status_api_mj_async_query_status_get
|
||||
|
||||
260
cargos/text-video-agent-rust-sdk/examples/comprehensive_test.rs
Normal file
260
cargos/text-video-agent-rust-sdk/examples/comprehensive_test.rs
Normal file
@@ -0,0 +1,260 @@
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::{default_api, midjourney_api, llm_api, hedra20_api};
|
||||
use std::time::Duration;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 创建支持 HTTPS 的客户端
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.build()?;
|
||||
|
||||
// 创建配置
|
||||
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,
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("🚀 文本视频智能体 API 综合测试");
|
||||
println!("===============================");
|
||||
println!("API 地址: {}", config.base_path);
|
||||
println!();
|
||||
|
||||
let mut test_results = Vec::new();
|
||||
|
||||
// 1. 基础连接测试
|
||||
println!("🔗 1. 基础连接测试");
|
||||
println!("------------------");
|
||||
|
||||
match default_api::root_get(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 根路径连接成功: {}", response);
|
||||
test_results.push(("根路径连接", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 根路径连接失败: {:?}", e);
|
||||
test_results.push(("根路径连接", false));
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 2. 健康检查测试
|
||||
println!("🏥 2. 服务健康检查");
|
||||
println!("------------------");
|
||||
|
||||
// Midjourney 健康检查
|
||||
match midjourney_api::health_check_api_mj_health_get(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Midjourney 服务健康: {}", response);
|
||||
test_results.push(("Midjourney 健康检查", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Midjourney 服务异常: {:?}", e);
|
||||
test_results.push(("Midjourney 健康检查", false));
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 3. LLM 功能测试
|
||||
println!("🧠 3. 大语言模型功能测试");
|
||||
println!("------------------------");
|
||||
|
||||
// 获取支持的模型
|
||||
match llm_api::llm_supported_models(&config).await {
|
||||
Ok(models) => {
|
||||
println!("✅ 获取模型列表成功: {}", models);
|
||||
test_results.push(("LLM 模型列表", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 获取模型列表失败: {:?}", e);
|
||||
test_results.push(("LLM 模型列表", false));
|
||||
}
|
||||
}
|
||||
|
||||
// 基础聊天测试
|
||||
match llm_api::llm_chat(
|
||||
&config,
|
||||
"请用一句话介绍人工智能",
|
||||
None,
|
||||
Some(0.7),
|
||||
Some(100),
|
||||
Some(30.0),
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ LLM 聊天成功: {}", response);
|
||||
test_results.push(("LLM 聊天", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ LLM 聊天失败: {:?}", e);
|
||||
test_results.push(("LLM 聊天", false));
|
||||
}
|
||||
}
|
||||
|
||||
// Gemini 聊天测试
|
||||
match llm_api::invoke_gemini_ai_api_llm_google_chat_post(
|
||||
&config,
|
||||
"Hello, how are you?",
|
||||
Some(30.0),
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Gemini 聊天成功: {}", response);
|
||||
test_results.push(("Gemini 聊天", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Gemini 聊天失败: {:?}", e);
|
||||
test_results.push(("Gemini 聊天", false));
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 4. 图像生成测试
|
||||
println!("🎨 4. 图像生成功能测试");
|
||||
println!("----------------------");
|
||||
|
||||
// 提示词检查
|
||||
let test_prompt = "a beautiful landscape";
|
||||
match midjourney_api::prompt_check_api_mj_prompt_check_get(&config, test_prompt).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 提示词检查成功: {}", response);
|
||||
test_results.push(("提示词检查", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 提示词检查失败: {:?}", e);
|
||||
test_results.push(("提示词检查", false));
|
||||
}
|
||||
}
|
||||
|
||||
// 异步图像生成
|
||||
match midjourney_api::async_gen_image_api_mj_async_generate_image_post(
|
||||
&config,
|
||||
"a simple test image, minimalist style",
|
||||
None,
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 异步图像生成任务提交成功: {}", response);
|
||||
test_results.push(("异步图像生成", true));
|
||||
|
||||
// 如果有任务ID,尝试查询状态
|
||||
if let Some(task_id) = response.get("task_id").and_then(|v| v.as_str()) {
|
||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||
|
||||
match midjourney_api::async_query_status_api_mj_async_query_status_get(
|
||||
&config,
|
||||
task_id,
|
||||
).await {
|
||||
Ok(status) => {
|
||||
println!("✅ 任务状态查询成功: {}", status);
|
||||
test_results.push(("任务状态查询", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 任务状态查询失败: {:?}", e);
|
||||
test_results.push(("任务状态查询", false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 异步图像生成失败: {:?}", e);
|
||||
test_results.push(("异步图像生成", false));
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 5. Hedra 功能测试
|
||||
println!("💋 5. Hedra 唇形同步测试");
|
||||
println!("------------------------");
|
||||
|
||||
// 注意:这里需要实际的图片和音频文件路径
|
||||
// 由于是测试,我们只测试查询任务状态功能
|
||||
match hedra20_api::query_task_status_api302_hedra_v2_task_status_get(
|
||||
&config,
|
||||
"test_task_id", // 测试任务ID
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Hedra 任务状态查询成功: {}", response);
|
||||
test_results.push(("Hedra 状态查询", true));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Hedra 任务状态查询失败: {:?}", e);
|
||||
test_results.push(("Hedra 状态查询", false));
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 6. 性能测试
|
||||
println!("⚡ 6. 性能测试");
|
||||
println!("-------------");
|
||||
|
||||
let start_time = std::time::Instant::now();
|
||||
let mut successful_requests = 0;
|
||||
let total_requests = 5;
|
||||
|
||||
for i in 1..=total_requests {
|
||||
match llm_api::llm_chat(
|
||||
&config,
|
||||
&format!("这是第{}个测试请求", i),
|
||||
None,
|
||||
Some(0.5),
|
||||
Some(50),
|
||||
Some(10.0),
|
||||
).await {
|
||||
Ok(_) => {
|
||||
successful_requests += 1;
|
||||
print!("✅");
|
||||
}
|
||||
Err(_) => {
|
||||
print!("❌");
|
||||
}
|
||||
}
|
||||
std::io::Write::flush(&mut std::io::stdout()).unwrap();
|
||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
||||
}
|
||||
|
||||
let elapsed = start_time.elapsed();
|
||||
println!();
|
||||
println!("📊 性能测试结果:");
|
||||
println!(" - 总请求数: {}", total_requests);
|
||||
println!(" - 成功请求数: {}", successful_requests);
|
||||
println!(" - 成功率: {:.1}%", (successful_requests as f64 / total_requests as f64) * 100.0);
|
||||
println!(" - 总耗时: {:.2}秒", elapsed.as_secs_f64());
|
||||
println!(" - 平均响应时间: {:.2}秒", elapsed.as_secs_f64() / total_requests as f64);
|
||||
|
||||
test_results.push(("性能测试", successful_requests > total_requests / 2));
|
||||
println!();
|
||||
|
||||
// 7. 测试结果汇总
|
||||
println!("📋 7. 测试结果汇总");
|
||||
println!("------------------");
|
||||
|
||||
let total_tests = test_results.len();
|
||||
let passed_tests = test_results.iter().filter(|(_, passed)| *passed).count();
|
||||
|
||||
println!("测试项目详情:");
|
||||
for (test_name, passed) in &test_results {
|
||||
let status = if *passed { "✅ 通过" } else { "❌ 失败" };
|
||||
println!(" - {}: {}", test_name, status);
|
||||
}
|
||||
|
||||
println!();
|
||||
println!("总体结果:");
|
||||
println!(" - 总测试数: {}", total_tests);
|
||||
println!(" - 通过测试数: {}", passed_tests);
|
||||
println!(" - 通过率: {:.1}%", (passed_tests as f64 / total_tests as f64) * 100.0);
|
||||
|
||||
if passed_tests == total_tests {
|
||||
println!("🎉 所有测试通过!API 功能正常。");
|
||||
} else if passed_tests > total_tests / 2 {
|
||||
println!("⚠️ 大部分测试通过,但有部分功能可能存在问题。");
|
||||
} else {
|
||||
println!("🚨 多数测试失败,API 可能存在严重问题。");
|
||||
}
|
||||
|
||||
println!();
|
||||
println!("🎯 综合测试完成!");
|
||||
Ok(())
|
||||
}
|
||||
175
cargos/text-video-agent-rust-sdk/examples/file_upload_test.rs
Normal file
175
cargos/text-video-agent-rust-sdk/examples/file_upload_test.rs
Normal file
@@ -0,0 +1,175 @@
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::llm_api;
|
||||
use std::path::PathBuf;
|
||||
use std::fs;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 创建支持 HTTPS 的客户端
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.build()?;
|
||||
|
||||
// 创建配置
|
||||
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,
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("📁 文件上传和媒体分析测试");
|
||||
println!("==========================");
|
||||
println!("API 地址: {}", config.base_path);
|
||||
println!();
|
||||
|
||||
// 创建一个测试文本文件
|
||||
let test_file_path = "test_file.txt";
|
||||
let test_content = "这是一个测试文件,用于验证文件上传功能。\nThis is a test file for verifying file upload functionality.";
|
||||
|
||||
println!("📝 创建测试文件: {}", test_file_path);
|
||||
fs::write(test_file_path, test_content)?;
|
||||
println!("✅ 测试文件创建成功");
|
||||
println!();
|
||||
|
||||
// 1. 测试文件上传到 Google 存储
|
||||
println!("☁️ 测试文件上传到 Google 存储...");
|
||||
let file_path = PathBuf::from(test_file_path);
|
||||
|
||||
match llm_api::google_file_upload(&config, file_path.clone()).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 文件上传成功: {}", response);
|
||||
|
||||
// 尝试从响应中提取文件URI
|
||||
if let Some(data) = response.get("data").and_then(|v| v.as_str()) {
|
||||
println!("📎 文件URI: {}", data);
|
||||
|
||||
// 2. 使用上传的文件进行媒体分析
|
||||
println!();
|
||||
println!("🔍 测试媒体分析(同步)...");
|
||||
|
||||
let analysis_prompts = vec![
|
||||
"请分析这个文件的内容",
|
||||
"这个文件包含什么信息?",
|
||||
"请总结文件的主要内容",
|
||||
];
|
||||
|
||||
for (i, prompt) in analysis_prompts.iter().enumerate() {
|
||||
println!("🔸 分析 {}: {}", i + 1, prompt);
|
||||
|
||||
match llm_api::invoke_media_analysis_api_llm_google_sync_media_analysis_post(
|
||||
&config,
|
||||
prompt,
|
||||
data, // 使用上传后的文件URI
|
||||
).await {
|
||||
Ok(analysis_response) => {
|
||||
println!("✅ 分析结果: {}", analysis_response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 分析失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 添加延迟
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
}
|
||||
|
||||
// 3. 测试异步媒体分析
|
||||
println!("⚡ 测试媒体分析(异步)...");
|
||||
let async_prompt = "请详细分析这个文件,包括语言、内容主题和结构";
|
||||
|
||||
match llm_api::submit_media_inference_api_llm_google_async_media_analysis_post(
|
||||
&config,
|
||||
async_prompt,
|
||||
data,
|
||||
).await {
|
||||
Ok(async_response) => {
|
||||
println!("✅ 异步分析任务提交成功: {}", async_response);
|
||||
|
||||
// 尝试获取任务ID
|
||||
if let Some(task_id) = async_response.get("task_id").and_then(|v| v.as_str()) {
|
||||
println!("📋 任务ID: {}", task_id);
|
||||
|
||||
// 轮询任务状态
|
||||
println!("⏳ 查询任务状态...");
|
||||
for attempt in 1..=5 {
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
|
||||
|
||||
match llm_api::llm_task_id(&config, task_id).await {
|
||||
Ok(status_response) => {
|
||||
println!("📊 第{}次查询 - 任务状态: {}", attempt, status_response);
|
||||
|
||||
// 检查任务是否完成
|
||||
if let Some(status) = status_response.get("status") {
|
||||
if status.is_boolean() && status.as_bool() == Some(true) {
|
||||
println!("🎉 异步分析任务完成!");
|
||||
if let Some(data) = status_response.get("data") {
|
||||
println!("📄 分析结果: {}", data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 查询状态失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 异步分析任务提交失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 文件上传失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 4. 测试不同类型的媒体URI分析
|
||||
println!("🌐 测试在线媒体分析...");
|
||||
let online_media_tests = vec![
|
||||
("https://example.com/sample.jpg", "请描述这张图片的内容"),
|
||||
("https://example.com/sample.mp4", "请分析这个视频的主要内容"),
|
||||
("https://example.com/sample.mp3", "请分析这个音频文件"),
|
||||
];
|
||||
|
||||
for (media_uri, prompt) in online_media_tests.iter() {
|
||||
println!("🔗 分析媒体: {}", media_uri);
|
||||
println!("❓ 提示: {}", prompt);
|
||||
|
||||
match llm_api::invoke_media_analysis_api_llm_google_sync_media_analysis_post(
|
||||
&config,
|
||||
prompt,
|
||||
media_uri,
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 分析结果: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 分析失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
}
|
||||
|
||||
// 清理测试文件
|
||||
println!("🧹 清理测试文件...");
|
||||
if let Err(e) = fs::remove_file(test_file_path) {
|
||||
println!("⚠️ 删除测试文件失败: {}", e);
|
||||
} else {
|
||||
println!("✅ 测试文件已删除");
|
||||
}
|
||||
|
||||
println!("🎯 文件上传和媒体分析测试完成!");
|
||||
Ok(())
|
||||
}
|
||||
65
cargos/text-video-agent-rust-sdk/examples/health_check.rs
Normal file
65
cargos/text-video-agent-rust-sdk/examples/health_check.rs
Normal file
@@ -0,0 +1,65 @@
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::{default_api, midjourney_api, llm_api};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 创建支持 HTTPS 的客户端
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.build()?;
|
||||
|
||||
// 创建配置
|
||||
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,
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("🚀 文本视频智能体 API 健康检查");
|
||||
println!("================================");
|
||||
println!("API 地址: {}", config.base_path);
|
||||
println!();
|
||||
|
||||
// 1. 测试根路径
|
||||
println!("📍 测试根路径...");
|
||||
match default_api::root_get(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 根路径响应: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 根路径错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 2. 测试 Midjourney 健康检查
|
||||
println!("🎨 测试 Midjourney 健康检查...");
|
||||
match midjourney_api::health_check_api_mj_health_get(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Midjourney 健康状态: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Midjourney 健康检查错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 3. 测试获取支持的 LLM 模型
|
||||
println!("🧠 获取支持的 LLM 模型...");
|
||||
match llm_api::llm_supported_models(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 支持的模型: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 获取模型列表错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
println!("🎯 健康检查完成!");
|
||||
Ok(())
|
||||
}
|
||||
141
cargos/text-video-agent-rust-sdk/examples/llm_chat_test.rs
Normal file
141
cargos/text-video-agent-rust-sdk/examples/llm_chat_test.rs
Normal file
@@ -0,0 +1,141 @@
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::llm_api;
|
||||
use std::io::{self, Write};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 创建支持 HTTPS 的客户端
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.build()?;
|
||||
|
||||
// 创建配置
|
||||
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,
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("🤖 大语言模型聊天测试");
|
||||
println!("====================");
|
||||
println!("API 地址: {}", config.base_path);
|
||||
println!();
|
||||
|
||||
// 1. 获取支持的模型列表
|
||||
println!("📋 获取支持的模型列表...");
|
||||
match llm_api::llm_supported_models(&config).await {
|
||||
Ok(models) => {
|
||||
println!("✅ 支持的模型: {}", models);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 获取模型列表失败: {:?}", e);
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 2. 测试基本聊天功能
|
||||
println!("💬 测试基本聊天功能...");
|
||||
let test_prompts = vec![
|
||||
"你好,请介绍一下你自己",
|
||||
"什么是人工智能?",
|
||||
"请用中文回答:今天天气怎么样?",
|
||||
"帮我写一首关于春天的诗",
|
||||
];
|
||||
|
||||
for (i, prompt) in test_prompts.iter().enumerate() {
|
||||
println!("🔸 测试 {}: {}", i + 1, prompt);
|
||||
|
||||
match llm_api::llm_chat(
|
||||
&config,
|
||||
prompt,
|
||||
None, // model_name: 使用默认模型
|
||||
Some(0.7), // temperature: 创造性参数
|
||||
Some(1000), // max_tokens: 最大令牌数
|
||||
Some(30.0), // timeout: 超时时间(秒)
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 回复: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 聊天错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 添加延迟避免请求过于频繁
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
}
|
||||
|
||||
// 3. 测试 Gemini 聊天
|
||||
println!("🌟 测试 Gemini 聊天...");
|
||||
match llm_api::invoke_gemini_ai_api_llm_google_chat_post(
|
||||
&config,
|
||||
"请用中文简单介绍一下 Rust 编程语言的特点",
|
||||
Some(30.0), // timeout
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Gemini 回复: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Gemini 聊天错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 4. 交互式聊天(可选)
|
||||
println!("🎯 想要进行交互式聊天吗?(y/n)");
|
||||
print!("> ");
|
||||
io::stdout().flush()?;
|
||||
|
||||
let mut input = String::new();
|
||||
io::stdin().read_line(&mut input)?;
|
||||
|
||||
if input.trim().to_lowercase() == "y" {
|
||||
println!("💭 进入交互式聊天模式(输入 'quit' 退出):");
|
||||
|
||||
loop {
|
||||
print!("您: ");
|
||||
io::stdout().flush()?;
|
||||
|
||||
let mut user_input = String::new();
|
||||
io::stdin().read_line(&mut user_input)?;
|
||||
let user_input = user_input.trim();
|
||||
|
||||
if user_input == "quit" {
|
||||
break;
|
||||
}
|
||||
|
||||
if user_input.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
print!("🤖 思考中...");
|
||||
io::stdout().flush()?;
|
||||
|
||||
match llm_api::llm_chat(
|
||||
&config,
|
||||
user_input,
|
||||
None,
|
||||
Some(0.7),
|
||||
Some(1000),
|
||||
Some(30.0),
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("\r🤖 AI: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("\r❌ 错误: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
}
|
||||
}
|
||||
|
||||
println!("👋 聊天测试完成!");
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
use text_video_agent_client::apis::configuration::Configuration;
|
||||
use text_video_agent_client::apis::midjourney_api;
|
||||
use std::time::Duration;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 创建支持 HTTPS 的客户端
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(30))
|
||||
.build()?;
|
||||
|
||||
// 创建配置
|
||||
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,
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("🎨 Midjourney 图像生成测试");
|
||||
println!("==========================");
|
||||
println!("API 地址: {}", config.base_path);
|
||||
println!();
|
||||
|
||||
// 1. 健康检查
|
||||
println!("🔍 检查 Midjourney 服务状态...");
|
||||
match midjourney_api::health_check_api_mj_health_get(&config).await {
|
||||
Ok(response) => {
|
||||
println!("✅ Midjourney 服务正常: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ Midjourney 服务异常: {:?}", e);
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 2. 测试提示词检查
|
||||
println!("📝 测试提示词预审...");
|
||||
let test_prompt = "a beautiful sunset over mountains, digital art, highly detailed";
|
||||
|
||||
match midjourney_api::prompt_check_api_mj_prompt_check_get(&config, test_prompt).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 提示词检查结果: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 提示词检查失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 3. 测试同步图像生成
|
||||
println!("🖼️ 测试同步图像生成...");
|
||||
let image_prompts = vec![
|
||||
"a cute cat sitting on a windowsill, watercolor style",
|
||||
"futuristic city skyline at night, cyberpunk style, neon lights",
|
||||
"peaceful zen garden with cherry blossoms, traditional Japanese art",
|
||||
"abstract geometric patterns in blue and gold, modern art",
|
||||
];
|
||||
|
||||
for (i, prompt) in image_prompts.iter().enumerate() {
|
||||
println!("🎯 生成图像 {}: {}", i + 1, prompt);
|
||||
|
||||
match midjourney_api::generate_image_sync_api_mj_sync_image_post(
|
||||
&config,
|
||||
prompt,
|
||||
None, // aspect_ratio
|
||||
None, // model
|
||||
None, // quality
|
||||
None, // style
|
||||
None, // chaos
|
||||
None, // seed
|
||||
None, // stylize
|
||||
None, // weird
|
||||
None, // tile
|
||||
None, // no
|
||||
None, // iw
|
||||
None, // version
|
||||
None, // uplight
|
||||
None, // beta
|
||||
None, // hd
|
||||
None, // test
|
||||
None, // testp
|
||||
None, // creative
|
||||
None, // fast
|
||||
None, // relax
|
||||
None, // stop
|
||||
None, // video
|
||||
None, // max_wait_time
|
||||
None, // poll_interval
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 图像生成成功: {}", response);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 图像生成失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
// 添加延迟避免请求过于频繁
|
||||
tokio::time::sleep(Duration::from_secs(3)).await;
|
||||
}
|
||||
|
||||
// 4. 测试异步图像生成
|
||||
println!("⚡ 测试异步图像生成...");
|
||||
let async_prompt = "a majestic dragon flying over a medieval castle, fantasy art, epic scene";
|
||||
|
||||
match midjourney_api::async_gen_image_api_mj_async_generate_image_post(
|
||||
&config,
|
||||
async_prompt,
|
||||
None, // img_file
|
||||
).await {
|
||||
Ok(response) => {
|
||||
println!("✅ 异步任务提交成功: {}", response);
|
||||
|
||||
// 尝试解析任务ID(假设响应中包含task_id字段)
|
||||
if let Some(task_id) = response.get("task_id").and_then(|v| v.as_str()) {
|
||||
println!("📋 任务ID: {}", task_id);
|
||||
|
||||
// 轮询任务状态
|
||||
println!("⏳ 查询任务状态...");
|
||||
for attempt in 1..=5 {
|
||||
tokio::time::sleep(Duration::from_secs(10)).await;
|
||||
|
||||
match midjourney_api::async_query_status_api_mj_async_query_status_get(
|
||||
&config,
|
||||
task_id,
|
||||
).await {
|
||||
Ok(status_response) => {
|
||||
println!("📊 第{}次查询 - 任务状态: {}", attempt, status_response);
|
||||
|
||||
// 检查任务是否完成(这里需要根据实际API响应格式调整)
|
||||
if let Some(status) = status_response.get("status").and_then(|v| v.as_str()) {
|
||||
if status == "completed" || status == "success" {
|
||||
println!("🎉 任务完成!");
|
||||
break;
|
||||
} else if status == "failed" || status == "error" {
|
||||
println!("💥 任务失败!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 查询状态失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
println!("❌ 异步任务提交失败: {:?}", e);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
|
||||
println!("🎯 Midjourney 图像生成测试完成!");
|
||||
Ok(())
|
||||
}
|
||||
@@ -2,7 +2,7 @@ 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()),
|
||||
@@ -13,26 +13,26 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
api_key: None,
|
||||
};
|
||||
|
||||
println!("Text Video Agent Rust Client");
|
||||
println!("文本视频智能体 Rust 客户端");
|
||||
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...");
|
||||
println!("配置创建成功!");
|
||||
println!("基础路径: {}", config.base_path);
|
||||
println!("用户代理: {:?}", config.user_agent);
|
||||
|
||||
println!("\n这是一个展示如何创建配置的基本示例。");
|
||||
println!("要使用实际的 API 端点,您需要:");
|
||||
println!("1. 将 'https://your-api-endpoint.com' 替换为真实的 API URL");
|
||||
println!("2. 如果需要,添加身份验证");
|
||||
println!("3. 调用您需要的特定 API 函数");
|
||||
|
||||
println!("\n可用的 API 模块:");
|
||||
println!("- default_api: 核心功能");
|
||||
println!("- api_api: 任务管理");
|
||||
println!("- class302_api: 302AI 服务");
|
||||
println!("- llm_api: 大语言模型集成");
|
||||
println!("- hedra30_api: 唇形同步服务");
|
||||
println!("- omni_human_api: 数字人服务");
|
||||
println!("- 以及更多...");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
92
cargos/text-video-agent-rust-sdk/run_tests.ps1
Normal file
92
cargos/text-video-agent-rust-sdk/run_tests.ps1
Normal file
@@ -0,0 +1,92 @@
|
||||
# 文本视频智能体 API 测试脚本
|
||||
# PowerShell 脚本用于运行各种测试示例
|
||||
|
||||
Write-Host "🚀 文本视频智能体 API 测试脚本" -ForegroundColor Green
|
||||
Write-Host "================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
|
||||
# 检查是否在正确的目录
|
||||
if (-not (Test-Path "Cargo.toml")) {
|
||||
Write-Host "❌ 错误: 请在 text-video-agent-rust-sdk 目录下运行此脚本" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 显示可用的测试选项
|
||||
Write-Host "📋 可用的测试选项:" -ForegroundColor Yellow
|
||||
Write-Host "1. 健康检查测试 (health_check)"
|
||||
Write-Host "2. LLM 聊天测试 (llm_chat_test)"
|
||||
Write-Host "3. Midjourney 图像生成测试 (midjourney_image_test)"
|
||||
Write-Host "4. 文件上传和媒体分析测试 (file_upload_test)"
|
||||
Write-Host "5. 综合功能测试 (comprehensive_test)"
|
||||
Write-Host "6. 运行所有测试"
|
||||
Write-Host "0. 退出"
|
||||
Write-Host ""
|
||||
|
||||
do {
|
||||
$choice = Read-Host "请选择要运行的测试 (0-6)"
|
||||
|
||||
switch ($choice) {
|
||||
"1" {
|
||||
Write-Host "🔍 运行健康检查测试..." -ForegroundColor Cyan
|
||||
cargo run --example health_check
|
||||
break
|
||||
}
|
||||
"2" {
|
||||
Write-Host "🤖 运行 LLM 聊天测试..." -ForegroundColor Cyan
|
||||
cargo run --example llm_chat_test
|
||||
break
|
||||
}
|
||||
"3" {
|
||||
Write-Host "🎨 运行 Midjourney 图像生成测试..." -ForegroundColor Cyan
|
||||
cargo run --example midjourney_image_test
|
||||
break
|
||||
}
|
||||
"4" {
|
||||
Write-Host "📁 运行文件上传和媒体分析测试..." -ForegroundColor Cyan
|
||||
cargo run --example file_upload_test
|
||||
break
|
||||
}
|
||||
"5" {
|
||||
Write-Host "🚀 运行综合功能测试..." -ForegroundColor Cyan
|
||||
cargo run --example comprehensive_test
|
||||
break
|
||||
}
|
||||
"6" {
|
||||
Write-Host "🎯 运行所有测试..." -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "1/5 健康检查测试" -ForegroundColor Yellow
|
||||
cargo run --example health_check
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "2/5 LLM 聊天测试" -ForegroundColor Yellow
|
||||
cargo run --example llm_chat_test
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "3/5 Midjourney 图像生成测试" -ForegroundColor Yellow
|
||||
cargo run --example midjourney_image_test
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "4/5 文件上传和媒体分析测试" -ForegroundColor Yellow
|
||||
cargo run --example file_upload_test
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "5/5 综合功能测试" -ForegroundColor Yellow
|
||||
cargo run --example comprehensive_test
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "✅ 所有测试完成!" -ForegroundColor Green
|
||||
break
|
||||
}
|
||||
"0" {
|
||||
Write-Host "👋 退出测试脚本" -ForegroundColor Green
|
||||
exit 0
|
||||
}
|
||||
default {
|
||||
Write-Host "❌ 无效选择,请输入 0-6 之间的数字" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
} while ($true)
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "🎉 测试完成!" -ForegroundColor Green
|
||||
94
cargos/text-video-agent-rust-sdk/run_tests.sh
Normal file
94
cargos/text-video-agent-rust-sdk/run_tests.sh
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 文本视频智能体 API 测试脚本
|
||||
# Bash 脚本用于运行各种测试示例
|
||||
|
||||
echo "🚀 文本视频智能体 API 测试脚本"
|
||||
echo "================================"
|
||||
echo ""
|
||||
|
||||
# 检查是否在正确的目录
|
||||
if [ ! -f "Cargo.toml" ]; then
|
||||
echo "❌ 错误: 请在 text-video-agent-rust-sdk 目录下运行此脚本"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 显示可用的测试选项
|
||||
echo "📋 可用的测试选项:"
|
||||
echo "1. 健康检查测试 (health_check)"
|
||||
echo "2. LLM 聊天测试 (llm_chat_test)"
|
||||
echo "3. Midjourney 图像生成测试 (midjourney_image_test)"
|
||||
echo "4. 文件上传和媒体分析测试 (file_upload_test)"
|
||||
echo "5. 综合功能测试 (comprehensive_test)"
|
||||
echo "6. 运行所有测试"
|
||||
echo "0. 退出"
|
||||
echo ""
|
||||
|
||||
while true; do
|
||||
read -p "请选择要运行的测试 (0-6): " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
echo "🔍 运行健康检查测试..."
|
||||
cargo run --example health_check
|
||||
break
|
||||
;;
|
||||
2)
|
||||
echo "🤖 运行 LLM 聊天测试..."
|
||||
cargo run --example llm_chat_test
|
||||
break
|
||||
;;
|
||||
3)
|
||||
echo "🎨 运行 Midjourney 图像生成测试..."
|
||||
cargo run --example midjourney_image_test
|
||||
break
|
||||
;;
|
||||
4)
|
||||
echo "📁 运行文件上传和媒体分析测试..."
|
||||
cargo run --example file_upload_test
|
||||
break
|
||||
;;
|
||||
5)
|
||||
echo "🚀 运行综合功能测试..."
|
||||
cargo run --example comprehensive_test
|
||||
break
|
||||
;;
|
||||
6)
|
||||
echo "🎯 运行所有测试..."
|
||||
echo ""
|
||||
|
||||
echo "1/5 健康检查测试"
|
||||
cargo run --example health_check
|
||||
echo ""
|
||||
|
||||
echo "2/5 LLM 聊天测试"
|
||||
cargo run --example llm_chat_test
|
||||
echo ""
|
||||
|
||||
echo "3/5 Midjourney 图像生成测试"
|
||||
cargo run --example midjourney_image_test
|
||||
echo ""
|
||||
|
||||
echo "4/5 文件上传和媒体分析测试"
|
||||
cargo run --example file_upload_test
|
||||
echo ""
|
||||
|
||||
echo "5/5 综合功能测试"
|
||||
cargo run --example comprehensive_test
|
||||
echo ""
|
||||
|
||||
echo "✅ 所有测试完成!"
|
||||
break
|
||||
;;
|
||||
0)
|
||||
echo "👋 退出测试脚本"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "❌ 无效选择,请输入 0-6 之间的数字"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "🎉 测试完成!"
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Text Video Agent Api
|
||||
* 文本视频智能体 API
|
||||
*
|
||||
* 文本生成视频API服务
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.6
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI 文档版本: 1.0.6
|
||||
*
|
||||
* 生成工具: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Text Video Agent Api
|
||||
* 文本视频智能体 API
|
||||
*
|
||||
* 文本生成视频API服务
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.6
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI 文档版本: 1.0.6
|
||||
*
|
||||
* 生成工具: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::{apis::ResponseContent, models};
|
||||
use super::{Error, configuration, ContentType};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`root_get`]
|
||||
/// 方法 [`root_get`] 的类型化错误结构体
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum RootGetError {
|
||||
|
||||
Reference in New Issue
Block a user