class Vellum::AsyncRegisteredPromptsClient
def initialize(request_client:)
-
(AsyncRegisteredPromptsClient)-
Parameters:
-
request_client(AsyncRequestClient) --
def initialize(request_client:) # @type [AsyncRequestClient] @request_client = request_client end
def register_prompt(label:, name:, prompt:, model:, parameters:, provider: nil, meta: nil, request_options: nil)
-
(RegisterPromptResponse)-
Parameters:
-
request_options(RequestOptions) -- -
meta(Hash{String => String}) -- Optionally include additional metadata to store along with the prompt. -
parameters(Hash) -- The initial model parameters to use for this promptRequest of type RegisterPromptModelParametersRequest, as a Hash -
model(String) -- The initial model to use for this prompt -
provider(PROVIDER_ENUM) -- The initial LLM provider to use for this prompt -
prompt(Hash) -- Information about how to execute the prompt template.Request of type RegisterPromptPromptInfoRequest, as a Hash -
name(String) -- A uniquely-identifying name for corresponding entities created in Vellum. -
label(String) -- A human-friendly label for corresponding entities created in Vellum.
def register_prompt(label:, name:, prompt:, model:, parameters:, provider: nil, meta: nil, request_options: nil) Async do response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil? req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact req.body = { **(request_options&.additional_body_parameters || {}), label: label, name: name, prompt: prompt, provider: provider, model: model, parameters: parameters, meta: meta }.compact req.url "#{@request_client.default_environment[:Default]}/v1/registered-prompts/register" end RegisterPromptResponse.from_json(json_object: response.body) end end