Class: Vellum::AsyncClient
- Inherits:
-
Object
- Object
- Vellum::AsyncClient
- Defined in:
- lib/vellum_ai.rb
Instance Attribute Summary collapse
- #ad_hoc ⇒ Vellum::AsyncAdHocClient readonly
- #container_images ⇒ Vellum::AsyncContainerImagesClient readonly
- #deployments ⇒ Vellum::AsyncDeploymentsClient readonly
- #document_indexes ⇒ Vellum::AsyncDocumentIndexesClient readonly
- #documents ⇒ Vellum::AsyncDocumentsClient readonly
- #environments ⇒ Vellum::AsyncEnvironmentsClient readonly
- #events ⇒ Vellum::AsyncEventsClient readonly
- #folder_entities ⇒ Vellum::AsyncFolderEntitiesClient readonly
- #integration_auth_configs ⇒ Vellum::AsyncIntegrationAuthConfigsClient readonly
- #integration_providers ⇒ Vellum::AsyncIntegrationProvidersClient readonly
- #integrations ⇒ Vellum::AsyncIntegrationsClient readonly
- #metric_definitions ⇒ Vellum::AsyncMetricDefinitionsClient readonly
- #ml_models ⇒ Vellum::AsyncMlModelsClient readonly
- #organizations ⇒ Vellum::AsyncOrganizationsClient readonly
- #prompts ⇒ Vellum::AsyncPromptsClient readonly
- #sandboxes ⇒ Vellum::AsyncSandboxesClient readonly
- #test_suite_runs ⇒ Vellum::AsyncTestSuiteRunsClient readonly
- #test_suites ⇒ Vellum::AsyncTestSuitesClient readonly
- #workflow_deployments ⇒ Vellum::AsyncWorkflowDeploymentsClient readonly
- #workflow_executions ⇒ Vellum::AsyncWorkflowExecutionsClient readonly
- #workflow_sandboxes ⇒ Vellum::AsyncWorkflowSandboxesClient readonly
- #workflows ⇒ Vellum::AsyncWorkflowsClient readonly
- #workspace_secrets ⇒ Vellum::AsyncWorkspaceSecretsClient readonly
- #workspaces ⇒ Vellum::AsyncWorkspacesClient readonly
Instance Method Summary collapse
-
#execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) ⇒ Object
api.execute_api(url: “x”).
-
#execute_code(code:, runtime:, input_values:, packages:, output_type:, request_options: nil) ⇒ Object
).
-
#execute_prompt(inputs:, prompt_deployment_id: nil, prompt_deployment_name: nil, release_tag: nil, external_id: nil, expand_meta: nil, raw_overrides: nil, expand_raw: nil, metadata: nil, request_options: nil) ⇒ Object
api.execute_prompt(inputs: [{ name: “x”, type: “STRING”, value: “value” }, { name: “x”, type: “STRING”, value: “value” }]).
-
#execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, previous_execution_id: nil, request_options: nil) ⇒ Object
api.execute_workflow(inputs: [{ name: “x”, type: “STRING”, value: “value” }, { name: “x”, type: “STRING”, value: “value” }]).
-
#generate(deployment_id: nil, deployment_name: nil, requests:, options: nil, request_options: nil) ⇒ Object
api.generate(requests: [{ input_values: { “input_values”: “key”:“value” } }, { input_values: { “input_values”: “key”:“value” } }]).
- #initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, api_key:, api_version: nil) ⇒ Vellum::AsyncClient constructor
-
#search(index_id: nil, index_name: nil, query:, options: nil, document_index: nil, request_options: nil) ⇒ Object
api.search(query: “x”).
-
#submit_completion_actuals(deployment_id: nil, deployment_name: nil, actuals:, request_options: nil) ⇒ Object
api.submit_completion_actuals(actuals: [{ }, { }]).
-
#submit_workflow_execution_actuals(actuals:, execution_id: nil, external_id: nil, request_options: nil) ⇒ Object
api.submit_workflow_execution_actuals(actuals: [{ output_type: “STRING” }, { output_type: “STRING” }]).
Constructor Details
#initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, api_key:, api_version: nil) ⇒ Vellum::AsyncClient
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/vellum_ai.rb', line 583 def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, api_key:, api_version: nil) @async_request_client = Vellum::AsyncRequestClient.new( base_url: base_url, environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, api_key: api_key, api_version: api_version ) @integrations = Vellum::AsyncIntegrationsClient.new(request_client: @async_request_client) @events = Vellum::AsyncEventsClient.new(request_client: @async_request_client) @ad_hoc = Vellum::AsyncAdHocClient.new(request_client: @async_request_client) @container_images = Vellum::AsyncContainerImagesClient.new(request_client: @async_request_client) @deployments = Vellum::AsyncDeploymentsClient.new(request_client: @async_request_client) @document_indexes = Vellum::AsyncDocumentIndexesClient.new(request_client: @async_request_client) @documents = Vellum::AsyncDocumentsClient.new(request_client: @async_request_client) @environments = Vellum::AsyncEnvironmentsClient.new(request_client: @async_request_client) @folder_entities = Vellum::AsyncFolderEntitiesClient.new(request_client: @async_request_client) @integration_auth_configs = Vellum::AsyncIntegrationAuthConfigsClient.new(request_client: @async_request_client) @integration_providers = Vellum::AsyncIntegrationProvidersClient.new(request_client: @async_request_client) @metric_definitions = Vellum::AsyncMetricDefinitionsClient.new(request_client: @async_request_client) @ml_models = Vellum::AsyncMlModelsClient.new(request_client: @async_request_client) @organizations = Vellum::AsyncOrganizationsClient.new(request_client: @async_request_client) @prompts = Vellum::AsyncPromptsClient.new(request_client: @async_request_client) @sandboxes = Vellum::AsyncSandboxesClient.new(request_client: @async_request_client) @test_suite_runs = Vellum::AsyncTestSuiteRunsClient.new(request_client: @async_request_client) @test_suites = Vellum::AsyncTestSuitesClient.new(request_client: @async_request_client) @workflow_deployments = Vellum::AsyncWorkflowDeploymentsClient.new(request_client: @async_request_client) @workflow_executions = Vellum::AsyncWorkflowExecutionsClient.new(request_client: @async_request_client) @workflow_sandboxes = Vellum::AsyncWorkflowSandboxesClient.new(request_client: @async_request_client) @workflows = Vellum::AsyncWorkflowsClient.new(request_client: @async_request_client) @workspace_secrets = Vellum::AsyncWorkspaceSecretsClient.new(request_client: @async_request_client) @workspaces = Vellum::AsyncWorkspacesClient.new(request_client: @async_request_client) end |
Instance Attribute Details
#ad_hoc ⇒ Vellum::AsyncAdHocClient (readonly)
531 532 533 |
# File 'lib/vellum_ai.rb', line 531 def ad_hoc @ad_hoc end |
#container_images ⇒ Vellum::AsyncContainerImagesClient (readonly)
533 534 535 |
# File 'lib/vellum_ai.rb', line 533 def container_images @container_images end |
#deployments ⇒ Vellum::AsyncDeploymentsClient (readonly)
535 536 537 |
# File 'lib/vellum_ai.rb', line 535 def deployments @deployments end |
#document_indexes ⇒ Vellum::AsyncDocumentIndexesClient (readonly)
537 538 539 |
# File 'lib/vellum_ai.rb', line 537 def document_indexes @document_indexes end |
#documents ⇒ Vellum::AsyncDocumentsClient (readonly)
539 540 541 |
# File 'lib/vellum_ai.rb', line 539 def documents @documents end |
#environments ⇒ Vellum::AsyncEnvironmentsClient (readonly)
541 542 543 |
# File 'lib/vellum_ai.rb', line 541 def environments @environments end |
#events ⇒ Vellum::AsyncEventsClient (readonly)
529 530 531 |
# File 'lib/vellum_ai.rb', line 529 def events @events end |
#folder_entities ⇒ Vellum::AsyncFolderEntitiesClient (readonly)
543 544 545 |
# File 'lib/vellum_ai.rb', line 543 def folder_entities @folder_entities end |
#integration_auth_configs ⇒ Vellum::AsyncIntegrationAuthConfigsClient (readonly)
545 546 547 |
# File 'lib/vellum_ai.rb', line 545 def integration_auth_configs @integration_auth_configs end |
#integration_providers ⇒ Vellum::AsyncIntegrationProvidersClient (readonly)
547 548 549 |
# File 'lib/vellum_ai.rb', line 547 def integration_providers @integration_providers end |
#integrations ⇒ Vellum::AsyncIntegrationsClient (readonly)
527 528 529 |
# File 'lib/vellum_ai.rb', line 527 def integrations @integrations end |
#metric_definitions ⇒ Vellum::AsyncMetricDefinitionsClient (readonly)
549 550 551 |
# File 'lib/vellum_ai.rb', line 549 def metric_definitions @metric_definitions end |
#ml_models ⇒ Vellum::AsyncMlModelsClient (readonly)
551 552 553 |
# File 'lib/vellum_ai.rb', line 551 def ml_models @ml_models end |
#organizations ⇒ Vellum::AsyncOrganizationsClient (readonly)
553 554 555 |
# File 'lib/vellum_ai.rb', line 553 def organizations @organizations end |
#prompts ⇒ Vellum::AsyncPromptsClient (readonly)
555 556 557 |
# File 'lib/vellum_ai.rb', line 555 def prompts @prompts end |
#sandboxes ⇒ Vellum::AsyncSandboxesClient (readonly)
557 558 559 |
# File 'lib/vellum_ai.rb', line 557 def sandboxes @sandboxes end |
#test_suite_runs ⇒ Vellum::AsyncTestSuiteRunsClient (readonly)
559 560 561 |
# File 'lib/vellum_ai.rb', line 559 def test_suite_runs @test_suite_runs end |
#test_suites ⇒ Vellum::AsyncTestSuitesClient (readonly)
561 562 563 |
# File 'lib/vellum_ai.rb', line 561 def test_suites @test_suites end |
#workflow_deployments ⇒ Vellum::AsyncWorkflowDeploymentsClient (readonly)
563 564 565 |
# File 'lib/vellum_ai.rb', line 563 def workflow_deployments @workflow_deployments end |
#workflow_executions ⇒ Vellum::AsyncWorkflowExecutionsClient (readonly)
565 566 567 |
# File 'lib/vellum_ai.rb', line 565 def workflow_executions @workflow_executions end |
#workflow_sandboxes ⇒ Vellum::AsyncWorkflowSandboxesClient (readonly)
567 568 569 |
# File 'lib/vellum_ai.rb', line 567 def workflow_sandboxes @workflow_sandboxes end |
#workflows ⇒ Vellum::AsyncWorkflowsClient (readonly)
569 570 571 |
# File 'lib/vellum_ai.rb', line 569 def workflows @workflows end |
#workspace_secrets ⇒ Vellum::AsyncWorkspaceSecretsClient (readonly)
571 572 573 |
# File 'lib/vellum_ai.rb', line 571 def workspace_secrets @workspace_secrets end |
#workspaces ⇒ Vellum::AsyncWorkspacesClient (readonly)
573 574 575 |
# File 'lib/vellum_ai.rb', line 573 def workspaces @workspaces end |
Instance Method Details
#execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil) ⇒ Object
api.execute_api(url: “x”)
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/vellum_ai.rb', line 631 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 &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.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: )}/v1/execute-api" end Vellum::ExecuteApiResponse.from_json(json_object: response.body) end |
#execute_code(code:, runtime:, input_values:, packages:, output_type:, request_options: nil) ⇒ Object
)
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
# File 'lib/vellum_ai.rb', line 676 def execute_code(code:, runtime:, input_values:, packages:, output_type:, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), code: code, runtime: runtime, input_values: input_values, packages: packages, output_type: output_type }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/execute-code" end Vellum::CodeExecutorResponse.from_json(json_object: response.body) end |
#execute_prompt(inputs:, prompt_deployment_id: nil, prompt_deployment_name: nil, release_tag: nil, external_id: nil, expand_meta: nil, raw_overrides: nil, expand_raw: nil, metadata: nil, request_options: nil) ⇒ Object
api.execute_prompt(inputs: [{ name: “x”, type: “STRING”, value: “value” }, { name: “x”, type: “STRING”, value: “value” }])
740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 |
# File 'lib/vellum_ai.rb', line 740 def execute_prompt(inputs:, prompt_deployment_id: nil, prompt_deployment_name: nil, release_tag: nil, external_id: nil, expand_meta: nil, raw_overrides: nil, expand_raw: nil, metadata: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), inputs: inputs, prompt_deployment_id: prompt_deployment_id, prompt_deployment_name: prompt_deployment_name, release_tag: release_tag, external_id: external_id, expand_meta: , raw_overrides: raw_overrides, expand_raw: , metadata: }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/execute-prompt" end Vellum::ExecutePromptResponse.from_json(json_object: response.body) end |
#execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, previous_execution_id: nil, request_options: nil) ⇒ Object
api.execute_workflow(inputs: [{ name: “x”, type: “STRING”, value: “value” }, { name: “x”, type: “STRING”, value: “value” }])
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 |
# File 'lib/vellum_ai.rb', line 794 def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, previous_execution_id: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), inputs: inputs, expand_meta: , workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: , previous_execution_id: previous_execution_id }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/execute-workflow" end Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body) end |
#generate(deployment_id: nil, deployment_name: nil, requests:, options: nil, request_options: nil) ⇒ Object
api.generate(requests: [{ input_values: { “input_values”: “key”:“value” } }, { input_values: { “input_values”: “key”:“value” } }])
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 |
# File 'lib/vellum_ai.rb', line 839 def generate(deployment_id: nil, deployment_name: nil, requests:, options: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, requests: requests, options: }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/generate" end Vellum::GenerateResponse.from_json(json_object: response.body) end |
#search(index_id: nil, index_name: nil, query:, options: nil, document_index: nil, request_options: nil) ⇒ Object
api.search(query: “x”)
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 |
# File 'lib/vellum_ai.rb', line 889 def search(index_id: nil, index_name: nil, query:, options: nil, document_index: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), index_id: index_id, index_name: index_name, query: query, options: , document_index: document_index }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/search" end Vellum::SearchResponse.from_json(json_object: response.body) end |
#submit_completion_actuals(deployment_id: nil, deployment_name: nil, actuals:, request_options: nil) ⇒ Object
api.submit_completion_actuals(actuals: [{ }, { }])
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 |
# File 'lib/vellum_ai.rb', line 932 def submit_completion_actuals(deployment_id: nil, deployment_name: nil, actuals:, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, actuals: actuals }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/submit-completion-actuals" end end |
#submit_workflow_execution_actuals(actuals:, execution_id: nil, external_id: nil, request_options: nil) ⇒ Object
api.submit_workflow_execution_actuals(actuals: [{ output_type: “STRING” }, { output_type: “STRING” }])
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 |
# File 'lib/vellum_ai.rb', line 972 def submit_workflow_execution_actuals(actuals:, execution_id: nil, external_id: nil, request_options: nil) response = @async_request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), actuals: actuals, execution_id: execution_id, external_id: external_id }.compact req.url "#{@async_request_client.get_url(environment: Predict, request_options: )}/v1/submit-workflow-execution-actuals" end end |