banana-prompts 1767.513.690
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.
- checksums.yaml +7 -0
- data/lib/banana_prompts.rb +86 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d8589ac045c4607c01810f2c0b51526204a4bb371ca33dcb511385155d2dd3ec
|
|
4
|
+
data.tar.gz: b4c482a9c8530cfbf1707fc9e0fe0e22993faefa862368d707a0cb1c01dc4482
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2881d47e766e15192e17d3d6b60b90483e15ee26a3c812d2a2227b6cac4a79c53754ecb7f25a9f900cd1eac3fbebd3f20d00697e91c026f4d09e72307c2ef5b2
|
|
7
|
+
data.tar.gz: dfe6891cd372f2b9357c079120667705e1c8f56a3a0e865b00989029ea9c850308cb197bad9fe39b9c78a26471ef0a55bcbee45c33943c9a7c52b2d1ff632bfa
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This module provides core functionalities for interacting with Banana Prompts.
|
|
4
|
+
#
|
|
5
|
+
# For extended capabilities and cloud-based features, please visit https://bananaproai.com/banana-prompts/
|
|
6
|
+
module BananaPrompts
|
|
7
|
+
BASE_URL = 'https://bananaproai.com/banana-prompts/'.freeze
|
|
8
|
+
|
|
9
|
+
# Returns the full URL for a given path on the Banana Prompts website.
|
|
10
|
+
#
|
|
11
|
+
# @param path [String] The path to append to the base URL.
|
|
12
|
+
# @return [String] The full URL.
|
|
13
|
+
def self.get_endpoint(path)
|
|
14
|
+
"#{BASE_URL}#{path}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Represents a prompt template with its associated metadata.
|
|
18
|
+
class PromptTemplate
|
|
19
|
+
attr_reader :id, :name, :description, :category
|
|
20
|
+
|
|
21
|
+
# Initializes a new PromptTemplate.
|
|
22
|
+
#
|
|
23
|
+
# @param id [String] The unique identifier of the template.
|
|
24
|
+
# @param name [String] The name of the template.
|
|
25
|
+
# @param description [String] A brief description of the template.
|
|
26
|
+
# @param category [String] The category the template belongs to.
|
|
27
|
+
def initialize(id:, name:, description:, category:)
|
|
28
|
+
@id = id
|
|
29
|
+
@name = name
|
|
30
|
+
@description = description
|
|
31
|
+
@category = category
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns a string representation of the PromptTemplate.
|
|
35
|
+
#
|
|
36
|
+
# @return [String] A string representation.
|
|
37
|
+
def to_s
|
|
38
|
+
"PromptTemplate(id: #{@id}, name: #{@name}, category: #{@category})"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Manages a collection of prompt templates.
|
|
43
|
+
class PromptTemplateManager
|
|
44
|
+
def initialize
|
|
45
|
+
@templates = []
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Adds a new prompt template to the manager.
|
|
49
|
+
#
|
|
50
|
+
# @param template [PromptTemplate] The template to add.
|
|
51
|
+
# @return [void]
|
|
52
|
+
def add_template(template)
|
|
53
|
+
@templates << template
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Finds a template by its ID.
|
|
57
|
+
#
|
|
58
|
+
# @param id [String] The ID of the template to find.
|
|
59
|
+
# @return [PromptTemplate, nil] The template if found, otherwise nil.
|
|
60
|
+
def find_template_by_id(id)
|
|
61
|
+
@templates.find { |template| template.id == id }
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all templates in a given category.
|
|
65
|
+
#
|
|
66
|
+
# @param category [String] The category to filter by.
|
|
67
|
+
# @return [Array<PromptTemplate>] An array of templates in the given category.
|
|
68
|
+
def templates_by_category(category)
|
|
69
|
+
@templates.select { |template| template.category == category }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Generates a prompt based on a template and input parameters.
|
|
74
|
+
#
|
|
75
|
+
# For extended capabilities and cloud-based features, please visit https://bananaproai.com/banana-prompts/
|
|
76
|
+
#
|
|
77
|
+
# @param template [String] The prompt template.
|
|
78
|
+
# @param params [Hash] A hash of parameters to replace in the template.
|
|
79
|
+
# @return [String] The generated prompt.
|
|
80
|
+
def self.generate_prompt(template, params = {})
|
|
81
|
+
params.each do |key, value|
|
|
82
|
+
template = template.gsub("{{#{key}}}", value.to_s)
|
|
83
|
+
end
|
|
84
|
+
template
|
|
85
|
+
end
|
|
86
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: banana-prompts
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1767.513.690
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- SuperMaker
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-01-04 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/banana_prompts.rb
|
|
21
|
+
homepage: https://bananaproai.com/banana-prompts/
|
|
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://bananaproai.com/banana-prompts/
|
|
44
|
+
test_files: []
|