vellum_ai 0.14.74 → 0.14.76
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 +4 -4
- data/lib/requests.rb +2 -2
- data/lib/vellum_ai/prompts/client.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55f96481ab8ad26a7df0bed4bceecb30f265e5695d40ac1d12c874124ee6815c
|
4
|
+
data.tar.gz: ebce422a349cde9359fdd910107fd8349ea0840571c731dad71d46ef360a363a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f575f1b93a1108276111f5900e98d9129882299f9a3c3c6002b2a649af8e98e5b9152331d2db55016ba8bc49c69c88f894c1fe0f318581731d3213c98a1be62
|
7
|
+
data.tar.gz: 9cb99b1fa5e446107bbb9331d7ff94b01c044d1455bfe97aaab1e61960a0f4fd77c4b36ad37ab327fdc29dc0617f77713cd91e715aea61f75b2f6d68fbc4c7a2
|
data/lib/requests.rb
CHANGED
@@ -50,7 +50,7 @@ end
|
|
50
50
|
end
|
51
51
|
# @return [Hash{String => String}]
|
52
52
|
def get_headers
|
53
|
-
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.14.
|
53
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.14.76' }
|
54
54
|
headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
55
55
|
headers
|
56
56
|
end
|
@@ -96,7 +96,7 @@ end
|
|
96
96
|
end
|
97
97
|
# @return [Hash{String => String}]
|
98
98
|
def get_headers
|
99
|
-
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.14.
|
99
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.14.76' }
|
100
100
|
headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
101
101
|
headers
|
102
102
|
end
|
@@ -50,6 +50,10 @@ end
|
|
50
50
|
end
|
51
51
|
# Used to push updates to a Prompt in Vellum.
|
52
52
|
#
|
53
|
+
# @param prompt_variant_id [String] If specified, an existing Prompt Variant by the provided ID will be updated.
|
54
|
+
# Otherwise, a new Prompt Variant will be created and an ID generated.
|
55
|
+
# @param prompt_variant_label [String] If provided, then the created/updated Prompt Variant will have this label.
|
56
|
+
# @param prompt_sandbox_id [String]
|
53
57
|
# @param exec_config [Hash] Request of type Vellum::PromptExecConfig, as a Hash
|
54
58
|
# * :ml_model (String)
|
55
59
|
# * :input_variables (Array<Vellum::VellumVariable>)
|
@@ -68,8 +72,6 @@ end
|
|
68
72
|
# * :stream_enabled (Boolean)
|
69
73
|
# * :blocks (Array<Vellum::PromptBlock>)
|
70
74
|
# * :functions (Array<Vellum::FunctionDefinition>)
|
71
|
-
# @param prompt_variant_id [String]
|
72
|
-
# @param prompt_sandbox_id [String]
|
73
75
|
# @param request_options [Vellum::RequestOptions]
|
74
76
|
# @return [Vellum::PromptPushResponse]
|
75
77
|
# @example
|
@@ -79,7 +81,7 @@ end
|
|
79
81
|
# api_key: "YOUR_API_KEY"
|
80
82
|
# )
|
81
83
|
# api.prompts.push(exec_config: { ml_model: "ml_model", input_variables: [{ id: "id", key: "key", type: STRING }], parameters: { }, blocks: [{ block_type: "JINJA", template: "template" }] })
|
82
|
-
def push(
|
84
|
+
def push(prompt_variant_id: nil, prompt_variant_label: nil, prompt_sandbox_id: nil, exec_config:, request_options: nil)
|
83
85
|
response = @request_client.conn.post do | req |
|
84
86
|
unless request_options&.timeout_in_seconds.nil?
|
85
87
|
req.options.timeout = request_options.timeout_in_seconds
|
@@ -91,7 +93,7 @@ end
|
|
91
93
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
92
94
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
93
95
|
end
|
94
|
-
req.body = { **(request_options&.additional_body_parameters || {}),
|
96
|
+
req.body = { **(request_options&.additional_body_parameters || {}), prompt_variant_id: prompt_variant_id, prompt_variant_label: prompt_variant_label, prompt_sandbox_id: prompt_sandbox_id, exec_config: exec_config }.compact
|
95
97
|
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/prompts/push"
|
96
98
|
end
|
97
99
|
Vellum::PromptPushResponse.from_json(json_object: response.body)
|
@@ -142,6 +144,10 @@ end
|
|
142
144
|
end
|
143
145
|
# Used to push updates to a Prompt in Vellum.
|
144
146
|
#
|
147
|
+
# @param prompt_variant_id [String] If specified, an existing Prompt Variant by the provided ID will be updated.
|
148
|
+
# Otherwise, a new Prompt Variant will be created and an ID generated.
|
149
|
+
# @param prompt_variant_label [String] If provided, then the created/updated Prompt Variant will have this label.
|
150
|
+
# @param prompt_sandbox_id [String]
|
145
151
|
# @param exec_config [Hash] Request of type Vellum::PromptExecConfig, as a Hash
|
146
152
|
# * :ml_model (String)
|
147
153
|
# * :input_variables (Array<Vellum::VellumVariable>)
|
@@ -160,8 +166,6 @@ end
|
|
160
166
|
# * :stream_enabled (Boolean)
|
161
167
|
# * :blocks (Array<Vellum::PromptBlock>)
|
162
168
|
# * :functions (Array<Vellum::FunctionDefinition>)
|
163
|
-
# @param prompt_variant_id [String]
|
164
|
-
# @param prompt_sandbox_id [String]
|
165
169
|
# @param request_options [Vellum::RequestOptions]
|
166
170
|
# @return [Vellum::PromptPushResponse]
|
167
171
|
# @example
|
@@ -171,7 +175,7 @@ end
|
|
171
175
|
# api_key: "YOUR_API_KEY"
|
172
176
|
# )
|
173
177
|
# api.prompts.push(exec_config: { ml_model: "ml_model", input_variables: [{ id: "id", key: "key", type: STRING }], parameters: { }, blocks: [{ block_type: "JINJA", template: "template" }] })
|
174
|
-
def push(
|
178
|
+
def push(prompt_variant_id: nil, prompt_variant_label: nil, prompt_sandbox_id: nil, exec_config:, request_options: nil)
|
175
179
|
Async do
|
176
180
|
response = @request_client.conn.post do | req |
|
177
181
|
unless request_options&.timeout_in_seconds.nil?
|
@@ -184,7 +188,7 @@ end
|
|
184
188
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
185
189
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
186
190
|
end
|
187
|
-
req.body = { **(request_options&.additional_body_parameters || {}),
|
191
|
+
req.body = { **(request_options&.additional_body_parameters || {}), prompt_variant_id: prompt_variant_id, prompt_variant_label: prompt_variant_label, prompt_sandbox_id: prompt_sandbox_id, exec_config: exec_config }.compact
|
188
192
|
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/prompts/push"
|
189
193
|
end
|
190
194
|
Vellum::PromptPushResponse.from_json(json_object: response.body)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vellum_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.76
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vellum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|