Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,6 @@ response = coll.generate_text(
model_name="pro", # basic, pro, or ultra
response_type="text" # text or json
)

# Large prompts are uploaded automatically with a unique filename and
# sent as prompt_url instead of inline JSON to avoid request payload limits.
```

### Video Dubbing and Translation
Expand Down
89 changes: 7 additions & 82 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1915,14 +1915,6 @@ paths:
aspect_ratio:
type: string
example: "16:9"
model_name:
type: string
description: Use `flux` for FLUX self-inference image generation.
example: "flux"
config:
type: object
description: Model configuration. For FLUX supports size, num_inference_steps, guidance_scale, negative_prompt, and seed.
additionalProperties: true
callback_url:
type: string
example: "https://webhook.example.com/callback"
Expand Down Expand Up @@ -1991,32 +1983,16 @@ paths:
schema:
type: object
required:
- prompt
- audio_type
properties:
prompt:
type: string
description: Prompt for music or sound effect generation.
example: "Generate upbeat background music"
text:
type: string
description: Text to convert to speech when `audio_type` is `voice`.
example: "Hello, welcome to VideoDB."
audio_type:
type: string
enum: [voice, sound_effect, music]
example: "voice"
voice_name:
type: string
description: Voice name for hosted text-to-speech.
example: "Default"
model_name:
type: string
description: Use `omnivoice` for OmniVoice self-inference text-to-speech.
example: "omnivoice"
config:
type: object
description: Voice configuration. For OmniVoice supports instructions, ref_audio, ref_text, response_format, speed, language, and max_new_tokens.
additionalProperties: true
enum: [speech, sound_effect, music]
example: "music"
callback_url:
type: string
example: "https://webhook.example.com/callback"
Expand All @@ -2028,39 +2004,6 @@ paths:
schema:
$ref: '#/components/schemas/AsyncResponse'

/job/{job_id}:
get:
summary: Get self-inference generation job status
security:
- ApiKeyAuth: []
parameters:
- name: job_id
in: path
required: true
schema:
type: string
example: "550e8400-e29b-41d4-a716-446655440000"
responses:
'200':
description: Generation job status or final generated asset
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
status:
type: string
enum: [processing, done, failed]
data:
type: object
additionalProperties: true
message:
type: string
'404':
description: Job not found

/collection/{collection_id}/generate/text/:
post:
summary: Generate text using AI
Expand All @@ -2079,45 +2022,27 @@ paths:
application/json:
schema:
type: object
description: Provide either `prompt` for inline text or `prompt_url` for a previously uploaded prompt file.
required:
- prompt
properties:
prompt:
type: string
description: Inline prompt text. Use for smaller prompts.
example: "Summarize the content of this video"
prompt_url:
type: string
description: URL to a previously uploaded plain-text prompt file. Use for larger prompts.
example: "https://storage.googleapis.com/.../generate_text_prompt_123abc.txt"
video_id:
type: string
example: "m-12345"
model_name:
type: string
description: Hosted tier (`mini`, `basic`, `pro`, `ultra`) or self-hosted sandbox model name.
example: "Qwen/Qwen3.5-27B"
sandbox_id:
type: string
description: Sandbox ID to use when `model_name` is a self-hosted model.
example: "bx-123abc"
example: "gpt-4"
max_tokens:
type: integer
example: 500
temperature:
type: number
example: 0.7
model_config:
type: object
description: Additional self-hosted model configuration.
additionalProperties: true
callback_url:
type: string
example: "https://webhook.example.com/callback"
oneOf:
- required:
- prompt
- required:
- prompt_url
responses:
'200':
description: Text generation started or completed
Expand Down Expand Up @@ -5677,4 +5602,4 @@ tags:
- name: Transcode
description: Media transcoding operations
- name: Assets
description: Cross-collection asset listing
description: Cross-collection asset listing
12 changes: 0 additions & 12 deletions videodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@
ReframeMode,
SegmentationType,
RTStreamChannelType,
SandboxTier,
SandboxStatus,
)
from videodb.client import Connection
from videodb.search import AskResponse, SearchResponse, SearchResult
from videodb.understanding import Understanding, UnderstandingAnalyzer
from videodb.job import GenerationJob
from videodb.sandbox import Sandbox
from videodb.sandbox_models import SandboxModel
from videodb.voice_clone import VoiceClone
from videodb.capture_session import CaptureSession
from videodb.websocket_client import WebSocketConnection
from videodb.capture import CaptureClient, Channel, AudioChannel, VideoChannel, Channels, ChannelList
Expand All @@ -52,10 +46,6 @@
__all__ = [
"connect",
"CaptureSession",
"GenerationJob",
"Sandbox",
"SandboxModel",
"VoiceClone",
"WebSocketConnection",
"CaptureClient",
"Channel",
Expand Down Expand Up @@ -92,8 +82,6 @@
"ReframeMode",
"SegmentationType",
"RTStreamChannelType",
"SandboxTier",
"SandboxStatus",
]


Expand Down
27 changes: 0 additions & 27 deletions videodb/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,36 +140,11 @@ class ApiPath:
token = "token"
websocket = "websocket"
export = "export"
job = "job"
sandbox = "sandbox"
voice_clone = "voice_clone"
understand = "understand"
indexes = "indexes"
identities = "identities"
merge = "merge"
split = "split"
async_response = "async-response"



class Status:
processing = "processing"
in_progress = "in progress"
complete = "complete"


class SandboxTier:
small = "small"
medium = "medium"


class SandboxStatus:
provisioning = "provisioning"
active = "active"
stopping = "stopping"
stopped = "stopped"
failed = "failed"
alert = "alert"


class MeetingStatus:
Expand All @@ -184,8 +159,6 @@ class HttpClientDefaultValues:
timeout = 30
backoff_factor = 0.1
status_forcelist = [502, 503, 504]
max_poll_time = 500
poll_interval = 5


class MaxSupported:
Expand Down
48 changes: 13 additions & 35 deletions videodb/_upload.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
from typing import Optional, Union
from urllib.parse import urlparse

import requests

from typing import Optional
from urllib.parse import urlparse
from requests import HTTPError
import os


from videodb._constants import (
Expand All @@ -20,31 +20,6 @@ def _is_url(path: str) -> bool:
return all([parsed.scheme in ("http", "https"), parsed.netloc])


def upload_bytes(
_connection,
content: Union[str, bytes],
name: str,
content_type: str = "application/octet-stream",
collection_id: Optional[str] = None,
) -> str:
"""Upload in-memory content using a presigned upload URL and return the object URL."""
collection_id = collection_id or _connection.collection_id
upload_url_data = _connection.get(
path=f"{ApiPath.collection}/{collection_id}/{ApiPath.upload_url}",
params={"name": name},
)
upload_url = upload_url_data.get("upload_url")

try:
files = {"file": (name, content, content_type)}
response = requests.post(upload_url, files=files)
response.raise_for_status()
except requests.exceptions.RequestException as e:
raise VideodbError("Error while uploading content", cause=e)

return upload_url


def upload(
_connection,
source: Optional[str] = None,
Expand Down Expand Up @@ -96,13 +71,16 @@ def upload(
if file_path:
try:
name = os.path.splitext(os.path.basename(file_path))[0] if not name else name
upload_url_data = _connection.get(
path=f"{ApiPath.collection}/{collection_id}/{ApiPath.upload_url}",
params={"name": name},
)
upload_url = upload_url_data.get("upload_url")
with open(file_path, "rb") as file:
url = upload_bytes(
_connection=_connection,
content=file,
name=name,
collection_id=collection_id,
)
files = {"file": (name, file)}
response = requests.post(upload_url, files=files)
response.raise_for_status()
url = upload_url

except FileNotFoundError as e:
raise VideodbError("File not found", cause=e)
Expand Down
Loading