diff --git a/lib/requests.rb b/lib/requests.rb index edeb1be..ff5a025 100644 --- a/lib/requests.rb +++ b/lib/requests.rb @@ -56,7 +56,7 @@ def get_url(request_options: nil, environment:) end # @return [Hash{String => String}] def get_headers - headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.10.1' } + headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.3.3' } headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil? headers end @@ -107,7 +107,7 @@ def get_url(request_options: nil, environment:) end # @return [Hash{String => String}] def get_headers - headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.10.1' } + headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.3.3' } headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil? headers end diff --git a/lib/vellum_ai.rb b/lib/vellum_ai.rb index 012d4a0..0fda223 100644 --- a/lib/vellum_ai.rb +++ b/lib/vellum_ai.rb @@ -146,7 +146,7 @@ def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_ @workspaces = Vellum::WorkspacesClient.new(request_client: @request_client) end # @param url [String] - # @param method [Vellum::MethodEnum] + # @param method_ [Vellum::MethodEnum] # @param body [String, Array, Hash{String => Object}] # @param headers [Hash{String => Vellum::ExecuteApiRequestHeadersValue}] # @param bearer_token [String, Vellum::VellumSecret] @@ -159,7 +159,7 @@ def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_ # api_key: "YOUR_API_KEY" # ) # api.execute_api(url: "x") - def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) + def execute_api(url:, method_: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) response = @request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -176,7 +176,7 @@ def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, r unless request_options.nil? || request_options&.additional_query_parameters.nil? req.params = { **(request_options&.additional_query_parameters || {}) }.compact end - req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method, body: body, headers: headers, bearer_token: bearer_token }.compact + req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method_, body: body, headers: headers, bearer_token: bearer_token }.compact req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/execute-api" end Vellum::ExecuteApiResponse.from_json(json_object: response.body) @@ -615,7 +615,7 @@ def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_ @workspaces = Vellum::AsyncWorkspacesClient.new(request_client: @async_request_client) end # @param url [String] - # @param method [Vellum::MethodEnum] + # @param method_ [Vellum::MethodEnum] # @param body [String, Array, Hash{String => Object}] # @param headers [Hash{String => Vellum::ExecuteApiRequestHeadersValue}] # @param bearer_token [String, Vellum::VellumSecret] @@ -628,7 +628,7 @@ def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_ # api_key: "YOUR_API_KEY" # ) # api.execute_api(url: "x") - def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) + def execute_api(url:, method_: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -645,7 +645,7 @@ def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, r unless request_options.nil? || request_options&.additional_query_parameters.nil? req.params = { **(request_options&.additional_query_parameters || {}) }.compact end - req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method, body: body, headers: headers, bearer_token: bearer_token }.compact + req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method_, body: body, headers: headers, bearer_token: bearer_token }.compact req.url "#{@async_request_client.get_url(environment: Default, request_options: request_options)}/v1/execute-api" end Vellum::ExecuteApiResponse.from_json(json_object: response.body) diff --git a/lib/vellum_ai/deployments/client.rb b/lib/vellum_ai/deployments/client.rb index 6ad434f..1afefe1 100644 --- a/lib/vellum_ai/deployments/client.rb +++ b/lib/vellum_ai/deployments/client.rb @@ -109,10 +109,10 @@ def retrieve(id:, request_options: nil) # Please use the # `retrieve_prompt_deployment_release` xendpoint instead. # + # @param id [String] Either the Prompt Deployment's ID or its unique name # @param history_id_or_release_tag [String] Either the UUID of Deployment History Item you'd like to retrieve, or the name # of a Release Tag that's pointing to the Deployment History Item you'd like to # retrieve. - # @param id [String] Either the Prompt Deployment's ID or its unique name # @param request_options [Vellum::RequestOptions] # @return [Vellum::DeploymentHistoryItem] # @example @@ -121,8 +121,8 @@ def retrieve(id:, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.deployments.deployment_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.deployments.deployment_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def deployment_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -142,7 +142,7 @@ def deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_op unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/deployments/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/deployments/#{id}/history/#{history_id_or_release_tag}" end Vellum::DeploymentHistoryItem.from_json(json_object: response.body) end @@ -449,10 +449,10 @@ def retrieve(id:, request_options: nil) # Please use the # `retrieve_prompt_deployment_release` xendpoint instead. # + # @param id [String] Either the Prompt Deployment's ID or its unique name # @param history_id_or_release_tag [String] Either the UUID of Deployment History Item you'd like to retrieve, or the name # of a Release Tag that's pointing to the Deployment History Item you'd like to # retrieve. - # @param id [String] Either the Prompt Deployment's ID or its unique name # @param request_options [Vellum::RequestOptions] # @return [Vellum::DeploymentHistoryItem] # @example @@ -461,8 +461,8 @@ def retrieve(id:, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.deployments.deployment_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.deployments.deployment_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def deployment_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -483,7 +483,7 @@ def deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_op unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/deployments/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/deployments/#{id}/history/#{history_id_or_release_tag}" end Vellum::DeploymentHistoryItem.from_json(json_object: response.body) end diff --git a/lib/vellum_ai/document_indexes/client.rb b/lib/vellum_ai/document_indexes/client.rb index e4cb8b5..c656d57 100644 --- a/lib/vellum_ai/document_indexes/client.rb +++ b/lib/vellum_ai/document_indexes/client.rb @@ -262,10 +262,10 @@ def partial_update(id:, label: nil, status: nil, request_options: nil) end # Adds a previously uploaded Document to the specified Document Index. # - # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that -# uniquely identifies the Document you'd like to add. # @param id [String] Either the Vellum-generated ID or the originally specified name that uniquely # identifies the Document Index to which you'd like to add the Document. + # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that +# uniquely identifies the Document you'd like to add. # @param request_options [Vellum::RequestOptions] # @return [Void] # @example @@ -274,8 +274,8 @@ def partial_update(id:, label: nil, status: nil, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.document_indexes.add_document(document_id: "document_id", id: "id") - def add_document(document_id:, id:, request_options: nil) +# api.document_indexes.add_document(id: "id", document_id: "document_id") + def add_document(id:, document_id:, request_options: nil) response = @request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -295,15 +295,15 @@ def add_document(document_id:, id:, request_options: nil) unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/document-indexes/#{document_id}/documents/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/document-indexes/#{id}/documents/#{document_id}" end end # Removes a Document from a Document Index without deleting the Document itself. # - # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that -# uniquely identifies the Document you'd like to remove. # @param id [String] Either the Vellum-generated ID or the originally specified name that uniquely # identifies the Document Index from which you'd like to remove a Document. + # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that +# uniquely identifies the Document you'd like to remove. # @param request_options [Vellum::RequestOptions] # @return [Void] # @example @@ -312,8 +312,8 @@ def add_document(document_id:, id:, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.document_indexes.remove_document(document_id: "document_id", id: "id") - def remove_document(document_id:, id:, request_options: nil) +# api.document_indexes.remove_document(id: "id", document_id: "document_id") + def remove_document(id:, document_id:, request_options: nil) response = @request_client.conn.delete do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -333,7 +333,7 @@ def remove_document(document_id:, id:, request_options: nil) unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/document-indexes/#{document_id}/documents/#{id}" + req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/document-indexes/#{id}/documents/#{document_id}" end end end @@ -595,10 +595,10 @@ def partial_update(id:, label: nil, status: nil, request_options: nil) end # Adds a previously uploaded Document to the specified Document Index. # - # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that -# uniquely identifies the Document you'd like to add. # @param id [String] Either the Vellum-generated ID or the originally specified name that uniquely # identifies the Document Index to which you'd like to add the Document. + # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that +# uniquely identifies the Document you'd like to add. # @param request_options [Vellum::RequestOptions] # @return [Void] # @example @@ -607,8 +607,8 @@ def partial_update(id:, label: nil, status: nil, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.document_indexes.add_document(document_id: "document_id", id: "id") - def add_document(document_id:, id:, request_options: nil) +# api.document_indexes.add_document(id: "id", document_id: "document_id") + def add_document(id:, document_id:, request_options: nil) Async do response = @request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? @@ -629,16 +629,16 @@ def add_document(document_id:, id:, request_options: nil) unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/document-indexes/#{document_id}/documents/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/document-indexes/#{id}/documents/#{document_id}" end end end # Removes a Document from a Document Index without deleting the Document itself. # - # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that -# uniquely identifies the Document you'd like to remove. # @param id [String] Either the Vellum-generated ID or the originally specified name that uniquely # identifies the Document Index from which you'd like to remove a Document. + # @param document_id [String] Either the Vellum-generated ID or the originally supplied external_id that +# uniquely identifies the Document you'd like to remove. # @param request_options [Vellum::RequestOptions] # @return [Void] # @example @@ -647,8 +647,8 @@ def add_document(document_id:, id:, request_options: nil) # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.document_indexes.remove_document(document_id: "document_id", id: "id") - def remove_document(document_id:, id:, request_options: nil) +# api.document_indexes.remove_document(id: "id", document_id: "document_id") + def remove_document(id:, document_id:, request_options: nil) Async do response = @request_client.conn.delete do | req | unless request_options&.timeout_in_seconds.nil? @@ -669,7 +669,7 @@ def remove_document(document_id:, id:, request_options: nil) unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/document-indexes/#{document_id}/documents/#{id}" + req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/document-indexes/#{id}/documents/#{document_id}" end end end diff --git a/lib/vellum_ai/integration_providers/client.rb b/lib/vellum_ai/integration_providers/client.rb index 5b514e9..bd44578 100644 --- a/lib/vellum_ai/integration_providers/client.rb +++ b/lib/vellum_ai/integration_providers/client.rb @@ -19,8 +19,8 @@ def initialize(request_client:) end # Retrieve a specific integration tool definition. # - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request_options [Vellum::RequestOptions] # @return [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_TOOL_DEFINITION] @@ -31,11 +31,11 @@ def initialize(request_client:) # api_key: "YOUR_API_KEY" # ) # api.integration_providers.retrieve_integration_provider_tool_definition( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name" # ) - def retrieve_integration_provider_tool_definition(integration_name:, integration_provider:, tool_name:, request_options: nil) + def retrieve_integration_provider_tool_definition(integration_provider:, integration_name:, tool_name:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -55,7 +55,7 @@ def retrieve_integration_provider_tool_definition(integration_name:, integration unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/integration-providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/integration-providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}" end Vellum::ComposioToolDefinition.from_json(json_object: response.body) end @@ -112,8 +112,8 @@ def initialize(request_client:) end # Retrieve a specific integration tool definition. # - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request_options [Vellum::RequestOptions] # @return [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_TOOL_DEFINITION] @@ -124,11 +124,11 @@ def initialize(request_client:) # api_key: "YOUR_API_KEY" # ) # api.integration_providers.retrieve_integration_provider_tool_definition( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name" # ) - def retrieve_integration_provider_tool_definition(integration_name:, integration_provider:, tool_name:, request_options: nil) + def retrieve_integration_provider_tool_definition(integration_provider:, integration_name:, tool_name:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -149,7 +149,7 @@ def retrieve_integration_provider_tool_definition(integration_name:, integration unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/integration-providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/integration-providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}" end Vellum::ComposioToolDefinition.from_json(json_object: response.body) end diff --git a/lib/vellum_ai/integrations/client.rb b/lib/vellum_ai/integrations/client.rb index 9e1ce00..daa1fb0 100644 --- a/lib/vellum_ai/integrations/client.rb +++ b/lib/vellum_ai/integrations/client.rb @@ -22,8 +22,8 @@ class IntegrationsClient def initialize(request_client:) @request_client = request_client end - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request_options [Vellum::RequestOptions] # @return [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_TOOL_DEFINITION] @@ -34,11 +34,11 @@ def initialize(request_client:) # api_key: "YOUR_API_KEY" # ) # api.integrations.retrieve_integration_tool_definition( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name" # ) - def retrieve_integration_tool_definition(integration_name:, integration_provider:, tool_name:, request_options: nil) + def retrieve_integration_tool_definition(integration_provider:, integration_name:, tool_name:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -58,12 +58,12 @@ def retrieve_integration_tool_definition(integration_name:, integration_provider unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}" end Vellum::ComposioToolDefinition.from_json(json_object: response.body) end - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request [Hash] Request of type Vellum::COMPONENTS_SCHEMAS_COMPOSIO_EXECUTE_TOOL_REQUEST, as a Hash # * :provider (String) @@ -77,12 +77,12 @@ def retrieve_integration_tool_definition(integration_name:, integration_provider # api_key: "YOUR_API_KEY" # ) # api.integrations.execute_integration_tool( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name", # request: { provider: "COMPOSIO", arguments: { "arguments": {"key":"value"} } } # ) - def execute_integration_tool(integration_name:, integration_provider:, tool_name:, request:, request_options: nil) + def execute_integration_tool(integration_provider:, integration_name:, tool_name:, request:, request_options: nil) response = @request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -100,7 +100,7 @@ def execute_integration_tool(integration_name:, integration_provider:, tool_name req.params = { **(request_options&.additional_query_parameters || {}) }.compact end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}/execute" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}/execute" end Vellum::ComposioExecuteToolResponse.from_json(json_object: response.body) end @@ -190,8 +190,8 @@ class AsyncIntegrationsClient def initialize(request_client:) @request_client = request_client end - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request_options [Vellum::RequestOptions] # @return [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_TOOL_DEFINITION] @@ -202,11 +202,11 @@ def initialize(request_client:) # api_key: "YOUR_API_KEY" # ) # api.integrations.retrieve_integration_tool_definition( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name" # ) - def retrieve_integration_tool_definition(integration_name:, integration_provider:, tool_name:, request_options: nil) + def retrieve_integration_tool_definition(integration_provider:, integration_name:, tool_name:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -227,13 +227,13 @@ def retrieve_integration_tool_definition(integration_name:, integration_provider unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}" end Vellum::ComposioToolDefinition.from_json(json_object: response.body) end end - # @param integration_name [String] The integration name # @param integration_provider [String] The integration provider name + # @param integration_name [String] The integration name # @param tool_name [String] The tool's unique name, as specified by the integration provider # @param request [Hash] Request of type Vellum::COMPONENTS_SCHEMAS_COMPOSIO_EXECUTE_TOOL_REQUEST, as a Hash # * :provider (String) @@ -247,12 +247,12 @@ def retrieve_integration_tool_definition(integration_name:, integration_provider # api_key: "YOUR_API_KEY" # ) # api.integrations.execute_integration_tool( -# integration_name: "integration_name", # integration_provider: "integration_provider", +# integration_name: "integration_name", # tool_name: "tool_name", # request: { provider: "COMPOSIO", arguments: { "arguments": {"key":"value"} } } # ) - def execute_integration_tool(integration_name:, integration_provider:, tool_name:, request:, request_options: nil) + def execute_integration_tool(integration_provider:, integration_name:, tool_name:, request:, request_options: nil) Async do response = @request_client.conn.post do | req | unless request_options&.timeout_in_seconds.nil? @@ -271,7 +271,7 @@ def execute_integration_tool(integration_name:, integration_provider:, tool_name req.params = { **(request_options&.additional_query_parameters || {}) }.compact end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_name}/integrations/#{integration_provider}/tools/#{tool_name}/execute" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/integrations/v1/providers/#{integration_provider}/integrations/#{integration_name}/tools/#{tool_name}/execute" end Vellum::ComposioExecuteToolResponse.from_json(json_object: response.body) end diff --git a/lib/vellum_ai/metric_definitions/client.rb b/lib/vellum_ai/metric_definitions/client.rb index 57446f4..e1a69da 100644 --- a/lib/vellum_ai/metric_definitions/client.rb +++ b/lib/vellum_ai/metric_definitions/client.rb @@ -52,10 +52,10 @@ def execute_metric_definition(id:, inputs:, release_tag: nil, request_options: n end Vellum::MetricDefinitionExecution.from_json(json_object: response.body) end + # @param id [String] A UUID string identifying this metric definition. # @param history_id_or_release_tag [String] Either the UUID of Metric Definition History Item you'd like to retrieve, or the # name of a Release Tag that's pointing to the Metric Definition History Item # you'd like to retrieve. - # @param id [String] A UUID string identifying this metric definition. # @param request_options [Vellum::RequestOptions] # @return [Vellum::MetricDefinitionHistoryItem] # @example @@ -64,8 +64,8 @@ def execute_metric_definition(id:, inputs:, release_tag: nil, request_options: n # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.metric_definitions.metric_definition_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def metric_definition_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.metric_definitions.metric_definition_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def metric_definition_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -85,7 +85,7 @@ def metric_definition_history_item_retrieve(history_id_or_release_tag:, id:, req unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/metric-definitions/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/metric-definitions/#{id}/history/#{history_id_or_release_tag}" end Vellum::MetricDefinitionHistoryItem.from_json(json_object: response.body) end @@ -136,10 +136,10 @@ def execute_metric_definition(id:, inputs:, release_tag: nil, request_options: n Vellum::MetricDefinitionExecution.from_json(json_object: response.body) end end + # @param id [String] A UUID string identifying this metric definition. # @param history_id_or_release_tag [String] Either the UUID of Metric Definition History Item you'd like to retrieve, or the # name of a Release Tag that's pointing to the Metric Definition History Item # you'd like to retrieve. - # @param id [String] A UUID string identifying this metric definition. # @param request_options [Vellum::RequestOptions] # @return [Vellum::MetricDefinitionHistoryItem] # @example @@ -148,8 +148,8 @@ def execute_metric_definition(id:, inputs:, release_tag: nil, request_options: n # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.metric_definitions.metric_definition_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def metric_definition_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.metric_definitions.metric_definition_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def metric_definition_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -170,7 +170,7 @@ def metric_definition_history_item_retrieve(history_id_or_release_tag:, id:, req unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/metric-definitions/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/metric-definitions/#{id}/history/#{history_id_or_release_tag}" end Vellum::MetricDefinitionHistoryItem.from_json(json_object: response.body) end diff --git a/lib/vellum_ai/types/code_execution_node_json_result.rb b/lib/vellum_ai/types/code_execution_node_json_result.rb index 578f25d..5bc6029 100644 --- a/lib/vellum_ai/types/code_execution_node_json_result.rb +++ b/lib/vellum_ai/types/code_execution_node_json_result.rb @@ -23,12 +23,14 @@ class CodeExecutionNodeJsonResult # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::CodeExecutionNodeJsonResult] - def initialize(id:, type:, value:, additional_properties: nil) + def initialize(id:, type:, value: OMIT, additional_properties: nil) @id = id @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "id": id, "type": type, "value": value } + @_field_set = { "id": id, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of CodeExecutionNodeJsonResult # @@ -62,7 +64,7 @@ def to_json def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/execution_json_vellum_value.rb b/lib/vellum_ai/types/execution_json_vellum_value.rb index 59365bb..76a6f70 100644 --- a/lib/vellum_ai/types/execution_json_vellum_value.rb +++ b/lib/vellum_ai/types/execution_json_vellum_value.rb @@ -27,13 +27,15 @@ class ExecutionJsonVellumValue # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::ExecutionJsonVellumValue] - def initialize(id:, name:, type:, value:, additional_properties: nil) + def initialize(id:, name:, type:, value: OMIT, additional_properties: nil) @id = id @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "id": id, "name": name, "type": type, "value": value } + @_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of ExecutionJsonVellumValue # @@ -70,7 +72,7 @@ def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/json_input.rb b/lib/vellum_ai/types/json_input.rb index 0c37915..590189a 100644 --- a/lib/vellum_ai/types/json_input.rb +++ b/lib/vellum_ai/types/json_input.rb @@ -24,12 +24,14 @@ class JsonInput # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::JsonInput] - def initialize(name:, type:, value:, additional_properties: nil) + def initialize(name:, type:, value: OMIT, additional_properties: nil) @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "name": name, "type": type, "value": value } + @_field_set = { "name": name, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of JsonInput # @@ -63,7 +65,7 @@ def to_json def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/json_input_request.rb b/lib/vellum_ai/types/json_input_request.rb index 7e503cf..82595ff 100644 --- a/lib/vellum_ai/types/json_input_request.rb +++ b/lib/vellum_ai/types/json_input_request.rb @@ -24,12 +24,14 @@ class JsonInputRequest # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::JsonInputRequest] - def initialize(name:, type:, value:, additional_properties: nil) + def initialize(name:, type:, value: OMIT, additional_properties: nil) @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "name": name, "type": type, "value": value } + @_field_set = { "name": name, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of JsonInputRequest # @@ -63,7 +65,7 @@ def to_json def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/json_vellum_value.rb b/lib/vellum_ai/types/json_vellum_value.rb index 64e22b1..661844f 100644 --- a/lib/vellum_ai/types/json_vellum_value.rb +++ b/lib/vellum_ai/types/json_vellum_value.rb @@ -21,11 +21,13 @@ class JsonVellumValue # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::JsonVellumValue] - def initialize(type:, value:, additional_properties: nil) + def initialize(type:, value: OMIT, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "type": type, "value": value } + @_field_set = { "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of JsonVellumValue # @@ -56,7 +58,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/json_vellum_value_request.rb b/lib/vellum_ai/types/json_vellum_value_request.rb index bf6a062..83aedbb 100644 --- a/lib/vellum_ai/types/json_vellum_value_request.rb +++ b/lib/vellum_ai/types/json_vellum_value_request.rb @@ -21,11 +21,13 @@ class JsonVellumValueRequest # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::JsonVellumValueRequest] - def initialize(type:, value:, additional_properties: nil) + def initialize(type:, value: OMIT, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "type": type, "value": value } + @_field_set = { "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of JsonVellumValueRequest # @@ -56,7 +58,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/named_scenario_input_json_variable_value_request.rb b/lib/vellum_ai/types/named_scenario_input_json_variable_value_request.rb index 352d6df..22a153a 100644 --- a/lib/vellum_ai/types/named_scenario_input_json_variable_value_request.rb +++ b/lib/vellum_ai/types/named_scenario_input_json_variable_value_request.rb @@ -24,12 +24,14 @@ class NamedScenarioInputJsonVariableValueRequest # @param name [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::NamedScenarioInputJsonVariableValueRequest] - def initialize(type:, value:, name:, additional_properties: nil) + def initialize(type:, value: OMIT, name:, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @name = name @additional_properties = additional_properties - @_field_set = { "type": type, "value": value, "name": name } + @_field_set = { "type": type, "value": value, "name": name }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of # NamedScenarioInputJsonVariableValueRequest @@ -64,7 +66,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end end diff --git a/lib/vellum_ai/types/named_test_case_json_variable_value.rb b/lib/vellum_ai/types/named_test_case_json_variable_value.rb index 66efd79..7657fa0 100644 --- a/lib/vellum_ai/types/named_test_case_json_variable_value.rb +++ b/lib/vellum_ai/types/named_test_case_json_variable_value.rb @@ -24,12 +24,14 @@ class NamedTestCaseJsonVariableValue # @param name [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::NamedTestCaseJsonVariableValue] - def initialize(type:, value:, name:, additional_properties: nil) + def initialize(type:, value: OMIT, name:, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @name = name @additional_properties = additional_properties - @_field_set = { "type": type, "value": value, "name": name } + @_field_set = { "type": type, "value": value, "name": name }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of NamedTestCaseJsonVariableValue # @@ -62,7 +64,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end end diff --git a/lib/vellum_ai/types/named_test_case_json_variable_value_request.rb b/lib/vellum_ai/types/named_test_case_json_variable_value_request.rb index cd9080e..d05b752 100644 --- a/lib/vellum_ai/types/named_test_case_json_variable_value_request.rb +++ b/lib/vellum_ai/types/named_test_case_json_variable_value_request.rb @@ -24,12 +24,14 @@ class NamedTestCaseJsonVariableValueRequest # @param name [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::NamedTestCaseJsonVariableValueRequest] - def initialize(type:, value:, name:, additional_properties: nil) + def initialize(type:, value: OMIT, name:, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @name = name @additional_properties = additional_properties - @_field_set = { "type": type, "value": value, "name": name } + @_field_set = { "type": type, "value": value, "name": name }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of # NamedTestCaseJsonVariableValueRequest @@ -63,7 +65,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end end diff --git a/lib/vellum_ai/types/node_input_compiled_json_value.rb b/lib/vellum_ai/types/node_input_compiled_json_value.rb index 1542f00..82de167 100644 --- a/lib/vellum_ai/types/node_input_compiled_json_value.rb +++ b/lib/vellum_ai/types/node_input_compiled_json_value.rb @@ -26,13 +26,15 @@ class NodeInputCompiledJsonValue # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::NodeInputCompiledJsonValue] - def initialize(node_input_id:, key:, type:, value:, additional_properties: nil) + def initialize(node_input_id:, key:, type:, value: OMIT, additional_properties: nil) @node_input_id = node_input_id @key = key @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "node_input_id": node_input_id, "key": key, "type": type, "value": value } + @_field_set = { "node_input_id": node_input_id, "key": key, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of NodeInputCompiledJsonValue # @@ -69,7 +71,7 @@ def self.validate_raw(obj:) obj.node_input_id.is_a?(String) != false || raise("Passed value for field obj.node_input_id is not the expected type, validation failed.") obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/node_output_compiled_json_value.rb b/lib/vellum_ai/types/node_output_compiled_json_value.rb index cef0c6f..9255402 100644 --- a/lib/vellum_ai/types/node_output_compiled_json_value.rb +++ b/lib/vellum_ai/types/node_output_compiled_json_value.rb @@ -28,9 +28,9 @@ class NodeOutputCompiledJsonValue # @param state [Vellum::WorkflowNodeResultEventState] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::NodeOutputCompiledJsonValue] - def initialize(type:, value:, node_output_id:, state: OMIT, additional_properties: nil) + def initialize(type:, value: OMIT, node_output_id:, state: OMIT, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @node_output_id = node_output_id @state = state if state != OMIT @additional_properties = additional_properties @@ -71,7 +71,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.node_output_id.is_a?(String) != false || raise("Passed value for field obj.node_output_id is not the expected type, validation failed.") obj.state&.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") end diff --git a/lib/vellum_ai/types/prompt_request_json_input.rb b/lib/vellum_ai/types/prompt_request_json_input.rb index a2bb4bf..42a9789 100644 --- a/lib/vellum_ai/types/prompt_request_json_input.rb +++ b/lib/vellum_ai/types/prompt_request_json_input.rb @@ -23,12 +23,14 @@ class PromptRequestJsonInput # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::PromptRequestJsonInput] - def initialize(key:, type:, value:, additional_properties: nil) + def initialize(key:, type:, value: OMIT, additional_properties: nil) @key = key @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "key": key, "type": type, "value": value } + @_field_set = { "key": key, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of PromptRequestJsonInput # @@ -62,7 +64,7 @@ def to_json def self.validate_raw(obj:) obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/scenario_input_json_variable_value.rb b/lib/vellum_ai/types/scenario_input_json_variable_value.rb index 68ea432..ee50a32 100644 --- a/lib/vellum_ai/types/scenario_input_json_variable_value.rb +++ b/lib/vellum_ai/types/scenario_input_json_variable_value.rb @@ -24,12 +24,14 @@ class ScenarioInputJsonVariableValue # @param input_variable_id [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::ScenarioInputJsonVariableValue] - def initialize(type:, value:, input_variable_id:, additional_properties: nil) + def initialize(type:, value: OMIT, input_variable_id:, additional_properties: nil) @type = type - @value = value + @value = value if value != OMIT @input_variable_id = input_variable_id @additional_properties = additional_properties - @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id } + @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of ScenarioInputJsonVariableValue # @@ -62,7 +64,7 @@ def to_json # @return [Void] def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.input_variable_id.is_a?(String) != false || raise("Passed value for field obj.input_variable_id is not the expected type, validation failed.") end end diff --git a/lib/vellum_ai/types/templating_node_json_result.rb b/lib/vellum_ai/types/templating_node_json_result.rb index b1afb77..5e829b6 100644 --- a/lib/vellum_ai/types/templating_node_json_result.rb +++ b/lib/vellum_ai/types/templating_node_json_result.rb @@ -23,12 +23,14 @@ class TemplatingNodeJsonResult # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::TemplatingNodeJsonResult] - def initialize(id:, type:, value:, additional_properties: nil) + def initialize(id:, type:, value: OMIT, additional_properties: nil) @id = id @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "id": id, "type": type, "value": value } + @_field_set = { "id": id, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of TemplatingNodeJsonResult # @@ -62,7 +64,7 @@ def to_json def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/terminal_node_json_result.rb b/lib/vellum_ai/types/terminal_node_json_result.rb index 161c954..c95d74f 100644 --- a/lib/vellum_ai/types/terminal_node_json_result.rb +++ b/lib/vellum_ai/types/terminal_node_json_result.rb @@ -26,11 +26,11 @@ class TerminalNodeJsonResult # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::TerminalNodeJsonResult] - def initialize(id: OMIT, name:, type:, value:, additional_properties: nil) + def initialize(id: OMIT, name:, type:, value: OMIT, additional_properties: nil) @id = id if id != OMIT @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v | v == OMIT @@ -71,7 +71,7 @@ def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/test_case_json_variable_value.rb b/lib/vellum_ai/types/test_case_json_variable_value.rb index e10394b..36706b0 100644 --- a/lib/vellum_ai/types/test_case_json_variable_value.rb +++ b/lib/vellum_ai/types/test_case_json_variable_value.rb @@ -27,13 +27,15 @@ class TestCaseJsonVariableValue # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::TestCaseJsonVariableValue] - def initialize(variable_id:, name:, type:, value:, additional_properties: nil) + def initialize(variable_id:, name:, type:, value: OMIT, additional_properties: nil) @variable_id = variable_id @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "variable_id": variable_id, "name": name, "type": type, "value": value } + @_field_set = { "variable_id": variable_id, "name": name, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of TestCaseJsonVariableValue # @@ -70,7 +72,7 @@ def self.validate_raw(obj:) obj.variable_id.is_a?(String) != false || raise("Passed value for field obj.variable_id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/test_suite_run_execution_json_output.rb b/lib/vellum_ai/types/test_suite_run_execution_json_output.rb index 08dc346..8bff8e3 100644 --- a/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +++ b/lib/vellum_ai/types/test_suite_run_execution_json_output.rb @@ -28,13 +28,15 @@ class TestSuiteRunExecutionJsonOutput # @param output_variable_id [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::TestSuiteRunExecutionJsonOutput] - def initialize(name:, type:, value:, output_variable_id:, additional_properties: nil) + def initialize(name:, type:, value: OMIT, output_variable_id:, additional_properties: nil) @name = name @type = type - @value = value + @value = value if value != OMIT @output_variable_id = output_variable_id @additional_properties = additional_properties - @_field_set = { "name": name, "type": type, "value": value, "output_variable_id": output_variable_id } + @_field_set = { "name": name, "type": type, "value": value, "output_variable_id": output_variable_id }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of TestSuiteRunExecutionJsonOutput # @@ -70,7 +72,7 @@ def to_json def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_id is not the expected type, validation failed.") end end diff --git a/lib/vellum_ai/types/test_suite_run_metric_json_output.rb b/lib/vellum_ai/types/test_suite_run_metric_json_output.rb index 35d6344..af225f4 100644 --- a/lib/vellum_ai/types/test_suite_run_metric_json_output.rb +++ b/lib/vellum_ai/types/test_suite_run_metric_json_output.rb @@ -24,12 +24,14 @@ class TestSuiteRunMetricJsonOutput # @param name [String] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::TestSuiteRunMetricJsonOutput] - def initialize(value:, type:, name:, additional_properties: nil) - @value = value + def initialize(value: OMIT, type:, name:, additional_properties: nil) + @value = value if value != OMIT @type = type @name = name @additional_properties = additional_properties - @_field_set = { "value": value, "type": type, "name": name } + @_field_set = { "value": value, "type": type, "name": name }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of TestSuiteRunMetricJsonOutput # @@ -61,7 +63,7 @@ def to_json # @param obj [Object] # @return [Void] def self.validate_raw(obj:) - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end diff --git a/lib/vellum_ai/types/workflow_output_json.rb b/lib/vellum_ai/types/workflow_output_json.rb index 03bd848..5d78702 100644 --- a/lib/vellum_ai/types/workflow_output_json.rb +++ b/lib/vellum_ai/types/workflow_output_json.rb @@ -27,13 +27,15 @@ class WorkflowOutputJson # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::WorkflowOutputJson] - def initialize(id:, name:, type:, value:, additional_properties: nil) + def initialize(id:, name:, type:, value: OMIT, additional_properties: nil) @id = id @name = name @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties - @_field_set = { "id": id, "name": name, "type": type, "value": value } + @_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v | + v == OMIT +end end # Deserialize a JSON object to an instance of WorkflowOutputJson # @@ -70,7 +72,7 @@ def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/types/workflow_result_event_output_data_json.rb b/lib/vellum_ai/types/workflow_result_event_output_data_json.rb index e5dbc52..2762af4 100644 --- a/lib/vellum_ai/types/workflow_result_event_output_data_json.rb +++ b/lib/vellum_ai/types/workflow_result_event_output_data_json.rb @@ -39,14 +39,14 @@ class WorkflowResultEventOutputDataJson # @param value [Object] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [Vellum::WorkflowResultEventOutputDataJson] - def initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value:, additional_properties: nil) + def initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) @id = id if id != OMIT @name = name @state = state @node_id = node_id @delta = delta if delta != OMIT @type = type - @value = value + @value = value if value != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "name": name, "state": state, "node_id": node_id, "delta": delta, "type": type, "value": value }.reject do | _k, v | v == OMIT @@ -96,7 +96,7 @@ def self.validate_raw(obj:) obj.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.") obj.delta&.is_a?(String) != false || raise("Passed value for field obj.delta is not the expected type, validation failed.") obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") - obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") + obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end end end \ No newline at end of file diff --git a/lib/vellum_ai/workflow_deployments/client.rb b/lib/vellum_ai/workflow_deployments/client.rb index d9c9ef2..593c405 100644 --- a/lib/vellum_ai/workflow_deployments/client.rb +++ b/lib/vellum_ai/workflow_deployments/client.rb @@ -143,8 +143,8 @@ def list_workflow_deployment_event_executions(id:, filters: nil, limit: nil, off end Vellum::WorkflowDeploymentEventExecutionsResponse.from_json(json_object: response.body) end - # @param execution_id [String] # @param id [String] + # @param execution_id [String] # @param request_options [Vellum::RequestOptions] # @return [Vellum::WorkflowEventExecutionRead] # @example @@ -153,8 +153,8 @@ def list_workflow_deployment_event_executions(id:, filters: nil, limit: nil, off # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.workflow_deployments.workflow_deployment_event_execution(execution_id: "execution_id", id: "id") - def workflow_deployment_event_execution(execution_id:, id:, request_options: nil) +# api.workflow_deployments.workflow_deployment_event_execution(id: "id", execution_id: "execution_id") + def workflow_deployment_event_execution(id:, execution_id:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -174,7 +174,7 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{execution_id}/execution-events/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{id}/execution-events/#{execution_id}" end Vellum::WorkflowEventExecutionRead.from_json(json_object: response.body) end @@ -182,10 +182,10 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil # Please use the # `retrieve_workflow_deployment_release` endpoint instead. # + # @param id [String] Either the Workflow Deployment's ID or its unique name # @param history_id_or_release_tag [String] Either the UUID of Workflow Deployment History Item you'd like to retrieve, or # the name of a Release Tag that's pointing to the Workflow Deployment History # Item you'd like to retrieve. - # @param id [String] Either the Workflow Deployment's ID or its unique name # @param request_options [Vellum::RequestOptions] # @return [Vellum::WorkflowDeploymentHistoryItem] # @example @@ -194,8 +194,8 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.workflow_deployments.workflow_deployment_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def workflow_deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.workflow_deployments.workflow_deployment_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def workflow_deployment_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? req.options.timeout = request_options.timeout_in_seconds @@ -215,7 +215,7 @@ def workflow_deployment_history_item_retrieve(history_id_or_release_tag:, id:, r unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{id}/history/#{history_id_or_release_tag}" end Vellum::WorkflowDeploymentHistoryItem.from_json(json_object: response.body) end @@ -538,8 +538,8 @@ def list_workflow_deployment_event_executions(id:, filters: nil, limit: nil, off Vellum::WorkflowDeploymentEventExecutionsResponse.from_json(json_object: response.body) end end - # @param execution_id [String] # @param id [String] + # @param execution_id [String] # @param request_options [Vellum::RequestOptions] # @return [Vellum::WorkflowEventExecutionRead] # @example @@ -548,8 +548,8 @@ def list_workflow_deployment_event_executions(id:, filters: nil, limit: nil, off # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.workflow_deployments.workflow_deployment_event_execution(execution_id: "execution_id", id: "id") - def workflow_deployment_event_execution(execution_id:, id:, request_options: nil) +# api.workflow_deployments.workflow_deployment_event_execution(id: "id", execution_id: "execution_id") + def workflow_deployment_event_execution(id:, execution_id:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -570,7 +570,7 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{execution_id}/execution-events/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{id}/execution-events/#{execution_id}" end Vellum::WorkflowEventExecutionRead.from_json(json_object: response.body) end @@ -579,10 +579,10 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil # Please use the # `retrieve_workflow_deployment_release` endpoint instead. # + # @param id [String] Either the Workflow Deployment's ID or its unique name # @param history_id_or_release_tag [String] Either the UUID of Workflow Deployment History Item you'd like to retrieve, or # the name of a Release Tag that's pointing to the Workflow Deployment History # Item you'd like to retrieve. - # @param id [String] Either the Workflow Deployment's ID or its unique name # @param request_options [Vellum::RequestOptions] # @return [Vellum::WorkflowDeploymentHistoryItem] # @example @@ -591,8 +591,8 @@ def workflow_deployment_event_execution(execution_id:, id:, request_options: nil # environment: Vellum::Environment::PRODUCTION, # api_key: "YOUR_API_KEY" # ) -# api.workflow_deployments.workflow_deployment_history_item_retrieve(history_id_or_release_tag: "history_id_or_release_tag", id: "id") - def workflow_deployment_history_item_retrieve(history_id_or_release_tag:, id:, request_options: nil) +# api.workflow_deployments.workflow_deployment_history_item_retrieve(id: "id", history_id_or_release_tag: "history_id_or_release_tag") + def workflow_deployment_history_item_retrieve(id:, history_id_or_release_tag:, request_options: nil) Async do response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -613,7 +613,7 @@ def workflow_deployment_history_item_retrieve(history_id_or_release_tag:, id:, r unless request_options.nil? || request_options&.additional_body_parameters.nil? req.body = { **(request_options&.additional_body_parameters || {}) }.compact end - req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{history_id_or_release_tag}/history/#{id}" + req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-deployments/#{id}/history/#{history_id_or_release_tag}" end Vellum::WorkflowDeploymentHistoryItem.from_json(json_object: response.body) end diff --git a/lib/vellum_ai/workflows/client.rb b/lib/vellum_ai/workflows/client.rb index 34e9f38..2957e2b 100644 --- a/lib/vellum_ai/workflows/client.rb +++ b/lib/vellum_ai/workflows/client.rb @@ -38,6 +38,13 @@ def initialize(request_client:) # response environment. The latter will allow access to the response status, # headers and reason, as well as the request info. # @return [Void] + # @example +# api = Vellum::Client.new( +# base_url: "https://api.example.com", +# environment: Vellum::Environment::PRODUCTION, +# api_key: "YOUR_API_KEY" +# ) +# api.workflows.pull(id: "id") def pull(id:, exclude_code: nil, exclude_display: nil, include_json: nil, include_sandbox: nil, release_tag: nil, strict: nil, version: nil, request_options: nil, &on_data) response = @request_client.conn.get do | req | unless request_options&.timeout_in_seconds.nil? @@ -199,6 +206,13 @@ def initialize(request_client:) # response environment. The latter will allow access to the response status, # headers and reason, as well as the request info. # @return [Void] + # @example +# api = Vellum::Client.new( +# base_url: "https://api.example.com", +# environment: Vellum::Environment::PRODUCTION, +# api_key: "YOUR_API_KEY" +# ) +# api.workflows.pull(id: "id") def pull(id:, exclude_code: nil, exclude_display: nil, include_json: nil, include_sandbox: nil, release_tag: nil, strict: nil, version: nil, request_options: nil, &on_data) Async do response = @request_client.conn.get do | req | diff --git a/vellum_ai.gemspec b/vellum_ai.gemspec index 9cc3fda..7ba51c9 100644 --- a/vellum_ai.gemspec +++ b/vellum_ai.gemspec @@ -11,7 +11,7 @@ require_relative "lib/gemconfig" Gem::Specification.new do | spec | spec.name = "vellum_ai" - spec.version = "1.10.1" + spec.version = "0.3.3" spec.licenses = ["MIT"] spec.authors = Vellum::Gemconfig::AUTHORS spec.email = Vellum::Gemconfig::EMAIL