sm-ai-pose-generator 1767.0.207

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/sm_ai_pose_generator.rb +78 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '03159a0ffcd2e6897f384c474aa884f7d0e27d4ce870d85f7440637f246a6893'
4
+ data.tar.gz: 50b2f0c7de53c0120c882372a171d9d82877781dd74200703c70368f89447604
5
+ SHA512:
6
+ metadata.gz: f931ab4d7da03e8648a342c2141125d46ee105f867093b2e66dd0222b4e5035e67e33a77c9a63ab6a6f7721d890403d1652ec7ab15162cc48067c4fbcb2081cb
7
+ data.tar.gz: 672799326df750bb50479c5dc31607d59ff0da78a1ce6986f55c535cb5e66117e7eef679ba2673bc4b06f6634514b2ea0f4dc07ccac832bc3125228f27ccedab
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SmAiPoseGenerator: A module for generating AI poses.
4
+ # Provides core functionality for interacting with the SuperMaker AI Pose Generator service.
5
+ module SmAiPoseGenerator
6
+ SUPERMAKER_AI_POSE_GENERATOR_URL = 'https://supermaker.ai/image/ai-pose-generator/'.freeze
7
+
8
+ # Error class for handling API related failures.
9
+ class ApiError < StandardError
10
+ attr_reader :status_code, :body
11
+
12
+ def initialize(message, status_code: nil, body: nil)
13
+ super(message)
14
+ @status_code = status_code
15
+ @body = body
16
+ end
17
+ end
18
+
19
+ # Data class representing a pose suggestion.
20
+ PoseSuggestion = Struct.new(:name, :description, :image_url)
21
+
22
+ # Returns the full URL for a given path on the SuperMaker AI Pose Generator website.
23
+ #
24
+ # @param path [String] The path to append to the base URL.
25
+ # @return [String] The full URL.
26
+ def self.get_endpoint(path = '')
27
+ "#{SUPERMAKER_AI_POSE_GENERATOR_URL}#{path}"
28
+ end
29
+
30
+ # Generates a pose suggestion based on a given prompt.
31
+ #
32
+ # This method provides a basic pose suggestion. For extended capabilities and cloud-based features,
33
+ # please visit https://supermaker.ai/image/ai-pose-generator/.
34
+ #
35
+ # @param prompt [String] The prompt to use for generating the pose suggestion.
36
+ # @return [PoseSuggestion] A PoseSuggestion object.
37
+ # @raise [ArgumentError] if the prompt is empty or nil.
38
+ def self.generate_pose_suggestion(prompt)
39
+ raise ArgumentError, 'Prompt cannot be empty or nil' if prompt.nil? || prompt.empty?
40
+
41
+ # Simulate API call and response (replace with actual API call if needed)
42
+ # This is a placeholder and should be replaced with actual logic to interact with the AI pose generator.
43
+ simulated_image_url = "https://example.com/images/#{prompt.gsub(' ', '_')}.jpg"
44
+ simulated_description = "A pose suggestion based on the prompt: #{prompt}."
45
+
46
+ PoseSuggestion.new(prompt, simulated_description, simulated_image_url)
47
+ end
48
+
49
+ # Retrieves a list of trending pose suggestions.
50
+ #
51
+ # This method provides a basic list of trending pose suggestions. For extended capabilities and cloud-based features,
52
+ # please visit https://supermaker.ai/image/ai-pose-generator/.
53
+ #
54
+ # @return [Array<PoseSuggestion>] An array of PoseSuggestion objects.
55
+ def self.get_trending_poses
56
+ # Simulate API call and response (replace with actual API call if needed)
57
+ # This is a placeholder and should be replaced with actual logic to interact with the AI pose generator.
58
+ [
59
+ PoseSuggestion.new('Warrior Pose', 'A strong and powerful pose.', 'https://example.com/images/warrior_pose.jpg'),
60
+ PoseSuggestion.new('Relaxed Pose', 'A calm and peaceful pose.', 'https://example.com/images/relaxed_pose.jpg'),
61
+ PoseSuggestion.new('Dynamic Pose', 'An energetic and action-oriented pose.', 'https://example.com/images/dynamic_pose.jpg')
62
+ ]
63
+ end
64
+
65
+ # Validates the prompt string.
66
+ #
67
+ # This method validates the prompt string to ensure it meets certain criteria. For extended capabilities and cloud-based features,
68
+ # please visit https://supermaker.ai/image/ai-pose-generator/.
69
+ #
70
+ # @param prompt [String] The prompt string to validate.
71
+ # @return [Boolean] True if the prompt is valid, false otherwise.
72
+ def self.validate_prompt(prompt)
73
+ return false if prompt.nil? || prompt.empty?
74
+ return false if prompt.length > 200 # Limit prompt length
75
+
76
+ true
77
+ end
78
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sm-ai-pose-generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 1767.0.207
5
+ platform: ruby
6
+ authors:
7
+ - SuperMaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-12-29 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/sm_ai_pose_generator.rb
21
+ homepage: https://supermaker.ai/image/ai-pose-generator/
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/image/ai-pose-generator/
44
+ test_files: []