ruby_conversations 1.1.7 → 1.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ebb363ba1641264fc3c57b883c1d7419db801343e1d8463eb8158887f31ae7e
4
- data.tar.gz: fa041b97787b8bc6dbe318edeb547f86fff198ebae3d3632c9b8f1a9311b0ae0
3
+ metadata.gz: d129588d8e1b65ea298915ffb01f98b8b1812e45648809da7c167e98bc437192
4
+ data.tar.gz: 0ae23b78f5c1f4fb861330f4c78cc2e2eabfbe3fc9a302225d345992379ada35
5
5
  SHA512:
6
- metadata.gz: 06e4c6c77049cda35384763920f278869ddfdd2e93eb2e7ed660c25686ebbd10407b96c9da37bbfb9f36186da0a75c53845a6eee85b06cd0ded8ba513c231d9d
7
- data.tar.gz: 47fe53756c3312e24d1b9396c8c102bd79aebc7244b6547397345fb7e9b276d070150d07224bfac11e63223ffa4297c066b015566172650a44835f17c9758419
6
+ metadata.gz: e838911c1eba0ac7bc2f5fe744830f38235708f0be905c491cf494011ba6f2aba74de9a778391c14303fdb5f03dbdce404489b703c9c8ab32ea2dbd6d25cd4e0
7
+ data.tar.gz: 3fdc3546c60c434bdc2aba30200c4c5d4c7ae7d28285dc98fe09150bfbd063fc5742d9f166f34a520e67a41bd03b6570e880a85301cba4a2cedee9187b142db4
@@ -20,6 +20,22 @@ module RubyConversations
20
20
  extract_template_metadata(template_data)
21
21
  end
22
22
 
23
+ # Fetch metadata for all available templates
24
+ # @return [Array<Hash>] Array of template metadata including fields and UI configuration
25
+ def all_templates
26
+ begin
27
+ templates_data = RubyConversations.client.fetch_all_conversation_templates
28
+ rescue RubyConversations::ClientError => e
29
+ raise RubyConversations::TemplateNotFoundError, 'Failed to fetch templates' if e.status_code == 404
30
+
31
+ raise e
32
+ end
33
+
34
+ return [] unless templates_data.is_a?(Array)
35
+
36
+ templates_data.map { |template_data| extract_template_metadata(template_data) }.compact
37
+ end
38
+
23
39
  private
24
40
 
25
41
  def extract_template_metadata(template_data)
@@ -68,6 +68,13 @@ module RubyConversations
68
68
  handle_response(response)
69
69
  end
70
70
 
71
+ # Fetch all available conversation templates
72
+ # @return [Array<Hash>] Array of template data including messages and prompts
73
+ def fetch_all_conversation_templates
74
+ response = client.get('api/ai_conversations')
75
+ handle_response(response)
76
+ end
77
+
71
78
  # Fetch a prompt by name
72
79
  # @param name [String] The name of the prompt to fetch
73
80
  # @return [Hash] The prompt attributes
@@ -3,7 +3,7 @@
3
3
  module RubyConversations
4
4
  MAJOR = 1
5
5
  MINOR = 1
6
- PATCH = 7
6
+ PATCH = 8
7
7
 
8
8
  VERSION = "#{RubyConversations::MAJOR}.#{RubyConversations::MINOR}.#{RubyConversations::PATCH}".freeze
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_conversations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Shippy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-28 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport