sz-apimatic-sdk 0.0.1

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 (95) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +153 -0
  4. data/bin/console +15 -0
  5. data/lib/seltz_api/api_helper.rb +10 -0
  6. data/lib/seltz_api/apis/agent_api.rb +140 -0
  7. data/lib/seltz_api/apis/answer_api.rb +61 -0
  8. data/lib/seltz_api/apis/base_api.rb +67 -0
  9. data/lib/seltz_api/apis/fetch_api.rb +48 -0
  10. data/lib/seltz_api/apis/monitors_api.rb +161 -0
  11. data/lib/seltz_api/apis/records_api.rb +97 -0
  12. data/lib/seltz_api/apis/runs_api.rb +109 -0
  13. data/lib/seltz_api/apis/search_api.rb +55 -0
  14. data/lib/seltz_api/client.rb +111 -0
  15. data/lib/seltz_api/configuration.rb +165 -0
  16. data/lib/seltz_api/exceptions/api_exception.rb +21 -0
  17. data/lib/seltz_api/exceptions/error_envelope_exception.rb +46 -0
  18. data/lib/seltz_api/http/api_response.rb +19 -0
  19. data/lib/seltz_api/http/auth/custom_header_authentication.rb +52 -0
  20. data/lib/seltz_api/http/http_call_back.rb +10 -0
  21. data/lib/seltz_api/http/http_method_enum.rb +10 -0
  22. data/lib/seltz_api/http/http_request.rb +10 -0
  23. data/lib/seltz_api/http/http_response.rb +10 -0
  24. data/lib/seltz_api/http/proxy_settings.rb +22 -0
  25. data/lib/seltz_api/logging/configuration/api_logging_configuration.rb +186 -0
  26. data/lib/seltz_api/logging/sdk_logger.rb +17 -0
  27. data/lib/seltz_api/models/agent_run.rb +161 -0
  28. data/lib/seltz_api/models/agent_run_citation.rb +85 -0
  29. data/lib/seltz_api/models/agent_run_grounding.rb +94 -0
  30. data/lib/seltz_api/models/agent_run_output.rb +131 -0
  31. data/lib/seltz_api/models/agent_run_output2.rb +131 -0
  32. data/lib/seltz_api/models/agent_run_request.rb +100 -0
  33. data/lib/seltz_api/models/agent_run_request2.rb +100 -0
  34. data/lib/seltz_api/models/agent_run_source.rb +86 -0
  35. data/lib/seltz_api/models/agent_run_status.rb +49 -0
  36. data/lib/seltz_api/models/agent_run_status2.rb +48 -0
  37. data/lib/seltz_api/models/agent_run_stop_reason.rb +53 -0
  38. data/lib/seltz_api/models/agent_run_stop_reason2.rb +52 -0
  39. data/lib/seltz_api/models/answer_http_request.rb +172 -0
  40. data/lib/seltz_api/models/answer_http_response.rb +93 -0
  41. data/lib/seltz_api/models/base_model.rb +110 -0
  42. data/lib/seltz_api/models/content_options.rb +99 -0
  43. data/lib/seltz_api/models/create_agent_run_request.rb +104 -0
  44. data/lib/seltz_api/models/create_monitor_request.rb +143 -0
  45. data/lib/seltz_api/models/create_monitor_response.rb +90 -0
  46. data/lib/seltz_api/models/document.rb +128 -0
  47. data/lib/seltz_api/models/envelope_error.rb +83 -0
  48. data/lib/seltz_api/models/envelope_error1.rb +82 -0
  49. data/lib/seltz_api/models/fetch_error.rb +107 -0
  50. data/lib/seltz_api/models/fetch_error1.rb +108 -0
  51. data/lib/seltz_api/models/fetch_request.rb +144 -0
  52. data/lib/seltz_api/models/fetch_response.rb +87 -0
  53. data/lib/seltz_api/models/fetch_result.rb +176 -0
  54. data/lib/seltz_api/models/fetch_status.rb +36 -0
  55. data/lib/seltz_api/models/fetch_status2.rb +40 -0
  56. data/lib/seltz_api/models/fields.rb +108 -0
  57. data/lib/seltz_api/models/fields2.rb +101 -0
  58. data/lib/seltz_api/models/get_monitor_response.rb +87 -0
  59. data/lib/seltz_api/models/get_run_response.rb +76 -0
  60. data/lib/seltz_api/models/http_citation.rb +86 -0
  61. data/lib/seltz_api/models/list_agent_runs_response.rb +96 -0
  62. data/lib/seltz_api/models/list_monitors_response.rb +97 -0
  63. data/lib/seltz_api/models/list_records_response.rb +96 -0
  64. data/lib/seltz_api/models/list_run_records_response.rb +96 -0
  65. data/lib/seltz_api/models/list_run_requests_response.rb +84 -0
  66. data/lib/seltz_api/models/list_runs_response.rb +96 -0
  67. data/lib/seltz_api/models/monitor.rb +157 -0
  68. data/lib/seltz_api/models/monitor_search_request.rb +110 -0
  69. data/lib/seltz_api/models/monitor_status.rb +47 -0
  70. data/lib/seltz_api/models/monitor_status2.rb +45 -0
  71. data/lib/seltz_api/models/payload.rb +74 -0
  72. data/lib/seltz_api/models/record.rb +116 -0
  73. data/lib/seltz_api/models/record_type.rb +26 -0
  74. data/lib/seltz_api/models/request_status.rb +36 -0
  75. data/lib/seltz_api/models/run.rb +200 -0
  76. data/lib/seltz_api/models/run_request.rb +127 -0
  77. data/lib/seltz_api/models/run_state.rb +40 -0
  78. data/lib/seltz_api/models/run_state2.rb +41 -0
  79. data/lib/seltz_api/models/run_status.rb +47 -0
  80. data/lib/seltz_api/models/schedule.rb +73 -0
  81. data/lib/seltz_api/models/search_record.rb +101 -0
  82. data/lib/seltz_api/models/search_request.rb +208 -0
  83. data/lib/seltz_api/models/search_request_ref.rb +87 -0
  84. data/lib/seltz_api/models/search_response.rb +85 -0
  85. data/lib/seltz_api/models/snippet.rb +76 -0
  86. data/lib/seltz_api/models/snippet_options.rb +151 -0
  87. data/lib/seltz_api/models/update_monitor_request.rb +153 -0
  88. data/lib/seltz_api/models/update_monitor_response.rb +77 -0
  89. data/lib/seltz_api/models/webhook.rb +113 -0
  90. data/lib/seltz_api/models/webhook1.rb +114 -0
  91. data/lib/seltz_api/utilities/date_time_helper.rb +11 -0
  92. data/lib/seltz_api/utilities/file_wrapper.rb +28 -0
  93. data/lib/seltz_api/utilities/union_type_lookup.rb +62 -0
  94. data/lib/seltz_api.rb +115 -0
  95. metadata +178 -0
@@ -0,0 +1,161 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # An agent run.
8
+ class AgentRun < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # When the run reached a terminal state. Unset until then.
13
+ # @return [String]
14
+ attr_accessor :completed_at
15
+
16
+ # When the run was created, as an ISO 8601 timestamp.
17
+ # @return [String]
18
+ attr_accessor :created_at
19
+
20
+ # Unique run id.
21
+ # @return [String]
22
+ attr_accessor :id
23
+
24
+ # Object type, always "agent.run".
25
+ # @return [String]
26
+ attr_accessor :object
27
+
28
+ # Object type, always "agent.run".
29
+ # @return [AgentRunOutput2]
30
+ attr_accessor :output
31
+
32
+ # Object type, always "agent.run".
33
+ # @return [AgentRunRequest2]
34
+ attr_accessor :request
35
+
36
+ # When the run started. Unset while pending.
37
+ # @return [String]
38
+ attr_accessor :started_at
39
+
40
+ # When the run started. Unset while pending.
41
+ # @return [AgentRunStatus2]
42
+ attr_accessor :status
43
+
44
+ # When the run started. Unset while pending.
45
+ # @return [AgentRunStopReason2]
46
+ attr_accessor :stop_reason
47
+
48
+ # A mapping from model property names to API property names.
49
+ def self.names
50
+ @_hash = {} if @_hash.nil?
51
+ @_hash['completed_at'] = 'completed_at'
52
+ @_hash['created_at'] = 'created_at'
53
+ @_hash['id'] = 'id'
54
+ @_hash['object'] = 'object'
55
+ @_hash['output'] = 'output'
56
+ @_hash['request'] = 'request'
57
+ @_hash['started_at'] = 'started_at'
58
+ @_hash['status'] = 'status'
59
+ @_hash['stop_reason'] = 'stop_reason'
60
+ @_hash
61
+ end
62
+
63
+ # An array for optional fields
64
+ def self.optionals
65
+ %w[
66
+ completed_at
67
+ created_at
68
+ id
69
+ object
70
+ output
71
+ request
72
+ started_at
73
+ status
74
+ stop_reason
75
+ ]
76
+ end
77
+
78
+ # An array for nullable fields
79
+ def self.nullables
80
+ %w[
81
+ completed_at
82
+ output
83
+ request
84
+ started_at
85
+ stop_reason
86
+ ]
87
+ end
88
+
89
+ def initialize(completed_at: SKIP, created_at: SKIP, id: SKIP, object: SKIP,
90
+ output: SKIP, request: SKIP, started_at: SKIP,
91
+ status: AgentRunStatus2::PENDING, stop_reason: SKIP,
92
+ additional_properties: nil)
93
+ # Add additional model properties to the instance
94
+ additional_properties = {} if additional_properties.nil?
95
+
96
+ @completed_at = completed_at unless completed_at == SKIP
97
+ @created_at = created_at unless created_at == SKIP
98
+ @id = id unless id == SKIP
99
+ @object = object unless object == SKIP
100
+ @output = output unless output == SKIP
101
+ @request = request unless request == SKIP
102
+ @started_at = started_at unless started_at == SKIP
103
+ @status = status unless status == SKIP
104
+ @stop_reason = stop_reason unless stop_reason == SKIP
105
+ @additional_properties = additional_properties
106
+ end
107
+
108
+ # Creates an instance of the object from a hash.
109
+ def self.from_hash(hash)
110
+ return nil unless hash
111
+
112
+ # Extract variables from the hash.
113
+ completed_at = hash.key?('completed_at') ? hash['completed_at'] : SKIP
114
+ created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
115
+ id = hash.key?('id') ? hash['id'] : SKIP
116
+ object = hash.key?('object') ? hash['object'] : SKIP
117
+ output = AgentRunOutput2.from_hash(hash['output']) if hash['output']
118
+ request = AgentRunRequest2.from_hash(hash['request']) if hash['request']
119
+ started_at = hash.key?('started_at') ? hash['started_at'] : SKIP
120
+ status = hash['status'] ||= AgentRunStatus2::PENDING
121
+ stop_reason = hash.key?('stop_reason') ? hash['stop_reason'] : SKIP
122
+
123
+ # Create a new hash for additional properties, removing known properties.
124
+ new_hash = hash.reject { |k, _| names.value?(k) }
125
+
126
+ additional_properties = APIHelper.get_additional_properties(
127
+ new_hash, proc { |value| value }
128
+ )
129
+
130
+ # Create object from extracted values.
131
+ AgentRun.new(completed_at: completed_at,
132
+ created_at: created_at,
133
+ id: id,
134
+ object: object,
135
+ output: output,
136
+ request: request,
137
+ started_at: started_at,
138
+ status: status,
139
+ stop_reason: stop_reason,
140
+ additional_properties: additional_properties)
141
+ end
142
+
143
+ # Provides a human-readable string representation of the object.
144
+ def to_s
145
+ class_name = self.class.name.split('::').last
146
+ "<#{class_name} completed_at: #{@completed_at}, created_at: #{@created_at}, id: #{@id},"\
147
+ " object: #{@object}, output: #{@output}, request: #{@request}, started_at: #{@started_at},"\
148
+ " status: #{@status}, stop_reason: #{@stop_reason}, additional_properties:"\
149
+ " #{@additional_properties}>"
150
+ end
151
+
152
+ # Provides a debugging-friendly string with detailed object information.
153
+ def inspect
154
+ class_name = self.class.name.split('::').last
155
+ "<#{class_name} completed_at: #{@completed_at.inspect}, created_at: #{@created_at.inspect},"\
156
+ " id: #{@id.inspect}, object: #{@object.inspect}, output: #{@output.inspect}, request:"\
157
+ " #{@request.inspect}, started_at: #{@started_at.inspect}, status: #{@status.inspect},"\
158
+ " stop_reason: #{@stop_reason.inspect}, additional_properties: #{@additional_properties}>"
159
+ end
160
+ end
161
+ end
@@ -0,0 +1,85 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # One citation supporting a grounded field.
8
+ class AgentRunCitation < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # `id` of the entry in `sources` this citation points at.
13
+ # @return [Integer]
14
+ attr_accessor :source_id
15
+
16
+ # URL of the cited document.
17
+ # @return [String]
18
+ attr_accessor :url
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['source_id'] = 'source_id'
24
+ @_hash['url'] = 'url'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ source_id
32
+ url
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(source_id: 0, url: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @source_id = source_id unless source_id == SKIP
46
+ @url = url unless url == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ source_id = hash['source_id'] ||= 0
56
+ url = hash.key?('url') ? hash['url'] : SKIP
57
+
58
+ # Create a new hash for additional properties, removing known properties.
59
+ new_hash = hash.reject { |k, _| names.value?(k) }
60
+
61
+ additional_properties = APIHelper.get_additional_properties(
62
+ new_hash, proc { |value| value }
63
+ )
64
+
65
+ # Create object from extracted values.
66
+ AgentRunCitation.new(source_id: source_id,
67
+ url: url,
68
+ additional_properties: additional_properties)
69
+ end
70
+
71
+ # Provides a human-readable string representation of the object.
72
+ def to_s
73
+ class_name = self.class.name.split('::').last
74
+ "<#{class_name} source_id: #{@source_id}, url: #{@url}, additional_properties:"\
75
+ " #{@additional_properties}>"
76
+ end
77
+
78
+ # Provides a debugging-friendly string with detailed object information.
79
+ def inspect
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} source_id: #{@source_id.inspect}, url: #{@url.inspect},"\
82
+ " additional_properties: #{@additional_properties}>"
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,94 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Citations for one field of `output.structured`.
8
+ class AgentRunGrounding < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Citations supporting this field's value.
13
+ # @return [Array[AgentRunCitation]]
14
+ attr_accessor :citations
15
+
16
+ # Dot-notation path into the structured output, e.g. "companies.0.ceo".
17
+ # @return [String]
18
+ attr_accessor :field
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['citations'] = 'citations'
24
+ @_hash['field'] = 'field'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ citations
32
+ field
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(citations: SKIP, field: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @citations = citations unless citations == SKIP
46
+ @field = field unless field == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ # Parameter is an array, so we need to iterate through it
56
+ citations = nil
57
+ unless hash['citations'].nil?
58
+ citations = []
59
+ hash['citations'].each do |structure|
60
+ citations << (AgentRunCitation.from_hash(structure) if structure)
61
+ end
62
+ end
63
+
64
+ citations = SKIP unless hash.key?('citations')
65
+ field = hash.key?('field') ? hash['field'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ AgentRunGrounding.new(citations: citations,
76
+ field: field,
77
+ additional_properties: additional_properties)
78
+ end
79
+
80
+ # Provides a human-readable string representation of the object.
81
+ def to_s
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} citations: #{@citations}, field: #{@field}, additional_properties:"\
84
+ " #{@additional_properties}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} citations: #{@citations.inspect}, field: #{@field.inspect},"\
91
+ " additional_properties: #{@additional_properties}>"
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,131 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # A run's output.
8
+ class AgentRunOutput < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Per-field citations for `structured`. Empty when there is no structured
13
+ # output.
14
+ # @return [Array[AgentRunGrounding]]
15
+ attr_accessor :grounding
16
+
17
+ # The sources cited by `text` or `grounding`, numbered in order of first
18
+ # citation.
19
+ # @return [Array[AgentRunSource]]
20
+ attr_accessor :sources
21
+
22
+ # Structured result shaped by the request's `output_schema`. Unset when the
23
+ # request had none. Fields that could not be grounded are expected to be
24
+ # null. On gRPC the object is JSON-encoded.
25
+ # @return [Object]
26
+ attr_accessor :structured
27
+
28
+ # Cited markdown report. Inline `\[n\]` markers cite the entry of `sources`
29
+ # whose `id` is `n`.
30
+ # @return [String]
31
+ attr_accessor :text
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['grounding'] = 'grounding'
37
+ @_hash['sources'] = 'sources'
38
+ @_hash['structured'] = 'structured'
39
+ @_hash['text'] = 'text'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ grounding
47
+ sources
48
+ structured
49
+ text
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ %w[
56
+ structured
57
+ text
58
+ ]
59
+ end
60
+
61
+ def initialize(grounding: SKIP, sources: SKIP, structured: SKIP, text: SKIP,
62
+ additional_properties: nil)
63
+ # Add additional model properties to the instance
64
+ additional_properties = {} if additional_properties.nil?
65
+
66
+ @grounding = grounding unless grounding == SKIP
67
+ @sources = sources unless sources == SKIP
68
+ @structured = structured unless structured == SKIP
69
+ @text = text unless text == SKIP
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ # Parameter is an array, so we need to iterate through it
79
+ grounding = nil
80
+ unless hash['grounding'].nil?
81
+ grounding = []
82
+ hash['grounding'].each do |structure|
83
+ grounding << (AgentRunGrounding.from_hash(structure) if structure)
84
+ end
85
+ end
86
+
87
+ grounding = SKIP unless hash.key?('grounding')
88
+ # Parameter is an array, so we need to iterate through it
89
+ sources = nil
90
+ unless hash['sources'].nil?
91
+ sources = []
92
+ hash['sources'].each do |structure|
93
+ sources << (AgentRunSource.from_hash(structure) if structure)
94
+ end
95
+ end
96
+
97
+ sources = SKIP unless hash.key?('sources')
98
+ structured = hash.key?('structured') ? hash['structured'] : SKIP
99
+ text = hash.key?('text') ? hash['text'] : SKIP
100
+
101
+ # Create a new hash for additional properties, removing known properties.
102
+ new_hash = hash.reject { |k, _| names.value?(k) }
103
+
104
+ additional_properties = APIHelper.get_additional_properties(
105
+ new_hash, proc { |value| value }
106
+ )
107
+
108
+ # Create object from extracted values.
109
+ AgentRunOutput.new(grounding: grounding,
110
+ sources: sources,
111
+ structured: structured,
112
+ text: text,
113
+ additional_properties: additional_properties)
114
+ end
115
+
116
+ # Provides a human-readable string representation of the object.
117
+ def to_s
118
+ class_name = self.class.name.split('::').last
119
+ "<#{class_name} grounding: #{@grounding}, sources: #{@sources}, structured: #{@structured},"\
120
+ " text: #{@text}, additional_properties: #{@additional_properties}>"
121
+ end
122
+
123
+ # Provides a debugging-friendly string with detailed object information.
124
+ def inspect
125
+ class_name = self.class.name.split('::').last
126
+ "<#{class_name} grounding: #{@grounding.inspect}, sources: #{@sources.inspect}, structured:"\
127
+ " #{@structured.inspect}, text: #{@text.inspect}, additional_properties:"\
128
+ " #{@additional_properties}>"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,131 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # The run's output. Its members are unset until the run completes.
8
+ class AgentRunOutput2 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Per-field citations for `structured`. Empty when there is no structured
13
+ # output.
14
+ # @return [Array[AgentRunGrounding]]
15
+ attr_accessor :grounding
16
+
17
+ # The sources cited by `text` or `grounding`, numbered in order of first
18
+ # citation.
19
+ # @return [Array[AgentRunSource]]
20
+ attr_accessor :sources
21
+
22
+ # Structured result shaped by the request's `output_schema`. Unset when the
23
+ # request had none. Fields that could not be grounded are expected to be
24
+ # null. On gRPC the object is JSON-encoded.
25
+ # @return [Object]
26
+ attr_accessor :structured
27
+
28
+ # Cited markdown report. Inline `\[n\]` markers cite the entry of `sources`
29
+ # whose `id` is `n`.
30
+ # @return [String]
31
+ attr_accessor :text
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['grounding'] = 'grounding'
37
+ @_hash['sources'] = 'sources'
38
+ @_hash['structured'] = 'structured'
39
+ @_hash['text'] = 'text'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ grounding
47
+ sources
48
+ structured
49
+ text
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ %w[
56
+ structured
57
+ text
58
+ ]
59
+ end
60
+
61
+ def initialize(grounding: SKIP, sources: SKIP, structured: SKIP, text: SKIP,
62
+ additional_properties: nil)
63
+ # Add additional model properties to the instance
64
+ additional_properties = {} if additional_properties.nil?
65
+
66
+ @grounding = grounding unless grounding == SKIP
67
+ @sources = sources unless sources == SKIP
68
+ @structured = structured unless structured == SKIP
69
+ @text = text unless text == SKIP
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ # Parameter is an array, so we need to iterate through it
79
+ grounding = nil
80
+ unless hash['grounding'].nil?
81
+ grounding = []
82
+ hash['grounding'].each do |structure|
83
+ grounding << (AgentRunGrounding.from_hash(structure) if structure)
84
+ end
85
+ end
86
+
87
+ grounding = SKIP unless hash.key?('grounding')
88
+ # Parameter is an array, so we need to iterate through it
89
+ sources = nil
90
+ unless hash['sources'].nil?
91
+ sources = []
92
+ hash['sources'].each do |structure|
93
+ sources << (AgentRunSource.from_hash(structure) if structure)
94
+ end
95
+ end
96
+
97
+ sources = SKIP unless hash.key?('sources')
98
+ structured = hash.key?('structured') ? hash['structured'] : SKIP
99
+ text = hash.key?('text') ? hash['text'] : SKIP
100
+
101
+ # Create a new hash for additional properties, removing known properties.
102
+ new_hash = hash.reject { |k, _| names.value?(k) }
103
+
104
+ additional_properties = APIHelper.get_additional_properties(
105
+ new_hash, proc { |value| value }
106
+ )
107
+
108
+ # Create object from extracted values.
109
+ AgentRunOutput2.new(grounding: grounding,
110
+ sources: sources,
111
+ structured: structured,
112
+ text: text,
113
+ additional_properties: additional_properties)
114
+ end
115
+
116
+ # Provides a human-readable string representation of the object.
117
+ def to_s
118
+ class_name = self.class.name.split('::').last
119
+ "<#{class_name} grounding: #{@grounding}, sources: #{@sources}, structured: #{@structured},"\
120
+ " text: #{@text}, additional_properties: #{@additional_properties}>"
121
+ end
122
+
123
+ # Provides a debugging-friendly string with detailed object information.
124
+ def inspect
125
+ class_name = self.class.name.split('::').last
126
+ "<#{class_name} grounding: #{@grounding.inspect}, sources: #{@sources.inspect}, structured:"\
127
+ " #{@structured.inspect}, text: #{@text.inspect}, additional_properties:"\
128
+ " #{@additional_properties}>"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,100 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # The request a run was created with.
8
+ class AgentRunRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The effort level the run executes at: the request's `effort`, or the
13
+ # default level when it named none.
14
+ # @return [String]
15
+ attr_accessor :effort
16
+
17
+ # The request's `output_schema`, when one was given. On gRPC the object is
18
+ # JSON-encoded.
19
+ # @return [Object]
20
+ attr_accessor :output_schema
21
+
22
+ # The natural-language question.
23
+ # @return [String]
24
+ attr_accessor :query
25
+
26
+ # A mapping from model property names to API property names.
27
+ def self.names
28
+ @_hash = {} if @_hash.nil?
29
+ @_hash['effort'] = 'effort'
30
+ @_hash['output_schema'] = 'output_schema'
31
+ @_hash['query'] = 'query'
32
+ @_hash
33
+ end
34
+
35
+ # An array for optional fields
36
+ def self.optionals
37
+ %w[
38
+ effort
39
+ output_schema
40
+ query
41
+ ]
42
+ end
43
+
44
+ # An array for nullable fields
45
+ def self.nullables
46
+ %w[
47
+ effort
48
+ output_schema
49
+ ]
50
+ end
51
+
52
+ def initialize(effort: SKIP, output_schema: SKIP, query: SKIP,
53
+ additional_properties: nil)
54
+ # Add additional model properties to the instance
55
+ additional_properties = {} if additional_properties.nil?
56
+
57
+ @effort = effort unless effort == SKIP
58
+ @output_schema = output_schema unless output_schema == SKIP
59
+ @query = query unless query == SKIP
60
+ @additional_properties = additional_properties
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ effort = hash.key?('effort') ? hash['effort'] : SKIP
69
+ output_schema = hash.key?('output_schema') ? hash['output_schema'] : SKIP
70
+ query = hash.key?('query') ? hash['query'] : SKIP
71
+
72
+ # Create a new hash for additional properties, removing known properties.
73
+ new_hash = hash.reject { |k, _| names.value?(k) }
74
+
75
+ additional_properties = APIHelper.get_additional_properties(
76
+ new_hash, proc { |value| value }
77
+ )
78
+
79
+ # Create object from extracted values.
80
+ AgentRunRequest.new(effort: effort,
81
+ output_schema: output_schema,
82
+ query: query,
83
+ additional_properties: additional_properties)
84
+ end
85
+
86
+ # Provides a human-readable string representation of the object.
87
+ def to_s
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} effort: #{@effort}, output_schema: #{@output_schema}, query: #{@query},"\
90
+ " additional_properties: #{@additional_properties}>"
91
+ end
92
+
93
+ # Provides a debugging-friendly string with detailed object information.
94
+ def inspect
95
+ class_name = self.class.name.split('::').last
96
+ "<#{class_name} effort: #{@effort.inspect}, output_schema: #{@output_schema.inspect},"\
97
+ " query: #{@query.inspect}, additional_properties: #{@additional_properties}>"
98
+ end
99
+ end
100
+ end