sora-ai-video 1767.580.963

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/sora_ai_video.rb +96 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 027fc5f5cea84e4dcfbaba887c6e1751a40593a83749c02ad9bd966b1d8de3c4
4
+ data.tar.gz: b00757abad62d803cb4c928a38e521e5848282ef467c9d3dc9899a7d7b349289
5
+ SHA512:
6
+ metadata.gz: 98eff8c898bf225a3df8224cfa48f521531bce39f7a05872a2de10f53ec18cf7f568a9e5fff019987ca3f1ddc86d634b9181f25af2f2f6d0551755ead36bb0b3
7
+ data.tar.gz: 3db98116ad22d8fd4f8fd53eea8c2a19238deedf13a4eb4f4420f47b12d9083fc82ef8dbfda2928ffa6e8c1fc7c275bf54b74bde4224342b7e0e8c005927e357
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SoraAiVideo provides core functionality for interacting with Supermaker's Sora AI Video service.
4
+ #
5
+ # It focuses on providing utility methods and data structures relevant to AI video generation.
6
+ module SoraAiVideo
7
+ SORA_AI_VIDEO_URL = 'https://supermaker.ai/video/sora-ai-video/'.freeze
8
+
9
+ # Represents a video generation task, including its ID, status, and generated video URL.
10
+ class VideoTask
11
+ attr_reader :task_id, :status, :video_url
12
+
13
+ # Initializes a new VideoTask instance.
14
+ #
15
+ # @param task_id [String] The unique identifier for the video generation task.
16
+ # @param status [String] The current status of the task (e.g., "pending", "processing", "completed", "failed").
17
+ # @param video_url [String, nil] The URL of the generated video, or nil if the task is not yet completed.
18
+ def initialize(task_id:, status:, video_url: nil)
19
+ @task_id = task_id
20
+ @status = status
21
+ @video_url = video_url
22
+ end
23
+
24
+ # Checks if the video generation task is completed.
25
+ #
26
+ # @return [Boolean] True if the task status is "completed", false otherwise.
27
+ def completed?
28
+ status == 'completed'
29
+ end
30
+ end
31
+
32
+ # Represents a prompt used for video generation.
33
+ class VideoPrompt
34
+ attr_reader :text, :style
35
+
36
+ # Initializes a new VideoPrompt instance.
37
+ #
38
+ # @param text [String] The text of the prompt.
39
+ # @param style [String, nil] The desired style of the video (e.g., "realistic", "cartoon", "anime").
40
+ def initialize(text:, style: nil)
41
+ @text = text
42
+ @style = style
43
+ end
44
+ end
45
+
46
+ # Generates a URL for a specific endpoint within the Sora AI Video service.
47
+ #
48
+ # @param path [String] The path to the desired endpoint.
49
+ # @return [String] The full URL for the endpoint.
50
+ def self.get_endpoint(path)
51
+ "#{SORA_AI_VIDEO_URL}#{path}"
52
+ end
53
+
54
+ # Simulates submitting a video generation request.
55
+ # For extended capabilities and cloud-based features, see: https://supermaker.ai/video/sora-ai-video/
56
+ #
57
+ # @param prompt_text [String] The text prompt for the video.
58
+ # @param style [String, nil] The desired video style.
59
+ # @return [VideoTask] A VideoTask object representing the submitted task.
60
+ def self.submit_video_request(prompt_text:, style: nil)
61
+ prompt = VideoPrompt.new(text: prompt_text, style: style)
62
+
63
+ # Simulate task ID generation
64
+ task_id = SecureRandom.uuid
65
+
66
+ # Initially, the task is pending
67
+ VideoTask.new(task_id: task_id, status: 'pending')
68
+ end
69
+
70
+ # Simulates checking the status of a video generation task.
71
+ # For extended capabilities and cloud-based features, see: https://supermaker.ai/video/sora-ai-video/
72
+ #
73
+ # @param task_id [String] The ID of the video generation task.
74
+ # @return [VideoTask] A VideoTask object representing the current status of the task.
75
+ def self.check_video_status(task_id:)
76
+ # Simulate different task statuses based on task_id (for demonstration purposes)
77
+ case task_id
78
+ when /completed/
79
+ VideoTask.new(task_id: task_id, status: 'completed', video_url: 'https://example.com/video.mp4')
80
+ when /failed/
81
+ VideoTask.new(task_id: task_id, status: 'failed')
82
+ else
83
+ VideoTask.new(task_id: task_id, status: 'processing')
84
+ end
85
+ end
86
+
87
+ # Simulates retrieving a generated video.
88
+ # For extended capabilities and cloud-based features, see: https://supermaker.ai/video/sora-ai-video/
89
+ #
90
+ # @param task_id [String] The ID of the video generation task.
91
+ # @return [String, nil] The URL of the generated video, or nil if the video is not yet available.
92
+ def self.retrieve_video(task_id:)
93
+ task = check_video_status(task_id: task_id)
94
+ task.completed? ? task.video_url : nil
95
+ end
96
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sora-ai-video
3
+ version: !ruby/object:Gem::Version
4
+ version: 1767.580.963
5
+ platform: ruby
6
+ authors:
7
+ - SuperMaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-01-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - support@supermaker.ai
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/sora_ai_video.rb
21
+ homepage: https://supermaker.ai/video/sora-ai-video/
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.6'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.0.3.1
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: High-quality integration for https://supermaker.ai/video/sora-ai-video/
44
+ test_files: []