coze-coding-dev-sdk 0.5.2__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coze_coding_dev_sdk-0.5.2/coze_coding_dev_sdk.egg-info → coze_coding_dev_sdk-0.5.4}/PKG-INFO +3 -4
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/__init__.py +16 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/cli.py +4 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/cli/knowledge.py +195 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/video.py +6 -11
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/cli/video_edit.py +888 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/core/client.py +2 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/core/config.py +1 -1
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/core/exceptions.py +2 -2
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/knowledge/__init__.py +19 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/knowledge/client.py +156 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/knowledge/models.py +45 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/llm/client.py +9 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/video/__init__.py +0 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/video/client.py +83 -19
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/video/models.py +9 -13
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/video_edit/__init__.py +23 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/video_edit/examples.py +340 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/video_edit/frame_extractor.py +176 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/video_edit/models.py +362 -0
- coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk/video_edit/video_edit.py +631 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4/coze_coding_dev_sdk.egg-info}/PKG-INFO +3 -4
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk.egg-info/SOURCES.txt +10 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk.egg-info/requires.txt +0 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/pyproject.toml +4 -5
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/CHANGELOG.md +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/LICENSE +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/MANIFEST.in +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/README.md +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/chat.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/constants.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/db.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/image.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/search.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/utils.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/cli/voice.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/core/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/database/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/database/client.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/database/migration.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/image/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/image/client.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/image/models.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/llm/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/llm/models.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/memory/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/memory/client.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/s3/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/s3/client.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/s3/models.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/search/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/search/client.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/search/models.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/voice/__init__.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/voice/asr.py +2 -2
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/voice/models.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk/voice/tts.py +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk.egg-info/dependency_links.txt +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk.egg-info/entry_points.txt +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/coze_coding_dev_sdk.egg-info/top_level.txt +0 -0
- {coze_coding_dev_sdk-0.5.2 → coze_coding_dev_sdk-0.5.4}/setup.cfg +0 -0
{coze_coding_dev_sdk-0.5.2/coze_coding_dev_sdk.egg-info → coze_coding_dev_sdk-0.5.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: coze-coding-dev-sdk
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: Coze Coding Dev SDK - 优雅的多功能 AI SDK,支持图片生成、视频生成、语音合成、语音识别、大语言模型和联网搜索。包含命令行工具 coze-coding-ai,支持 Context 上下文追踪
|
|
5
5
|
Author-email: Coze Coding Integration Team <support@coze.com>
|
|
6
6
|
Maintainer-email: Coze Coding Integration Team <support@coze.com>
|
|
@@ -39,9 +39,8 @@ Requires-Dist: psycopg-pool>=3.0.0
|
|
|
39
39
|
Requires-Dist: langgraph>=0.2.0
|
|
40
40
|
Requires-Dist: langgraph-checkpoint-postgres>=3.0.0
|
|
41
41
|
Requires-Dist: boto3>=1.26.0
|
|
42
|
-
|
|
43
|
-
Requires-Dist:
|
|
44
|
-
Requires-Dist: rich>=13.0.0; extra == "cli"
|
|
42
|
+
Requires-Dist: click>=8.0.0
|
|
43
|
+
Requires-Dist: rich>=13.0.0
|
|
45
44
|
Provides-Extra: dev
|
|
46
45
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
47
46
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
@@ -17,8 +17,16 @@ from .image import (
|
|
|
17
17
|
UsageInfo,
|
|
18
18
|
)
|
|
19
19
|
from .llm import LLMClient, LLMConfig
|
|
20
|
+
from .knowledge import (
|
|
21
|
+
ChunkConfig,
|
|
22
|
+
KnowledgeChunk,
|
|
23
|
+
KnowledgeClient,
|
|
24
|
+
KnowledgeDocument,
|
|
25
|
+
KnowledgeInsertResponse,
|
|
26
|
+
KnowledgeSearchResponse,
|
|
27
|
+
)
|
|
20
28
|
from .search import ImageItem, SearchClient, WebItem
|
|
21
|
-
from .video import
|
|
29
|
+
from .video import VideoGenerationClient, VideoGenerationTask
|
|
22
30
|
from .voice import ASRClient, ASRRequest, ASRResponse, TTSClient, TTSConfig, TTSRequest
|
|
23
31
|
|
|
24
32
|
# Database
|
|
@@ -55,11 +63,17 @@ __all__ = [
|
|
|
55
63
|
"ASRResponse",
|
|
56
64
|
"LLMClient",
|
|
57
65
|
"LLMConfig",
|
|
66
|
+
"KnowledgeClient",
|
|
67
|
+
"ChunkConfig",
|
|
68
|
+
"DataSourceType",
|
|
69
|
+
"KnowledgeSearchResponse",
|
|
70
|
+
"KnowledgeChunk",
|
|
71
|
+
"KnowledgeDocument",
|
|
72
|
+
"KnowledgeInsertResponse",
|
|
58
73
|
"SearchClient",
|
|
59
74
|
"WebItem",
|
|
60
75
|
"ImageItem",
|
|
61
76
|
"VideoGenerationClient",
|
|
62
|
-
"VideoConfig",
|
|
63
77
|
"VideoGenerationTask",
|
|
64
78
|
# Database
|
|
65
79
|
"Base",
|
|
@@ -3,8 +3,10 @@ import click
|
|
|
3
3
|
from .chat import chat
|
|
4
4
|
from .db import db
|
|
5
5
|
from .image import image
|
|
6
|
+
from .knowledge import knowledge
|
|
6
7
|
from .search import search
|
|
7
8
|
from .video import video
|
|
9
|
+
from .video_edit import video_edit
|
|
8
10
|
from .voice import asr, tts
|
|
9
11
|
|
|
10
12
|
|
|
@@ -16,7 +18,9 @@ def main():
|
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
main.add_command(video)
|
|
21
|
+
main.add_command(video_edit)
|
|
19
22
|
main.add_command(image)
|
|
23
|
+
main.add_command(knowledge)
|
|
20
24
|
main.add_command(search)
|
|
21
25
|
main.add_command(tts)
|
|
22
26
|
main.add_command(asr)
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import click
|
|
5
|
+
from coze_coding_utils.runtime_ctx.context import new_context
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
from rich.table import Table
|
|
8
|
+
|
|
9
|
+
from ..core.config import Config
|
|
10
|
+
from ..knowledge import (
|
|
11
|
+
ChunkConfig,
|
|
12
|
+
DataSourceType,
|
|
13
|
+
KnowledgeClient,
|
|
14
|
+
KnowledgeDocument,
|
|
15
|
+
)
|
|
16
|
+
from .constants import RUN_MODE_HEADER, RUN_MODE_TEST
|
|
17
|
+
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@click.group()
|
|
22
|
+
def knowledge():
|
|
23
|
+
"""Knowledge Base tools."""
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@knowledge.command()
|
|
28
|
+
@click.option("--query", "-q", required=True, help="Search query")
|
|
29
|
+
@click.option("--dataset", "-d", multiple=True, help="Dataset names (tables) to search in")
|
|
30
|
+
@click.option("--top-k", "-k", default=5, help="Number of results to return")
|
|
31
|
+
@click.option("--min-score", "-m", default=0.0, help="Minimum similarity score")
|
|
32
|
+
@click.option("--mock", is_flag=True, help="Use mock mode")
|
|
33
|
+
@click.option(
|
|
34
|
+
"--header",
|
|
35
|
+
"-H",
|
|
36
|
+
multiple=True,
|
|
37
|
+
help="Custom HTTP headers (format: 'Key: Value')",
|
|
38
|
+
)
|
|
39
|
+
@click.option("--verbose", "-v", is_flag=True, help="Show verbose logs")
|
|
40
|
+
def search(
|
|
41
|
+
query: str,
|
|
42
|
+
dataset: tuple,
|
|
43
|
+
top_k: int,
|
|
44
|
+
min_score: float,
|
|
45
|
+
mock: bool,
|
|
46
|
+
header: tuple,
|
|
47
|
+
verbose: bool,
|
|
48
|
+
):
|
|
49
|
+
"""Search for knowledge chunks."""
|
|
50
|
+
try:
|
|
51
|
+
from .utils import parse_headers
|
|
52
|
+
|
|
53
|
+
config = Config()
|
|
54
|
+
ctx = None
|
|
55
|
+
custom_headers = parse_headers(header) or {}
|
|
56
|
+
|
|
57
|
+
if mock:
|
|
58
|
+
ctx = new_context(method="knowledge.search", headers=custom_headers)
|
|
59
|
+
custom_headers[RUN_MODE_HEADER] = RUN_MODE_TEST
|
|
60
|
+
console.print("[yellow]🧪 Mock mode enabled[/yellow]")
|
|
61
|
+
|
|
62
|
+
client = KnowledgeClient(
|
|
63
|
+
config, ctx=ctx, custom_headers=custom_headers, verbose=verbose
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
dataset_list = list(dataset) if dataset else None
|
|
67
|
+
|
|
68
|
+
response = client.search(
|
|
69
|
+
query=query,
|
|
70
|
+
table_names=dataset_list,
|
|
71
|
+
top_k=top_k,
|
|
72
|
+
min_score=min_score,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
if response.code != 0:
|
|
76
|
+
console.print(f"[red]Error {response.code}: {response.msg}[/red]")
|
|
77
|
+
return
|
|
78
|
+
|
|
79
|
+
table = Table(title="Search Results")
|
|
80
|
+
table.add_column("Score", style="cyan", no_wrap=True)
|
|
81
|
+
table.add_column("Content", style="green")
|
|
82
|
+
table.add_column("Chunk ID", style="dim")
|
|
83
|
+
table.add_column("Doc ID", style="dim")
|
|
84
|
+
|
|
85
|
+
for chunk in response.chunks:
|
|
86
|
+
table.add_row(
|
|
87
|
+
f"{chunk.score:.4f}",
|
|
88
|
+
chunk.content,
|
|
89
|
+
chunk.chunk_id or "",
|
|
90
|
+
chunk.doc_id or "",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
console.print(table)
|
|
94
|
+
|
|
95
|
+
except Exception as e:
|
|
96
|
+
console.print(f"[red]✗ Error: {str(e)}[/red]")
|
|
97
|
+
raise click.Abort()
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@knowledge.command()
|
|
101
|
+
@click.option("--dataset", "-d", required=True, help="Dataset name (table) to add to")
|
|
102
|
+
@click.option("--content", "-c", multiple=True, help="Raw text content to add")
|
|
103
|
+
@click.option("--url", "-u", multiple=True, help="Web URL to add")
|
|
104
|
+
@click.option("--chunk-separator", default="\n", help="Chunk separator")
|
|
105
|
+
@click.option("--max-tokens", default=500, help="Max tokens per chunk")
|
|
106
|
+
@click.option("--remove-extra-spaces", is_flag=True, help="Normalize extra spaces")
|
|
107
|
+
@click.option("--remove-urls-emails", is_flag=True, help="Strip URLs and emails")
|
|
108
|
+
@click.option("--mock", is_flag=True, help="Use mock mode")
|
|
109
|
+
@click.option(
|
|
110
|
+
"--header",
|
|
111
|
+
"-H",
|
|
112
|
+
multiple=True,
|
|
113
|
+
help="Custom HTTP headers (format: 'Key: Value')",
|
|
114
|
+
)
|
|
115
|
+
@click.option("--verbose", "-v", is_flag=True, help="Show verbose logs")
|
|
116
|
+
def add(
|
|
117
|
+
dataset: str,
|
|
118
|
+
content: tuple,
|
|
119
|
+
url: tuple,
|
|
120
|
+
chunk_separator: str,
|
|
121
|
+
max_tokens: int,
|
|
122
|
+
remove_extra_spaces: bool,
|
|
123
|
+
remove_urls_emails: bool,
|
|
124
|
+
mock: bool,
|
|
125
|
+
header: tuple,
|
|
126
|
+
verbose: bool,
|
|
127
|
+
):
|
|
128
|
+
"""Add documents to knowledge base."""
|
|
129
|
+
try:
|
|
130
|
+
from .utils import parse_headers
|
|
131
|
+
|
|
132
|
+
config = Config()
|
|
133
|
+
ctx = None
|
|
134
|
+
custom_headers = parse_headers(header) or {}
|
|
135
|
+
|
|
136
|
+
if mock:
|
|
137
|
+
ctx = new_context(method="knowledge.add", headers=custom_headers)
|
|
138
|
+
custom_headers[RUN_MODE_HEADER] = RUN_MODE_TEST
|
|
139
|
+
console.print("[yellow]🧪 Mock mode enabled[/yellow]")
|
|
140
|
+
|
|
141
|
+
client = KnowledgeClient(
|
|
142
|
+
config, ctx=ctx, custom_headers=custom_headers, verbose=verbose
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
documents = []
|
|
146
|
+
for text in content:
|
|
147
|
+
documents.append(
|
|
148
|
+
KnowledgeDocument(
|
|
149
|
+
source=DataSourceType.TEXT,
|
|
150
|
+
raw_data=text,
|
|
151
|
+
)
|
|
152
|
+
)
|
|
153
|
+
for u in url:
|
|
154
|
+
documents.append(
|
|
155
|
+
KnowledgeDocument(
|
|
156
|
+
source=DataSourceType.URL,
|
|
157
|
+
url=u,
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
if not documents:
|
|
162
|
+
console.print("[red]No content or URL provided to add.[/red]")
|
|
163
|
+
return
|
|
164
|
+
|
|
165
|
+
chunk_config = ChunkConfig(
|
|
166
|
+
separator=chunk_separator,
|
|
167
|
+
max_tokens=max_tokens,
|
|
168
|
+
remove_extra_spaces=remove_extra_spaces,
|
|
169
|
+
remove_urls_emails=remove_urls_emails,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
response = client.add_documents(
|
|
173
|
+
documents=documents,
|
|
174
|
+
table_name=dataset,
|
|
175
|
+
chunk_config=chunk_config,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
if response.code != 0:
|
|
179
|
+
console.print(f"[red]Error {response.code}: {response.msg}[/red]")
|
|
180
|
+
return
|
|
181
|
+
|
|
182
|
+
table = Table(title="Add Documents Result")
|
|
183
|
+
table.add_column("Field", style="cyan", no_wrap=True)
|
|
184
|
+
table.add_column("Value", style="green")
|
|
185
|
+
|
|
186
|
+
table.add_row("Code", str(response.code))
|
|
187
|
+
table.add_row("Message", response.msg)
|
|
188
|
+
if response.doc_ids:
|
|
189
|
+
table.add_row("Doc IDs", ", ".join(response.doc_ids))
|
|
190
|
+
|
|
191
|
+
console.print(table)
|
|
192
|
+
|
|
193
|
+
except Exception as e:
|
|
194
|
+
console.print(f"[red]✗ Error: {str(e)}[/red]")
|
|
195
|
+
raise click.Abort()
|
|
@@ -13,7 +13,6 @@ from ..video import (
|
|
|
13
13
|
ImageURL,
|
|
14
14
|
ImageURLContent,
|
|
15
15
|
TextContent,
|
|
16
|
-
VideoConfig,
|
|
17
16
|
VideoGenerationClient,
|
|
18
17
|
)
|
|
19
18
|
from .constants import RUN_MODE_HEADER, RUN_MODE_TEST
|
|
@@ -96,15 +95,6 @@ def video(
|
|
|
96
95
|
|
|
97
96
|
ratio, resolution = parse_resolution(size)
|
|
98
97
|
|
|
99
|
-
video_config = VideoConfig(
|
|
100
|
-
resolution=resolution or "720p",
|
|
101
|
-
ratio=ratio or "16:9",
|
|
102
|
-
duration=duration or 5,
|
|
103
|
-
watermark=watermark,
|
|
104
|
-
seed=seed,
|
|
105
|
-
camerafixed=camerafixed,
|
|
106
|
-
)
|
|
107
|
-
|
|
108
98
|
content_items = []
|
|
109
99
|
|
|
110
100
|
if prompt:
|
|
@@ -147,9 +137,14 @@ def video(
|
|
|
147
137
|
video_url, response, last_frame_url = client.video_generation(
|
|
148
138
|
content_items=content_items,
|
|
149
139
|
model=model_name,
|
|
150
|
-
config=video_config,
|
|
151
140
|
callback_url=callback_url,
|
|
152
141
|
return_last_frame=return_last_frame,
|
|
142
|
+
resolution=resolution or "720p",
|
|
143
|
+
ratio=ratio or "16:9",
|
|
144
|
+
duration=duration or 5,
|
|
145
|
+
watermark=watermark,
|
|
146
|
+
seed=seed,
|
|
147
|
+
camerafixed=camerafixed,
|
|
153
148
|
)
|
|
154
149
|
|
|
155
150
|
progress.update(
|