{"openapi":"3.1.0","info":{"title":"API","version":"1.0.0"},"paths":{"/prompts/log":{"post":{"operationId":"prompts_log","summary":"Log to a Prompt","description":"Log to a Prompt.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Prompt. Otherwise, the default deployed version will be chosen.\n\nInstead of targeting an existing version explicitly, you can instead pass in\nPrompt details in the request body. In this case, we will check if the details correspond\nto an existing version of the Prompt. If they do not, we will create a new version. This is helpful\nin the case where you are storing or deriving your Prompt details in code.","tags":["Prompts"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Prompt to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","description":"Unique identifier for the Run to associate the Log to."},"path":{"type":"string","description":"Path of the Prompt, including the name. This locates the Prompt in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Prompt."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/prompts_PromptLogRequestToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"prompt":{"$ref":"#/components/schemas/prompts_PromptLogRequestPrompt","description":"The Prompt configuration to use. Two formats are supported:\n- An object representing the details of the Prompt configuration\n- A string representing the raw contents of a .prompt file\n\nA new Prompt version will be created if the provided details do not match any existing version."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."}}}}}},"security":[{"default":[]}]}},"/prompts/{id}/log/{log_id}":{"patch":{"operationId":"prompts_updateLog","summary":"Update Prompt Log","description":"Update a Log.\n\nUpdate the details of a Log with the given ID.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"log_id","in":"path","description":"Unique identifier for the Log.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/prompts_PromptLogUpdateRequestToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."}}}}}},"security":[{"default":[]}]}},"/prompts/call":{"post":{"operationId":"prompts_call_stream","summary":"Call Prompt","description":"Call a Prompt.\n\nCalling a Prompt calls the model provider before logging\nthe request, responses and metadata to Humanloop.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Prompt. Otherwise the default deployed version will be chosen.\n\nInstead of targeting an existing version explicitly, you can instead pass in\nPrompt details in the request body. In this case, we will check if the details correspond\nto an existing version of the Prompt. If they do not, we will create a new version. This is helpful\nin the case where you are storing or deriving your Prompt details in code.","tags":["Prompts"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Prompt to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/PromptCallStreamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Prompt, including the name. This locates the Prompt in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Prompt."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/prompts_PromptsCallStreamRequestToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"prompt":{"$ref":"#/components/schemas/prompts_PromptsCallStreamRequestPrompt","description":"The Prompt configuration to use. Two formats are supported:\n- An object representing the details of the Prompt configuration\n- A string representing the raw contents of a .prompt file\n\nA new Prompt version will be created if the provided details do not match any existing version."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"provider_api_keys":{"$ref":"#/components/schemas/ProviderApiKeys","description":"API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization."},"num_samples":{"type":"integer","default":1,"description":"The number of generations."},"stream":{"type":"boolean","enum":[true],"description":"If true, tokens will be sent as data-only server-sent events. If num_samples > 1, samples are streamed back independently."},"return_inputs":{"type":"boolean","default":true,"description":"Whether to return the inputs in the response. If false, the response will contain an empty dictionary under inputs. This is useful for reducing the size of the response. Defaults to true."},"logprobs":{"type":"integer","description":"Include the log probabilities of the top n tokens in the provider_response"},"suffix":{"type":"string","description":"The suffix that comes after a completion of inserted text. Useful for completions that act like inserts."}},"required":["stream"]}}}},"security":[{"default":[]}]}},"/prompts":{"get":{"operationId":"prompts_list","summary":"List Prompts","description":"Get a list of all Prompts.","tags":["Prompts"],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Prompts to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Prompt name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Prompt. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Prompts by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataPromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"prompts_upsert","summary":"Upsert Prompt","description":"Create a Prompt or update it with a new version if it already exists.\n\nPrompts are identified by the `ID` or their `path`. The parameters (i.e. the prompt template, temperature, model etc.) determine the versions of the Prompt.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within a Prompt - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.","tags":["Prompts"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Prompt, including the name. This locates the Prompt in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Prompt."},"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/prompts_PromptRequestTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/prompts_PromptRequestStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/prompts_PromptRequestReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolFunction"},"description":"The tool specification that the model can choose to call if Tool calling is supported."},"linked_tools":{"type":"array","items":{"type":"string"},"description":"The IDs of the Tools in your organization that the model can choose to call if Tool calling is supported. The default deployed version of that tool is called."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"version_name":{"type":"string","description":"Unique name for the Prompt version. Version names must be unique for a given Prompt."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"description":{"type":"string","description":"Description of the Prompt."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with this prompt."},"readme":{"type":"string","description":"Long description of the Prompt."}},"required":["model"]}}}},"security":[{"default":[]}]}},"/prompts/{id}":{"get":{"operationId":"prompts_get","summary":"Get Prompt","description":"Retrieve the Prompt with the given ID.\n\nBy default, the deployed version of the Prompt is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Prompt to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"prompts_delete","summary":"Delete Prompt","description":"Delete the Prompt with the given ID.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"prompts_move","summary":"Move Prompt","description":"Move the Prompt to a different path or change the name.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Prompt including the Prompt name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Prompt."}}}}}},"security":[{"default":[]}]}},"/prompts/{id}/populate":{"post":{"operationId":"prompts_populate","summary":"Populate Prompt template","description":"Retrieve the Prompt with the given ID, including the populated template.\n\nBy default, the deployed version of the Prompt is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Prompt to retrieve to populate the template.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from to populate the template.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulateTemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}},"security":[{"default":[]}]}},"/prompts/{id}/versions":{"get":{"operationId":"prompts_listVersions","summary":"List Versions of a Prompt","description":"Get a list of all the versions of a Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"evaluator_aggregates","in":"query","description":"Whether to include Evaluator aggregate results for the versions in the response","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPrompts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/prompts/{id}/versions/{version_id}":{"delete":{"operationId":"prompts_deletePromptVersion","summary":"Delete Prompt Version","description":"Delete a version of the Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"prompts_patchPromptVersion","summary":"Update Prompt Version","description":"Update the name or description of the Prompt version.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/prompts/{id}/environments/{environment_id}":{"post":{"operationId":"prompts_setDeployment","summary":"Deploy Prompt","description":"Deploy Prompt to an Environment.\n\nSet the deployed version for the specified Environment. This Prompt\nwill be used for calls made to the Prompt in this Environment.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"prompts_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Prompt from the Environment.\n\nRemove the deployed version for the specified Environment. This Prompt\nwill no longer be used for calls made to the Prompt in this Environment.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/prompts/{id}/environments":{"get":{"operationId":"prompts_listEnvironments","summary":"List a Prompt's Environments","description":"List all Environments and their deployed versions for the Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/prompts/{id}/evaluators":{"post":{"operationId":"prompts_updateMonitoring","summary":"Update Monitoring","description":"Activate and deactivate Evaluators for monitoring the Prompt.\n\nAn activated Evaluator will automatically be run on all new Logs\nwithin the Prompt for monitoring purposes.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequest"}}}},"security":[{"default":[]}]}},"/prompts/{id}/serialize":{"get":{"operationId":"prompts_serialize","summary":"Serialize","description":"Serialize a Prompt to the .prompt file format.\n\nUseful for storing the Prompt with your code in a version control system,\nor for editing with an AI tool.\n\nBy default, the deployed version of the Prompt is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Prompt.","tags":["Prompts"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Prompt to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response with status 200","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/prompts/deserialize":{"post":{"operationId":"prompts_deserialize","summary":"Deserialize","description":"Deserialize a Prompt from the .prompt file format.\n\nThis returns a subset of the attributes required by a Prompt.\nThis subset is the bit that defines the Prompt version (e.g. with `model` and `temperature` etc)","tags":["Prompts"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptKernelRequest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"}},"required":["prompt"]}}}},"security":[{"default":[]}]}},"/agents/log":{"post":{"operationId":"agents_log","summary":"Log to an Agent","description":"Create an Agent Log.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Agent. Otherwise, the default deployed version will be chosen.\n\nIf you create the Agent Log with a `log_status` of `incomplete`, you should later update it to `complete`\nin order to trigger Evaluators.","tags":["agents"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Agent to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","description":"Unique identifier for the Run to associate the Log to."},"path":{"type":"string","description":"Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Agent."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/agents_AgentLogRequestToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"agent":{"$ref":"#/components/schemas/agents_AgentLogRequestAgent","description":"The Agent configuration to use. Two formats are supported:\n- An object representing the details of the Agent configuration\n- A string representing the raw contents of a .agent file\n\nA new Agent version will be created if the provided details do not match any existing version."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."}}}}}},"security":[{"default":[]}]}},"/agents/{id}/log/{log_id}":{"patch":{"operationId":"agents_updateLog","summary":"Update Agent Log","description":"Update a Log.\n\nUpdate the details of a Log with the given ID.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"log_id","in":"path","description":"Unique identifier for the Log.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages that were used as an input to the Flow."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The output message returned by this Flow."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the Flow Log."},"output":{"type":"string","description":"The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`."},"error":{"type":"string","description":"The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`."}}}}}},"security":[{"default":[]}]}},"/agents/call":{"post":{"operationId":"agents_call_stream","summary":"Call Agent","description":"Call an Agent. The Agent will run on the Humanloop runtime and return a completed Agent Log.\n\nIf the Agent requires a tool call that cannot be ran by Humanloop, execution will halt. To continue,\npass the ID of the incomplete Log and the required tool call to the /agents/continue endpoint.\n\nThe agent will run for the maximum number of iterations, or until it encounters a stop condition,\naccording to its configuration.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Agent. Otherwise the default deployed version will be chosen.\n\nInstead of targeting an existing version explicitly, you can instead pass in\nAgent details in the request body. A new version is created if it does not match\nany existing ones. This is helpful in the case where you are storing or deriving\nyour Agent details in code.","tags":["agents"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Agent to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/AgentCallStreamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Agent."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/agents_AgentsCallStreamRequestToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"agent":{"$ref":"#/components/schemas/agents_AgentsCallStreamRequestAgent","description":"The Agent configuration to use. Two formats are supported:\n- An object representing the details of the Agent configuration\n- A string representing the raw contents of a .agent file\n\nA new Agent version will be created if the provided details do not match any existing version."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"provider_api_keys":{"$ref":"#/components/schemas/ProviderApiKeys","description":"API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization."},"stream":{"type":"boolean","enum":[true],"description":"If true, Agent events and tokens will be sent as data-only server-sent events."},"return_inputs":{"type":"boolean","default":true,"description":"Whether to return the inputs in the response. If false, the response will contain an empty dictionary under inputs. This is useful for reducing the size of the response. Defaults to true."},"include_trace_children":{"type":"boolean","default":false,"description":"If true, populate `trace_children` for the returned Agent Log. Only applies when not streaming. Defaults to false."}},"required":["stream"]}}}},"security":[{"default":[]}]}},"/agents/continue":{"post":{"operationId":"agents_continue_call_stream","summary":"Continue Agent Call","description":"Continue an incomplete Agent call.\n\nThis endpoint allows continuing an existing incomplete Agent call, by passing the tool call\nrequested by the Agent. The Agent will resume processing from where it left off.\n\nThe messages in the request will be appended to the original messages in the Log. You do not\nhave to provide the previous conversation history.\n\nThe original log must be in an incomplete state to be continued.","tags":["agents"],"responses":{"200":{"description":"","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/AgentContinueCallStreamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"log_id":{"type":"string","description":"This identifies the Agent Log to continue."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The additional messages with which to continue the Agent Log. Often, these should start with the Tool messages with results for the previous Assistant message's tool calls."},"provider_api_keys":{"$ref":"#/components/schemas/ProviderApiKeys","description":"API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization."},"stream":{"type":"boolean","enum":[true],"description":"If true, packets will be sent as data-only server-sent events."},"include_trace_children":{"type":"boolean","default":false,"description":"If true, populate `trace_children` for the returned Agent Log. Defaults to false."}},"required":["log_id","messages","stream"]}}}},"security":[{"default":[]}]}},"/agents":{"get":{"operationId":"agents_list","summary":"List Agents","description":"Get a list of all Agents.","tags":["agents"],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Agents to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Agent name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Agent. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Agents by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataAgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"agents_upsert","summary":"Upsert Agent","description":"Create an Agent or update it with a new version if it already exists.\n\nAgents are identified by the `ID` or their `path`. The parameters (i.e. the template, temperature, model etc.) and\ntools determine the versions of the Agent.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within an Agent - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.","tags":["agents"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Agent."},"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/agents_AgentRequestTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/agents_AgentRequestStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/agents_AgentRequestReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/agents_AgentRequestToolsItem"}},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"max_iterations":{"type":"integer","description":"The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called."},"version_name":{"type":"string","description":"Unique name for the Prompt version. Each Prompt can only have one version with a given name."},"version_description":{"type":"string","description":"Description of the Version."},"description":{"type":"string","description":"Description of the Prompt."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with this prompt."},"readme":{"type":"string","description":"Long description of the Prompt."}},"required":["model"]}}}},"security":[{"default":[]}]}},"/agents/{id}/versions/{version_id}":{"delete":{"operationId":"agents_deleteAgentVersion","summary":"Delete Agent Version","description":"Delete a version of the Agent.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"agents_patchAgentVersion","summary":"Update Agent Version","description":"Update the name or description of the Agent version.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/agents/{id}":{"get":{"operationId":"agents_get","summary":"Get Agent","description":"Retrieve the Agent with the given ID.\n\nBy default, the deployed version of the Agent is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Agent.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Agent to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"agents_delete","summary":"Delete Agent","description":"Delete the Agent with the given ID.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"agents_move","summary":"Move Agent","description":"Move the Agent to a different path or change the name.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Flow including the Flow name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Flow."},"directory_id":{"type":"string","description":"Unique identifier for the Directory to move Flow to. Starts with `dir_`."}}}}}},"security":[{"default":[]}]}},"/agents/{id}/versions":{"get":{"operationId":"agents_listVersions","summary":"List Versions of a Agent","description":"Get a list of all the versions of a Agent.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"evaluator_aggregates","in":"query","description":"Whether to include Evaluator aggregate results for the versions in the response","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgents"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/agents/{id}/environments/{environment_id}":{"post":{"operationId":"agents_setDeployment","summary":"Deploy Agent","description":"Deploy Agent to an Environment.\n\nSet the deployed version for the specified Environment. This Agent\nwill be used for calls made to the Agent in this Environment.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"agents_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Agent from the Environment.\n\nRemove the deployed version for the specified Environment. This Agent\nwill no longer be used for calls made to the Agent in this Environment.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/agents/{id}/environments":{"get":{"operationId":"agents_listEnvironments","summary":"List an Agent's Environments","description":"List all Environments and their deployed versions for the Agent.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/agents/{id}/evaluators":{"post":{"operationId":"agents_updateMonitoring","summary":"Update Monitoring","description":"Activate and deactivate Evaluators for monitoring the Agent.\n\nAn activated Evaluator will automatically be run on all new Logs\nwithin the Agent for monitoring purposes.","tags":["agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequest"}}}},"security":[{"default":[]}]}},"/agents/{id}/serialize":{"get":{"operationId":"agents_serialize","summary":"Serialize","description":"Serialize an Agent to the .agent file format.\n\nUseful for storing the Agent with your code in a version control system,\nor for editing with an AI tool.\n\nBy default, the deployed version of the Agent is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Agent.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Agent.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Agent to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response with status 200","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/agents/deserialize":{"post":{"operationId":"agents_deserialize","summary":"Deserialize","description":"Deserialize an Agent from the .agent file format.\n\nThis returns a subset of the attributes required by an Agent.\nThis subset is the bit that defines the Agent version (e.g. with `model` and `temperature` etc)","tags":["agents"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKernelRequest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"string"}},"required":["agent"]}}}},"security":[{"default":[]}]}},"/flows/log":{"post":{"operationId":"flows_log","summary":"Log to a Flow","description":"Log to a Flow.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Flow. Otherwise, the default deployed version will be chosen.","tags":["flows"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Flow to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages that were used as an input to the Flow."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The output message returned by this Flow."},"run_id":{"type":"string","description":"Unique identifier for the Run to associate the Log to."},"path":{"type":"string","description":"Path of the Flow, including the name. This locates the Flow in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Flow."},"start_time":{"type":"string","format":"date-time","description":"The start time of the Trace. Will be updated if a child Log with an earlier start time is added."},"end_time":{"type":"string","format":"date-time","description":"The end time of the Trace. Will be updated if a child Log with a later end time is added."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Flow Log. When a Log is updated from `incomplete` to `complete`, no more Logs can be added to it."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"flow":{"$ref":"#/components/schemas/FlowKernelRequest","description":"Flow used to generate the Trace."}}}}}},"security":[{"default":[]}]}},"/flows/logs/{log_id}":{"patch":{"operationId":"flows_updateLog","summary":"Update Flow Log","description":"Update the status, inputs, output of a Flow Log.\n\nMarking a Flow Log as complete will trigger any monitoring Evaluators to run.\nInputs and output (or error) must be provided in order to mark it as complete.\n\nThe end_time log attribute will be set to match the time the log is marked as complete.","tags":["flows"],"parameters":[{"name":"log_id","in":"path","description":"Unique identifier of the Flow Log.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages that were used as an input to the Flow."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The output message returned by this Flow."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the Flow Log."},"output":{"type":"string","description":"The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`."},"error":{"type":"string","description":"The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`."}}}}}},"security":[{"default":[]}]}},"/flows/{id}":{"get":{"operationId":"flows_get","summary":"Get Flow","description":"Retrieve the Flow with the given ID.\n\nBy default, the deployed version of the Flow is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Flow.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Flow to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"flows_delete","summary":"Delete Flow","description":"Delete the Flow with the given ID.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"flows_move","summary":"Move Flow","description":"Move the Flow to a different path or change the name.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Flow including the Flow name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Flow."},"directory_id":{"type":"string","description":"Unique identifier for the Directory to move Flow to. Starts with `dir_`."}}}}}},"security":[{"default":[]}]}},"/flows":{"get":{"operationId":"flows_list","summary":"List Flows","description":"Get a list of Flows.","tags":["flows"],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Flows to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Flow name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Flow. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Flows by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataFlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"flows_upsert","summary":"Upsert Flow","description":"Create or update a Flow.\n\nFlows can also be identified by the `ID` or their `path`.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within a Flow - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.","tags":["flows"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Flow, including the name. This locates the Flow in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Flow."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"A key-value object identifying the Flow Version."},"version_name":{"type":"string","description":"Unique name for the Flow version. Version names must be unique for a given Flow."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."}},"required":["attributes"]}}}},"security":[{"default":[]}]}},"/flows/{id}/versions":{"get":{"operationId":"flows_listVersions","summary":"List Versions of a Flow","description":"Get a list of all the versions of a Flow.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"evaluator_aggregates","in":"query","description":"Whether to include Evaluator aggregate results for the versions in the response","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlows"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/flows/{id}/versions/{version_id}":{"delete":{"operationId":"flows_deleteFlowVersion","summary":"Delete Flow Version","description":"Delete a version of the Flow.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"flows_updateFlowVersion","summary":"Update Flow Version","description":"Update the name or description of the Flow version.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/flows/{id}/environments/{environment_id}":{"post":{"operationId":"flows_setDeployment","summary":"Deploy Flow","description":"Deploy Flow to an Environment.\n\nSet the deployed version for the specified Environment. This Flow\nwill be used for calls made to the Flow in this Environment.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"flows_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Flow from the Environment.\n\nRemove the deployed version for the specified Environment. This Flow\nwill no longer be used for calls made to the Flow in this Environment.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/flows/{id}/environments":{"get":{"operationId":"flows_listEnvironments","summary":"List a Flow's Environments","description":"List all Environments and their deployed versions for the Flow.","tags":["flows"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Flow.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/flows/{id}/evaluators":{"post":{"operationId":"flows_updateMonitoring","summary":"Update Monitoring","description":"Activate and deactivate Evaluators for monitoring the Flow.\n\nAn activated Evaluator will automatically be run on all new \"completed\" Logs\nwithin the Flow for monitoring purposes.","tags":["flows"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequest"}}}},"security":[{"default":[]}]}},"/evaluators/log":{"post":{"operationId":"evaluators_log","summary":"Submit Evaluator Judgment","description":"Submit Evaluator judgment for an existing Log.\n\nCreates a new Log. The evaluated Log will be set as the parent of the created Log.","tags":["evaluators"],"parameters":[{"name":"version_id","in":"query","description":"ID of the Evaluator version to log against.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEvaluatorLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Evaluator, including the name. This locates the Evaluator in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Evaluator."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from the LLM. Only populated for LLM Evaluator Logs."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider. Only populated for LLM Evaluator Logs."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider. Only populated for LLM Evaluator Logs."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"parent_id":{"type":"string","description":"Identifier of the evaluated Log. The newly created Log will have this one set as parent."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the LLM. Only populated for LLM Evaluator Logs."},"judgment":{"$ref":"#/components/schemas/evaluators_CreateEvaluatorLogRequestJudgment","description":"Evaluator assessment of the Log."},"marked_completed":{"type":"boolean","description":"Whether the Log has been manually marked as completed by a user."},"spec":{"$ref":"#/components/schemas/evaluators_CreateEvaluatorLogRequestSpec"}},"required":["parent_id"]}}}},"security":[{"default":[]}]}},"/evaluators":{"get":{"operationId":"evaluators_list","summary":"List Evaluators","description":"Get a list of all Evaluators.","tags":["evaluators"],"parameters":[{"name":"page","in":"query","description":"Page offset for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Evaluators to fetch.","required":false,"schema":{"type":"integer","default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Evaluator name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Evaluator. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Evaluators by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataEvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"evaluators_upsert","summary":"Upsert Evaluator","description":"Create an Evaluator or update it with a new version if it already exists.\n\nEvaluators are identified by the `ID` or their `path`. The spec provided determines the version of the Evaluator.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within an Evaluator - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.","tags":["evaluators"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Evaluator, including the name. This locates the Evaluator in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Evaluator."},"version_name":{"type":"string","description":"Unique name for the Evaluator version. Version names must be unique for a given Evaluator."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"spec":{"$ref":"#/components/schemas/evaluators_EvaluatorRequestSpec"}},"required":["spec"]}}}},"security":[{"default":[]}]}},"/evaluators/{id}":{"get":{"operationId":"evaluators_get","summary":"Get Evaluator","description":"Retrieve the Evaluator with the given ID.\n\nBy default, the deployed version of the Evaluator is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Evaluator.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Evaluator to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"evaluators_delete","summary":"Delete Evaluator","description":"Delete the Evaluator with the given ID.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"evaluators_move","summary":"Move Evaluator","description":"Move the Evaluator to a different path or change the name.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Evaluator including the Evaluator name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Evaluator, which is used as a unique identifier."}}}}}},"security":[{"default":[]}]}},"/evaluators/{id}/versions":{"get":{"operationId":"evaluators_listVersions","summary":"List Versions of an Evaluator","description":"Get a list of all the versions of an Evaluator.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for the Evaluator.","required":true,"schema":{"type":"string"}},{"name":"evaluator_aggregates","in":"query","description":"Whether to include Evaluator aggregate results for the versions in the response","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEvaluators"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluators/{id}/versions/{version_id}":{"delete":{"operationId":"evaluators_deleteEvaluatorVersion","summary":"Delete Evaluator Version","description":"Delete a version of the Evaluator.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"evaluators_updateEvaluatorVersion","summary":"Update Evaluator Version","description":"Update the name or description of the Evaluator version.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/evaluators/{id}/environments/{environment_id}":{"post":{"operationId":"evaluators_setDeployment","summary":"Deploy Evaluator","description":"Deploy Evaluator to an Environment.\n\nSet the deployed version for the specified Environment. This Evaluator\nwill be used for calls made to the Evaluator in this Environment.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"evaluators_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Evaluator from the Environment.\n\nRemove the deployed version for the specified Environment. This Evaluator\nwill no longer be used for calls made to the Evaluator in this Environment.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluators/{id}/environments":{"get":{"operationId":"evaluators_listEnvironments","summary":"List an Evaluator's Environments","description":"List all Environments and their deployed versions for the Evaluator.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluator.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluators/{id}/evaluators":{"post":{"operationId":"evaluators_updateMonitoring","summary":"Update Monitoring","description":"Activate and deactivate Evaluators for monitoring the Evaluator.\n\nAn activated Evaluator will automatically be run on all new Logs\nwithin the Evaluator for monitoring purposes.","tags":["evaluators"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequest"}}}},"security":[{"default":[]}]}},"/datasets":{"get":{"operationId":"datasets_list","summary":"List Datasets","description":"List all Datasets.","tags":["Datasets"],"parameters":[{"name":"page","in":"query","description":"Page offset for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Datasets to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Dataset name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Dataset. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Datasets by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"datasets_upsert","summary":"Upsert Dataset","description":"Create a Dataset or update it with a new version if it already exists.\n\nDatasets are identified by the `ID` or their `path`. The datapoints determine the versions of the Dataset.\n\nBy default, the new Dataset version will be set to the list of Datapoints provided in\nthe request. You can also create a new version by adding or removing Datapoints from an existing version\nby specifying `action` as `add` or `remove` respectively. In this case, you may specify\nthe `version_id` or `environment` query parameters to identify the existing version to base\nthe new version on. If neither is provided, the latest created version will be used.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within a Dataset - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.\n\nHumanloop also deduplicates Datapoints. If you try to add a Datapoint that already\nexists, it will be ignored. If you intentionally want to add a duplicate Datapoint,\nyou can add a unique identifier to the Datapoint's inputs such as `{_dedupe_id: <unique ID>}`.","tags":["Datasets"],"parameters":[{"name":"version_id","in":"query","description":"ID of the specific Dataset version to base the created Version on. Only used when `action` is `\"add\"` or `\"remove\"`.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed Version to base the created Version on. Only used when `action` is `\"add\"` or `\"remove\"`.","required":false,"schema":{"type":"string"}},{"name":"include_datapoints","in":"query","description":"If set to `true`, include all Datapoints in the response. Defaults to `false`. Consider using the paginated List Datapoints endpoint instead.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Dataset, including the name. This locates the Dataset in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Dataset."},"datapoints":{"type":"array","items":{"$ref":"#/components/schemas/CreateDatapointRequest"},"description":"The Datapoints to create this Dataset version with. Modify the `action` field to determine how these Datapoints are used."},"action":{"$ref":"#/components/schemas/UpdateDatesetAction","description":"The action to take with the provided Datapoints.\n\n - If `\"set\"`, the created version will only contain the Datapoints provided in this request. \n - If `\"add\"`, the created version will contain the Datapoints provided in this request in addition to the Datapoints in the target version. \n - If `\"remove\"`, the created version will contain the Datapoints in the target version except for the Datapoints provided in this request. \n\nIf `\"add\"` or `\"remove\"`, one of the `version_id` or `environment` query parameters may be provided."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used."},"version_name":{"type":"string","description":"Unique name for the Dataset version. Version names must be unique for a given Dataset."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."}},"required":["datapoints"]}}}},"security":[{"default":[]}]}},"/datasets/{id}":{"get":{"operationId":"datasets_get","summary":"Get Dataset","description":"Retrieve the Dataset with the given ID.\n\nUnless `include_datapoints` is set to `true`, the response will not include\nthe Datapoints.\nUse the List Datapoints endpoint (`GET /{id}/datapoints`) to efficiently\nretrieve Datapoints for a large Dataset.\n\nBy default, the deployed version of the Dataset is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Dataset.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Dataset to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}},{"name":"include_datapoints","in":"query","description":"If set to `true`, include all Datapoints in the response. Defaults to `false`. Consider using the paginated List Datapoints endpoint instead.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"datasets_delete","summary":"Delete Dataset","description":"Delete the Dataset with the given ID.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"datasets_move","summary":"Move Dataset","description":"Move the Dataset to a different path or change the name.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Dataset including the Dataset name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Dataset, which is used as a unique identifier."}}}}}},"security":[{"default":[]}]}},"/datasets/{id}/datapoints":{"get":{"operationId":"datasets_listDatapoints","summary":"List Datapoints","description":"List all Datapoints for the Dataset with the given ID.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Dataset to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Datapoints to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":50}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDatapointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/datasets/{id}/versions":{"get":{"operationId":"datasets_listVersions","summary":"List Versions of a Dataset","description":"Get a list of the versions for a Dataset.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"include_datapoints","in":"query","description":"If set to 'latest_saved', include datapoints for the latest saved version. Alternatively, 'latest_committed' (deprecated) includes datapoints for the latest committed version only.","required":false,"schema":{"$ref":"#/components/schemas/datasets_ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasets"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/datasets/{id}/versions/{version_id}":{"delete":{"operationId":"datasets_deleteDatasetVersion","summary":"Delete Dataset Version","description":"Delete a version of the Dataset.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"datasets_updateDatasetVersion","summary":"Update Dataset Version","description":"Update the name or description of the Dataset version.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/datasets/{id}/datapoints/csv":{"post":{"operationId":"datasets_uploadCsv","summary":"Upload CSV","description":"Add Datapoints from a CSV file to a Dataset.\n\nThis will create a new version of the Dataset with the Datapoints from the CSV file.\n\nIf either `version_id` or `environment` is provided, the new version will be based on the specified version,\nwith the Datapoints from the CSV file added to the existing Datapoints in the version.\nIf neither `version_id` nor `environment` is provided, the new version will be based on the version\nof the Dataset that is deployed to the default Environment.\n\nYou can optionally provide a name and description for the new version using `version_name`\nand `version_description` parameters.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for the Dataset","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"ID of the specific Dataset version to base the created Version on.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed Version to base the created Version on.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"A CSV file containing Datapoints to be added to the Dataset."},"version_name":{"type":"string","description":"Name for the new Dataset version."},"version_description":{"type":"string","description":"Description for the new Dataset version."}},"required":["file"]}}}},"security":[{"default":[]}]}},"/datasets/{id}/environments/{environment_id}":{"post":{"operationId":"datasets_setDeployment","summary":"Deploy Dataset","description":"Deploy Dataset to Environment.\n\nSet the deployed version for the specified Environment.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"datasets_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Dataset from Environment.\n\nRemove the deployed version for the specified Environment.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/datasets/{id}/environments":{"get":{"operationId":"datasets_listEnvironments","summary":"List a Dataset's Environments","description":"List all Environments and their deployed versions for the Dataset.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Dataset.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluations":{"get":{"operationId":"evaluations_list","summary":"List Evaluations","description":"Retrieve a list of Evaluations for the specified File.","tags":["Evaluations"],"parameters":[{"name":"file_id","in":"query","description":"Filter by File ID. Only Evaluations for the specified File will be returned.","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Evaluations to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"evaluations_create","summary":"Create Evaluation","description":"Create an Evaluation.\n\nCreate a new Evaluation by specifying the File to evaluate, and a name\nfor the Evaluation.\nYou can then add Runs to this Evaluation using the `POST /evaluations/{id}/runs` endpoint.","tags":["Evaluations"],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/FileRequest","description":"The File to associate with the Evaluation. This File contains the Logs you're evaluating."},"name":{"type":"string","description":"Name of the Evaluation to help identify it. Must be unique within the associated File."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/evaluations_CreateEvaluationRequestEvaluatorsItem"},"description":"The Evaluators used to evaluate."}},"required":["evaluators"]}}}},"security":[{"default":[]}]}},"/evaluations/{id}/evaluators":{"post":{"operationId":"evaluations_addEvaluators","summary":"Add Evaluators","description":"Add Evaluators to an Evaluation.\n\nThe Evaluators will be run on the Logs generated for the Evaluation.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/evaluations_AddEvaluatorsRequestEvaluatorsItem"},"description":"The Evaluators to add to this Evaluation."}},"required":["evaluators"]}}}},"security":[{"default":[]}]}},"/evaluations/{id}/evaluators/{evaluator_version_id}":{"delete":{"operationId":"evaluations_removeEvaluator","summary":"Remove Evaluator","description":"Remove an Evaluator from an Evaluation.\n\nThe Evaluator will no longer be run on the Logs in the Evaluation.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}},{"name":"evaluator_version_id","in":"path","description":"Unique identifier for Evaluator Version.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluations/{id}":{"get":{"operationId":"evaluations_get","summary":"Get Evaluation","description":"Get an Evaluation.\n\nThis includes the Evaluators associated with the Evaluation and metadata about the Evaluation,\nsuch as its name.\n\nTo get the Runs associated with the Evaluation, use the `GET /evaluations/{id}/runs` endpoint.\nTo retrieve stats for the Evaluation, use the `GET /evaluations/{id}/stats` endpoint.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"evaluations_delete","summary":"Delete Evaluation","description":"Delete an Evaluation.\n\nThe Runs and Evaluators in the Evaluation will not be deleted.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluations/{id}/runs":{"get":{"operationId":"evaluations_listRunsForEvaluation","summary":"List Runs for Evaluation","description":"List all Runs for an Evaluation.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationRunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"evaluations_createRun","summary":"Create Run","description":"Create an Evaluation Run.\n\nOptionally specify the Dataset and version to be evaluated.\n\nHumanloop will automatically start generating Logs and running Evaluators where\n`orchestrated=true`. If you are generating Logs yourself, you can set `orchestrated=false`\nand then generate and submit the required Logs via the API.\n\nIf `dataset` and `version` are provided, you can set `use_existing_logs=True` to reuse existing Logs,\navoiding generating new Logs unnecessarily. Logs that are associated with the specified Version and have `source_datapoint_id`\nreferencing a datapoint in the specified Dataset will be associated with the Run.\n\nTo keep updated on the progress of the Run, you can poll the Run using\nthe `GET /evaluations/{id}/runs` endpoint and check its status.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dataset":{"$ref":"#/components/schemas/evaluations_CreateRunRequestDataset","description":"Dataset to use in this Run."},"version":{"$ref":"#/components/schemas/evaluations_CreateRunRequestVersion","description":"Version to use in this Run."},"orchestrated":{"type":"boolean","default":true,"description":"Whether the Run is orchestrated by Humanloop. If `True`, Humanloop will generate Logs for the Run; `dataset` and `version` must be provided. If `False`, a log for the Prompt/Tool should be submitted by the user via the API."},"use_existing_logs":{"type":"boolean","default":false,"description":"If `True`, the Run will be initialized with existing Logs associated with the Dataset and Version. If `False`, the Run will be initialized with no Logs. Can only be set to `True` when both `dataset` and `version` are provided."}}}}}},"security":[{"default":[]}]}},"/evaluations/{id}/runs/{run_id}":{"post":{"operationId":"evaluations_addExistingRun","summary":"Add Existing Run","description":"Add an existing Run to the specified Evaluation.\n\nThis is useful if you want to compare the Runs in this Evaluation with an existing Run\nthat exists within another Evaluation.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}},{"name":"run_id","in":"path","description":"Unique identifier for Run.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"evaluations_removeRun","summary":"Remove Run","description":"Remove a Run from an Evaluation.\n\nThe Logs and Versions used in the Run will not be deleted.\nIf this Run is used in any other Evaluations, it will still be available in those Evaluations.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}},{"name":"run_id","in":"path","description":"Unique identifier for Run.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"evaluations_updateEvaluationRun","summary":"Update Evaluation Run","description":"Update an Evaluation Run.\n\nSpecify `control=true` to use this Run as the control Run for the Evaluation.\nYou can cancel a running/pending Run, or mark a Run that uses external or human Evaluators as completed.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}},{"name":"run_id","in":"path","description":"Unique identifier for Run.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"control":{"type":"boolean","description":"If `True`, this Run will be used as the control in the Evaluation. Stats for other Runs will be compared to this Run. This will replace any existing control Run."},"status":{"$ref":"#/components/schemas/EvaluationStatus","description":"Used to set the Run to `cancelled` or `completed`. Can only be used if the Run is currently `pending` or `running`."}}}}}},"security":[{"default":[]}]}},"/evaluations/{id}/runs/{run_id}/logs":{"post":{"operationId":"evaluations_addLogsToRun","summary":"Add Logs to Run","description":"Add the specified Logs to a Run.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}},{"name":"run_id","in":"path","description":"Unique identifier for Run.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"log_ids":{"type":"array","items":{"type":"string"},"description":"The IDs of the Logs to add to the Run."}},"required":["log_ids"]}}}},"security":[{"default":[]}]}},"/evaluations/{id}/stats":{"get":{"operationId":"evaluations_getStats","summary":"Get Evaluation Stats","description":"Get Evaluation Stats.\n\nRetrieve aggregate stats for the specified Evaluation. This includes the number of generated Logs for each Run and the\ncorresponding Evaluator statistics (such as the mean and percentiles).","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Evaluation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/evaluations/{id}/logs":{"get":{"operationId":"evaluations_getLogs","summary":"Get Logs for Evaluation","description":"Get the Logs associated to a specific Evaluation.\n\nThis returns the Logs associated to all Runs within with the Evaluation.","tags":["Evaluations"],"parameters":[{"name":"id","in":"path","description":"String ID of evaluation. Starts with `ev_` or `evr_`.","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Logs to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"run_id","in":"query","description":"Filter by Run IDs. Only Logs for the specified Runs will be returned.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataEvaluationLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/tools/call":{"post":{"operationId":"tools_call","summary":"Call Tool","description":"Call a Tool.\n\nCalling a Tool with inputs runs the tool's source code and logs the result and metadata to Humanloop.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Tool. Otherwise, the default deployed version will be chosen.\n\nInstead of targeting an existing version explicitly, you can instead pass in\nTool details in the request body. In this case, we will check if the details correspond\nto an existing version of the Tool. If they do not, we will create a new version. This is helpful\nin the case where you are storing or deriving your Tool details in code.","tags":["tools"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Tool to call.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to call.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Tool, including the name. This locates the Tool in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Tool."},"tool":{"$ref":"#/components/schemas/ToolKernelRequest","description":"Details of your Tool. A new Tool version will be created if the provided details are new."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."}}}}}},"security":[{"default":[]}]}},"/tools/log":{"post":{"operationId":"tools_log","summary":"Log to a Tool","description":"Log to a Tool.\n\nYou can use query parameters `version_id`, or `environment`, to target\nan existing version of the Tool. Otherwise the default deployed version will be chosen.\n\nInstead of targeting an existing version explicitly, you can instead pass in\nTool details in the request body. In this case, we will check if the details correspond\nto an existing version of the Tool, if not we will create a new version. This is helpful\nin the case where you are storing or deriving your Tool details in code.","tags":["tools"],"parameters":[{"name":"version_id","in":"query","description":"A specific Version ID of the Tool to log to.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment identifying a deployed version to log to.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToolLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Tool, including the name. This locates the Tool in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Tool."},"tool":{"$ref":"#/components/schemas/ToolKernelRequest","description":"Details of your Tool. A new Tool version will be created if the provided details are new."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."}}}}}},"security":[{"default":[]}]}},"/tools/{id}/log/{log_id}":{"patch":{"operationId":"tools_update","summary":"Update Tool Log","description":"Update a Log.\n\nUpdate the details of a Log with the given ID.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Prompt.","required":true,"schema":{"type":"string"}},{"name":"log_id","in":"path","description":"Unique identifier for the Log.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."}}}}}},"security":[{"default":[]}]}},"/tools":{"get":{"operationId":"tools_list","summary":"List Tools","description":"Get a list of all Tools.","tags":["tools"],"parameters":[{"name":"page","in":"query","description":"Page offset for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Tools to fetch.","required":false,"schema":{"type":"integer","default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for Tool name.","required":false,"schema":{"type":"string"}},{"name":"user_filter","in":"query","description":"Case-insensitive filter for users in the Tool. This filter matches against both email address and name of users.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort Tools by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"tools_upsert","summary":"Upsert Tool","description":"Create a Tool or update it with a new version if it already exists.\n\nTools are identified by the `ID` or their `path`. The name, description and parameters determine the versions of the Tool.\n\nYou can provide `version_name` and `version_description` to identify and describe your versions.\nVersion names must be unique within a Tool - attempting to create a version with a name\nthat already exists will result in a 409 Conflict error.","tags":["tools"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Tool, including the name. This locates the Tool in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."},"id":{"type":"string","description":"ID for an existing Tool."},"function":{"$ref":"#/components/schemas/ToolFunction","description":"Callable function specification of the Tool shown to the model for tool calling."},"source_code":{"type":"string","description":"Code source of the Tool."},"setup_values":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/"},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used."},"tool_type":{"$ref":"#/components/schemas/FilesToolType","description":"Type of Tool."},"version_name":{"type":"string","description":"Unique identifier for this Tool version. Each Tool can only have one version with a given name."},"version_description":{"type":"string","description":"Description of the Version."}}}}}},"security":[{"default":[]}]}},"/tools/{id}":{"get":{"operationId":"tools_get","summary":"Get Tool","description":"Retrieve the Tool with the given ID.\n\nBy default, the deployed version of the Tool is returned. Use the query parameters\n`version_id` or `environment` to target a specific version of the Tool.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"A specific Version ID of the Tool to retrieve.","required":false,"schema":{"type":"string"}},{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"tools_delete","summary":"Delete Tool","description":"Delete the Tool with the given ID.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"tools_move","summary":"Move Tool","description":"Move the Tool to a different path or change the name.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Tool including the Tool name, which is used as a unique identifier."},"name":{"type":"string","description":"Name of the Tool, which is used as a unique identifier."}}}}}},"security":[{"default":[]}]}},"/tools/{id}/versions":{"get":{"operationId":"tools_listVersions","summary":"List Versions of a Tool","description":"Get a list of all the versions of a Tool.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for the Tool.","required":true,"schema":{"type":"string"}},{"name":"evaluator_aggregates","in":"query","description":"Whether to include Evaluator aggregate results for the versions in the response","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTools"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/tools/{id}/versions/{version_id}":{"delete":{"operationId":"tools_deleteToolVersion","summary":"Delete Tool Version","description":"Delete a version of the Tool.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"tools_updateToolVersion","summary":"Update Tool Version","description":"Update the name or description of the Tool version.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"Unique identifier for the specific version of the Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVersionRequest"}}}},"security":[{"default":[]}]}},"/tools/{id}/environments/{environment_id}":{"post":{"operationId":"tools_setDeployment","summary":"Deploy Tool","description":"Deploy Tool to an Environment.\n\nSet the deployed version for the specified Environment. This Prompt\nwill be used for calls made to the Tool in this Environment.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to deploy the Version to.","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"query","description":"Unique identifier for the specific version of the Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"tools_removeDeployment","summary":"Remove Deployment","description":"Remove deployed Tool from the Environment.\n\nRemove the deployed version for the specified Environment. This Tool\nwill no longer be used for calls made to the Tool in this Environment.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}},{"name":"environment_id","in":"path","description":"Unique identifier for the Environment to remove the deployment from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/tools/{id}/environments":{"get":{"operationId":"tools_listEnvironments","summary":"List a Tool's Environments","description":"List all Environments and their deployed versions for the Tool.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/tools/{id}/evaluators":{"post":{"operationId":"tools_updateMonitoring","summary":"Update Monitoring","description":"Activate and deactivate Evaluators for monitoring the Tool.\n\nAn activated Evaluator will automatically be run on all new Logs\nwithin the Tool for monitoring purposes.","tags":["tools"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequest"}}}},"security":[{"default":[]}]}},"/tools/{id}/environment-variables":{"get":{"operationId":"tools_getEnvironmentVariables","summary":"Get Environment Variables","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for File.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentVariableRequest"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"tools_addEnvironmentVariable","summary":"Add Environment Variable","description":"Add an environment variable to a Tool.","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Tool.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentVariableRequest"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentVariableRequest"}}}}},"security":[{"default":[]}]}},"/tools/{id}/environment-variables/{name}":{"delete":{"operationId":"tools_deleteEnvironmentVariable","summary":"Delete Environment Variable","tags":["tools"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for File.","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","description":"Name of the Environment Variable to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEnvironmentVariableRequest"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/files":{"get":{"operationId":"files_listFiles","summary":"List Files","description":"Get a paginated list of files.","tags":["files"],"parameters":[{"name":"page","in":"query","description":"Page offset for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of files to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"name","in":"query","description":"Case-insensitive filter for file name.","required":false,"schema":{"type":"string"}},{"name":"path","in":"query","description":"Path of the directory to filter for. Returns files in this directory and all its subdirectories.","required":false,"schema":{"type":"string"}},{"name":"template","in":"query","description":"Filter to include only template files.","required":false,"schema":{"type":"boolean","default":false}},{"name":"type","in":"query","description":"List of file types to filter for.","required":false,"schema":{"$ref":"#/components/schemas/FileType"}},{"name":"environment","in":"query","description":"Case-sensitive filter for files with a deployment in the specified environment. Requires the environment name.","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","description":"Field to sort files by","required":false,"schema":{"$ref":"#/components/schemas/FileSortBy"}},{"name":"order","in":"query","description":"Direction to sort by.","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}},{"name":"include_raw_file_content","in":"query","description":"Whether to include the raw file content in the response. Currently only supported for Agents and Prompts.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/files/retrieve-by-path":{"post":{"operationId":"files_retrieveByPath","summary":"Retrieve by path","description":"Retrieve a File by path.","tags":["files"],"parameters":[{"name":"environment","in":"query","description":"Name of the Environment to retrieve a deployed Version from.","required":false,"schema":{"type":"string"}},{"name":"include_raw_file_content","in":"query","description":"Whether to include the raw file content in the response. Currently only supported for Agents and Prompts.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/files_RetrieveByPathFilesRetrieveByPathPostResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path of the File to retrieve."}},"required":["path"]}}}},"security":[{"default":[]}]}},"/directories":{"get":{"operationId":"directories_list","summary":"List ","description":"Retrieve a list of all Directories.","tags":["directories"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"post":{"operationId":"directories_create","summary":"Create","description":"Creates a Directory.","tags":["directories"],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the directory to create."},"parent_id":{"type":"string","description":"ID of the parent directory. Starts with `dir_`."},"path":{"type":"string","description":"Path to create the directory in, relative to the root directory. If the path does not exist, it will be created. Includes name, e.g. `path/to/directory`."}}}}}},"security":[{"default":[]}]}},"/directories/{id}":{"get":{"operationId":"directories_get","summary":"Get","description":"Fetches a directory by ID.","tags":["directories"],"parameters":[{"name":"id","in":"path","description":"String ID of directory. Starts with `dir_`.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryWithParentsAndChildrenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"directories_delete","summary":"Delete","description":"Delete the Directory with the given ID.\n\nThe Directory must be empty (i.e. contain no Directories or Files).","tags":["directories"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Directory. Starts with `dir_`.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"patch":{"operationId":"directories_update","summary":"Update","description":"Update the Directory with the given ID.","tags":["directories"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Directory. Starts with `dir_`.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name to set for the directory."},"parent_id":{"type":"string","description":"ID of the parent directory. Specify this to move directories. Starts with `dir_`."},"path":{"type":"string","description":"Path to move the directory to, relative to the root directory. Specify this to move directories. Includes name, e.g. `path/to/directory`."}}}}}},"security":[{"default":[]}]}},"/logs":{"get":{"operationId":"logs_list","summary":"List Logs","description":"List all Logs for the given filter criteria.","tags":["Logs"],"parameters":[{"name":"file_id","in":"query","description":"Unique identifier for the File to list Logs for.","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number for pagination.","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","description":"Page size for pagination. Number of Logs to fetch.","required":false,"schema":{"type":"integer","minimum":0,"default":10}},{"name":"version_id","in":"query","description":"If provided, only Logs belonging to the specified Version will be returned.","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","description":"If provided, returns Logs whose IDs contain any of the specified values as substrings.","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","description":"If provided, only Logs that contain the provided string in its inputs and output will be returned.","required":false,"schema":{"type":"string"}},{"name":"metadata_search","in":"query","description":"If provided, only Logs that contain the provided string in its metadata will be returned.","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","description":"If provided, only Logs created after the specified date will be returned.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"end_date","in":"query","description":"If provided, only Logs created before the specified date will be returned.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"include_parent","in":"query","description":"If true, include the full parent Log in the response. Only applicable when retrieving Evaluator Logs.","required":false,"schema":{"type":"boolean","default":false}},{"name":"in_trace_filter","in":"query","description":"If true, return Logs that are associated to a Trace. False, return Logs that are not associated to a Trace.","required":false,"schema":{"type":"boolean"}},{"name":"sample","in":"query","description":"If provided, limit the response to a random subset of logs from the filtered results. (This will be an approximate sample, not a strict limit.)","required":false,"schema":{"type":"integer","minimum":0}},{"name":"include_trace_children","in":"query","description":"If true, populate `trace_children` for the retrieved Logs. Only applicable when retrieving Flow or Agent Logs.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDataLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]},"delete":{"operationId":"logs_delete","summary":"Delete Logs","description":"Delete Logs with the given IDs.","tags":["Logs"],"parameters":[{"name":"id","in":"query","description":"Unique identifiers for the Logs to delete.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}},"/logs/{id}":{"get":{"operationId":"logs_get","summary":"Get Log","description":"Retrieve the Log with the given ID.","tags":["Logs"],"parameters":[{"name":"id","in":"path","description":"Unique identifier for Log.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpValidationError"}}}}},"security":[{"default":[]}]}}},"tags":[{"name":"Prompts"},{"name":"agents"},{"name":"flows"},{"name":"evaluators"},{"name":"Datasets"},{"name":"Evaluations"},{"name":"tools"},{"name":"files"},{"name":"directories"},{"name":"Logs"}],"servers":[{"url":"https://api.humanloop.com/v5","description":"Default"}],"components":{"schemas":{"TextChatContent":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string","description":"The message's text content."}},"required":["type","text"],"title":"TextChatContent"},"ImageUrlDetail":{"type":"string","enum":["high","low","auto"],"description":"Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding","title":"ImageUrlDetail"},"ImageUrl":{"type":"object","properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data."},"detail":{"$ref":"#/components/schemas/ImageUrlDetail","description":"Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding"}},"required":["url"],"title":"ImageUrl"},"ImageChatContent":{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"$ref":"#/components/schemas/ImageUrl","description":"The message's image content."}},"required":["type","image_url"],"title":"ImageChatContent"},"ChatMessageContentItem":{"oneOf":[{"$ref":"#/components/schemas/TextChatContent"},{"$ref":"#/components/schemas/ImageChatContent"}],"title":"ChatMessageContentItem"},"ChatMessageContent":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItem"}}],"description":"The content of the message.","title":"ChatMessageContent"},"ChatRole":{"type":"string","enum":["user","assistant","system","tool","developer"],"description":"An enumeration.","title":"ChatRole"},"ChatToolType":{"type":"string","enum":["function"],"description":"The type of tool to call.","title":"ChatToolType"},"FunctionTool":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name"],"description":"A function tool to be called by the model where user owns runtime.","title":"FunctionTool"},"ToolCall":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/ChatToolType"},"function":{"$ref":"#/components/schemas/FunctionTool"}},"required":["id","type","function"],"description":"A tool call to be made.","title":"ToolCall"},"AnthropicThinkingContent":{"type":"object","properties":{"type":{"type":"string","enum":["thinking"]},"thinking":{"type":"string","description":"Model's chain-of-thought for providing the response."},"signature":{"type":"string","description":"Cryptographic signature that verifies the thinking block was generated by Anthropic."}},"required":["type","thinking","signature"],"title":"AnthropicThinkingContent"},"AnthropicRedactedThinkingContent":{"type":"object","properties":{"type":{"type":"string","enum":["redacted_thinking"]},"data":{"type":"string","description":"Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic"}},"required":["type","data"],"title":"AnthropicRedactedThinkingContent"},"ChatMessageThinkingItem":{"oneOf":[{"$ref":"#/components/schemas/AnthropicThinkingContent"},{"$ref":"#/components/schemas/AnthropicRedactedThinkingContent"}],"title":"ChatMessageThinkingItem"},"ChatMessage":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/ChatMessageContent","description":"The content of the message."},"name":{"type":"string","description":"Optional name of the message author."},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to."},"role":{"$ref":"#/components/schemas/ChatRole","description":"Role of the message author."},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"},"description":"A list of tool calls requested by the assistant."},"thinking":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageThinkingItem"},"description":"Model's chain-of-thought for providing the response. Present on assistant messages if model supports it."}},"required":["role"],"title":"ChatMessage"},"FunctionToolChoice":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"description":"A function tool to be called by the model where user owns runtime.","title":"FunctionToolChoice"},"ToolChoice":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChatToolType"},"function":{"$ref":"#/components/schemas/FunctionToolChoice"}},"required":["type","function"],"description":"Tool choice to force the model to use a tool.","title":"ToolChoice"},"prompts_PromptLogRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptLogRequestToolChoice"},"ModelEndpoints":{"type":"string","enum":["complete","chat","edit"],"description":"Supported model provider endpoints.","title":"ModelEndpoints"},"PromptKernelRequestTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"PromptKernelRequestTemplate"},"TemplateLanguage":{"type":"string","enum":["default","jinja"],"description":"Template engine to use for rendering templates.","title":"TemplateLanguage"},"ModelProviders":{"type":"string","enum":["anthropic","bedrock","cohere","deepseek","google","groq","mock","openai","openai_azure","replicate"],"description":"Supported model providers.","title":"ModelProviders"},"PromptKernelRequestStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"PromptKernelRequestStop"},"ResponseFormatType":{"type":"string","enum":["json_object","json_schema"],"title":"ResponseFormatType"},"ResponseFormat":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ResponseFormatType"},"json_schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema of the response format if type is json_schema."}},"required":["type"],"description":"Response format of the model.","title":"ResponseFormat"},"OpenAiReasoningEffort":{"type":"string","enum":["high","medium","low"],"description":"Supported reasoning effort.","title":"OpenAiReasoningEffort"},"PromptKernelRequestReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"PromptKernelRequestReasoningEffort"},"ToolFunction":{"type":"object","properties":{"name":{"type":"string","description":"Name for the tool referenced by the model."},"description":{"type":"string","description":"Description of the tool referenced by the model"},"strict":{"type":"boolean","default":false,"description":"If true, forces the model to output json data in the structure of the parameters schema."},"parameters":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/"}},"required":["name","description"],"title":"ToolFunction"},"PromptKernelRequest":{"type":"object","properties":{"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/PromptKernelRequestTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/PromptKernelRequestStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/PromptKernelRequestReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolFunction"},"description":"The tool specification that the model can choose to call if Tool calling is supported."},"linked_tools":{"type":"array","items":{"type":"string"},"description":"The IDs of the Tools in your organization that the model can choose to call if Tool calling is supported. The default deployed version of that tool is called."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."}},"required":["model"],"description":"Base class used by both PromptKernelRequest and AgentKernelRequest.\n\nContains the consistent Prompt-related fields.","title":"PromptKernelRequest"},"prompts_PromptLogRequestPrompt":{"oneOf":[{"$ref":"#/components/schemas/PromptKernelRequest"},{"type":"string"}],"description":"The Prompt configuration to use. Two formats are supported:\n- An object representing the details of the Prompt configuration\n- A string representing the raw contents of a .prompt file\n\nA new Prompt version will be created if the provided details do not match any existing version.","title":"PromptLogRequestPrompt"},"CreatePromptLogResponse":{"type":"object","properties":{"id":{"type":"string","description":"String ID of log."},"prompt_id":{"type":"string","description":"ID of the Prompt the log belongs to."},"version_id":{"type":"string","description":"ID of the specific version of the Prompt."},"session_id":{"type":"string","description":"String ID of session the log belongs to."}},"required":["id","prompt_id","version_id"],"title":"CreatePromptLogResponse"},"ValidationErrorLocItem":{"oneOf":[{"type":"string"},{"type":"integer"}],"title":"ValidationErrorLocItem"},"ValidationError":{"type":"object","properties":{"loc":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorLocItem"}},"msg":{"type":"string"},"type":{"type":"string"}},"required":["loc","msg","type"],"title":"ValidationError"},"HttpValidationError":{"type":"object","properties":{"detail":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}},"title":"HttpValidationError"},"prompts_PromptLogUpdateRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptLogUpdateRequestToolChoice"},"PromptLogResponseToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptLogResponseToolChoice"},"PromptResponseTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"PromptResponseTemplate"},"PromptResponseStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"PromptResponseStop"},"PromptResponseReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"PromptResponseReasoningEffort"},"LinkedToolResponse":{"type":"object","properties":{"name":{"type":"string","description":"Name for the tool referenced by the model."},"description":{"type":"string","description":"Description of the tool referenced by the model"},"strict":{"type":"boolean","default":false,"description":"If true, forces the model to output json data in the structure of the parameters schema."},"parameters":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/"},"id":{"type":"string","description":"Unique identifier for the Tool linked."},"version_id":{"type":"string","description":"Unique identifier for the Tool Version linked."}},"required":["name","description","id","version_id"],"title":"LinkedToolResponse"},"EnvironmentTag":{"type":"string","enum":["default","other"],"description":"An enumeration.","title":"EnvironmentTag"},"EnvironmentResponse":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"tag":{"$ref":"#/components/schemas/EnvironmentTag"}},"required":["id","created_at","name","tag"],"title":"EnvironmentResponse"},"UserResponse":{"description":"Any type","title":"UserResponse"},"InputResponse":{"type":"object","properties":{"name":{"type":"string","description":"Type of input."}},"required":["name"],"title":"InputResponse"},"FilesToolType":{"type":"string","enum":["pinecone_search","google","mock","snippet","json_schema","get_api_call","python"],"description":"Type of tool.","title":"FilesToolType"},"EvaluatorAggregate":{"type":"object","properties":{"value":{"type":"number","format":"double","description":"The aggregated value of the evaluator."},"evaluator_id":{"type":"string","description":"ID of the evaluator."},"evaluator_version_id":{"type":"string","description":"ID of the evaluator version."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["value","evaluator_id","evaluator_version_id","created_at","updated_at"],"title":"EvaluatorAggregate"},"ToolResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Tool, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Tool."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"function":{"$ref":"#/components/schemas/ToolFunction","description":"Callable function specification of the Tool shown to the model for tool calling."},"source_code":{"type":"string","description":"Code source of the Tool."},"setup_values":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/"},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used."},"tool_type":{"$ref":"#/components/schemas/FilesToolType","description":"Type of Tool."},"version_name":{"type":"string","description":"Unique identifier for this Tool version. Each Tool can only have one version with a given name."},"version_description":{"type":"string","description":"Description of the Version."},"name":{"type":"string","description":"Name of the Tool, which is used as a unique identifier."},"description":{"type":"string","description":"Description of the Tool."},"readme":{"type":"string","description":"Long description of the file."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"version_id":{"type":"string","description":"Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned."},"type":{"type":"string","enum":["tool"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Tool Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Tool."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Tool Version"},"total_logs_count":{"type":"integer","description":"The number of logs that have been generated across all Tool Versions"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/InputResponse"},"description":"Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"Evaluators that have been attached to this Tool that are used for monitoring logs."},"signature":{"type":"string","description":"Signature of the Tool."},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Tool Version."}},"required":["path","id","name","version_id","created_at","updated_at","last_used_at","version_logs_count","total_logs_count","inputs"],"description":"Base type that all File Responses should inherit from.\n\nAttributes defined here are common to all File Responses and should be overridden\nin the inheriting classes with documentation and appropriate Field definitions.","title":"ToolResponse"},"DatapointResponseTargetValue":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number","format":"double"},{"type":"boolean"},{"type":"array","items":{"description":"Any type"}},{"type":"object","additionalProperties":{"description":"Any type"}}],"title":"DatapointResponseTargetValue"},"DatapointResponse":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{"type":"string"},"description":"The inputs to the prompt template."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages to provide to the model."},"target":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DatapointResponseTargetValue"},"description":"Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation."},"id":{"type":"string","description":"Unique identifier for the Datapoint. Starts with `dp_`."}},"required":["id"],"title":"DatapointResponse"},"DatasetResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Dataset, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Dataset. Starts with `ds_`."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"name":{"type":"string","description":"Name of the Dataset, which is used as a unique identifier."},"description":{"type":"string","description":"Description of the Dataset."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the File."},"readme":{"type":"string","description":"Long description of the file."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"version_id":{"type":"string","description":"Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`."},"type":{"type":"string","enum":["dataset"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Dataset Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Dataset."},"last_used_at":{"type":"string","format":"date-time"},"version_name":{"type":"string","description":"Unique name for the Dataset version. Version names must be unique for a given Dataset."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"datapoints_count":{"type":"integer","description":"The number of Datapoints in this Dataset version."},"datapoints":{"type":"array","items":{"$ref":"#/components/schemas/DatapointResponse"},"description":"The list of Datapoints in this Dataset version. Only provided if explicitly requested."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used."}},"required":["path","id","name","version_id","created_at","updated_at","last_used_at","datapoints_count"],"description":"Base type that all File Responses should inherit from.\n\nAttributes defined here are common to all File Responses and should be overridden\nin the inheriting classes with documentation and appropriate Field definitions.","title":"DatasetResponse"},"EvaluatorArgumentsType":{"type":"string","enum":["target_free","target_required"],"description":"Enum representing the possible argument types of an evaluator.","title":"EvaluatorArgumentsType"},"EvaluatorReturnTypeEnum":{"type":"string","enum":["boolean","number","select","multi_select","text"],"description":"Enum representing the possible return types of an evaluator.","title":"EvaluatorReturnTypeEnum"},"Valence":{"type":"string","enum":["positive","negative","neutral"],"description":"An enumeration.","title":"Valence"},"EvaluatorJudgmentOptionResponse":{"type":"object","properties":{"name":{"type":"string","description":"The name of the option."},"valence":{"$ref":"#/components/schemas/Valence","description":"Whether this option should be considered positive or negative."}},"required":["name"],"title":"EvaluatorJudgmentOptionResponse"},"EvaluatorJudgmentNumberLimit":{"type":"object","properties":{"min":{"type":"number","format":"double","description":"The minimum value that can be selected."},"max":{"type":"number","format":"double","description":"The maximum value that can be selected."},"step":{"type":"number","format":"double","description":"The step size for the number input."}},"title":"EvaluatorJudgmentNumberLimit"},"LlmEvaluatorRequest":{"type":"object","properties":{"arguments_type":{"$ref":"#/components/schemas/EvaluatorArgumentsType","description":"Whether this Evaluator is target-free or target-required."},"return_type":{"$ref":"#/components/schemas/EvaluatorReturnTypeEnum","description":"The type of the return value of the Evaluator."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used."},"options":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorJudgmentOptionResponse"},"description":"The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'."},"number_limits":{"$ref":"#/components/schemas/EvaluatorJudgmentNumberLimit","description":"Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'."},"number_valence":{"$ref":"#/components/schemas/Valence","description":"The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better."},"evaluator_type":{"type":"string","enum":["llm"]},"prompt":{"$ref":"#/components/schemas/PromptKernelRequest","description":"The prompt parameters used to generate."}},"required":["arguments_type","return_type","evaluator_type"],"title":"LlmEvaluatorRequest"},"CodeEvaluatorRequest":{"type":"object","properties":{"arguments_type":{"$ref":"#/components/schemas/EvaluatorArgumentsType","description":"Whether this Evaluator is target-free or target-required."},"return_type":{"$ref":"#/components/schemas/EvaluatorReturnTypeEnum","description":"The type of the return value of the Evaluator."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used."},"options":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorJudgmentOptionResponse"},"description":"The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'."},"number_limits":{"$ref":"#/components/schemas/EvaluatorJudgmentNumberLimit","description":"Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'."},"number_valence":{"$ref":"#/components/schemas/Valence","description":"The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better."},"evaluator_type":{"type":"string","enum":["python"]},"code":{"type":"string","description":"The code for the Evaluator. This code will be executed in a sandboxed environment."}},"required":["arguments_type","return_type","evaluator_type","code"],"title":"CodeEvaluatorRequest"},"HumanEvaluatorRequestReturnType":{"type":"string","enum":["select","multi_select","text","number","boolean"],"description":"The type of the return value of the Evaluator.","title":"HumanEvaluatorRequestReturnType"},"HumanEvaluatorRequest":{"type":"object","properties":{"arguments_type":{"$ref":"#/components/schemas/EvaluatorArgumentsType","description":"Whether this Evaluator is target-free or target-required."},"return_type":{"$ref":"#/components/schemas/HumanEvaluatorRequestReturnType","description":"The type of the return value of the Evaluator."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used."},"options":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorJudgmentOptionResponse"},"description":"The options that can be applied as judgments."},"number_limits":{"$ref":"#/components/schemas/EvaluatorJudgmentNumberLimit","description":"Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'."},"number_valence":{"$ref":"#/components/schemas/Valence","description":"The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better."},"evaluator_type":{"type":"string","enum":["human"]},"instructions":{"type":"string","description":"Instructions and guidelines for applying judgments."}},"required":["arguments_type","return_type","evaluator_type"],"title":"HumanEvaluatorRequest"},"ExternalEvaluatorRequest":{"type":"object","properties":{"arguments_type":{"$ref":"#/components/schemas/EvaluatorArgumentsType","description":"Whether this Evaluator is target-free or target-required."},"return_type":{"$ref":"#/components/schemas/EvaluatorReturnTypeEnum","description":"The type of the return value of the Evaluator."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used."},"options":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorJudgmentOptionResponse"},"description":"The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'."},"number_limits":{"$ref":"#/components/schemas/EvaluatorJudgmentNumberLimit","description":"Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'."},"number_valence":{"$ref":"#/components/schemas/Valence","description":"The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better."},"evaluator_type":{"type":"string","enum":["external"]}},"required":["arguments_type","return_type","evaluator_type"],"title":"ExternalEvaluatorRequest"},"EvaluatorResponseSpec":{"oneOf":[{"$ref":"#/components/schemas/LlmEvaluatorRequest"},{"$ref":"#/components/schemas/CodeEvaluatorRequest"},{"$ref":"#/components/schemas/HumanEvaluatorRequest"},{"$ref":"#/components/schemas/ExternalEvaluatorRequest"}],"title":"EvaluatorResponseSpec"},"EvaluatorResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Evaluator including the Evaluator name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Evaluator."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"version_name":{"type":"string","description":"Unique name for the Evaluator version. Version names must be unique for a given Evaluator."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"spec":{"$ref":"#/components/schemas/EvaluatorResponseSpec"},"name":{"type":"string","description":"Name of the Evaluator, which is used as a unique identifier."},"description":{"type":"string","description":"Description of the Evaluator."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the File."},"readme":{"type":"string","description":"Long description of the file."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"version_id":{"type":"string","description":"Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned."},"type":{"type":"string","enum":["evaluator"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Evaluator Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Evaluator."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Evaluator Version"},"total_logs_count":{"type":"integer","description":"The number of logs that have been generated across all Evaluator Versions"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/InputResponse"},"description":"Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"Evaluators that have been attached to this Evaluator that are used for monitoring logs."},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Evaluator Version."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used."}},"required":["path","id","spec","name","version_id","created_at","updated_at","last_used_at","version_logs_count","total_logs_count","inputs"],"description":"Version of the Evaluator used to provide judgments.","title":"EvaluatorResponse"},"FlowResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Flow, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Flow."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"A key-value object identifying the Flow Version."},"version_name":{"type":"string","description":"Unique name for the Flow version. Version names must be unique for a given Flow."},"version_description":{"type":"string","description":"Description of the Version."},"name":{"type":"string","description":"Name of the Flow."},"description":{"type":"string","description":"Description of the Flow."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the File."},"readme":{"type":"string","description":"Long description of the file."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"version_id":{"type":"string","description":"Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned."},"type":{"type":"string","enum":["flow"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Flow Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Flow."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Flow Version"},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Flow Version."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"The list of Monitoring Evaluators associated with the Flow Version."}},"required":["path","id","attributes","name","version_id","created_at","updated_at","last_used_at","version_logs_count"],"description":"Response model for a Flow.","title":"FlowResponse"},"AgentResponseTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"AgentResponseTemplate"},"AgentResponseStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"AgentResponseStop"},"AgentResponseReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"AgentResponseReasoningEffort"},"LinkedFileRequest":{"type":"object","properties":{"file_id":{"type":"string"},"environment_id":{"type":"string"},"version_id":{"type":"string"}},"required":["file_id"],"title":"LinkedFileRequest"},"OnAgentCallEnum":{"type":"string","enum":["stop","continue"],"description":"What an Agent should do when calling a Tool.","title":"OnAgentCallEnum"},"AgentLinkedFileResponseFile":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"title":"AgentLinkedFileResponseFile"},"AgentLinkedFileResponse":{"type":"object","properties":{"type":{"type":"string","enum":["file"]},"link":{"$ref":"#/components/schemas/LinkedFileRequest"},"on_agent_call":{"$ref":"#/components/schemas/OnAgentCallEnum"},"file":{"$ref":"#/components/schemas/AgentLinkedFileResponseFile"}},"required":["type","link"],"title":"AgentLinkedFileResponse"},"AgentInlineTool":{"type":"object","properties":{"type":{"type":"string","enum":["inline"]},"json_schema":{"$ref":"#/components/schemas/ToolFunction"},"on_agent_call":{"$ref":"#/components/schemas/OnAgentCallEnum"}},"required":["type","json_schema"],"title":"AgentInlineTool"},"AgentResponseToolsItem":{"oneOf":[{"$ref":"#/components/schemas/AgentLinkedFileResponse"},{"$ref":"#/components/schemas/AgentInlineTool"}],"title":"AgentResponseToolsItem"},"VersionStatus":{"type":"string","enum":["uncommitted","committed","deleted"],"description":"An enumeration.","title":"VersionStatus"},"AgentResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Agent, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Agent."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/AgentResponseTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/AgentResponseStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/AgentResponseReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponseToolsItem"},"description":"List of tools that the Agent can call. These can be linked files or inline tools."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"max_iterations":{"type":"integer","description":"The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called."},"version_name":{"type":"string","description":"Unique name for the Agent version. Version names must be unique for a given Agent."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"description":{"type":"string","description":"Description of the Agent."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"readme":{"type":"string","description":"Long description of the file."},"name":{"type":"string","description":"Name of the Agent."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the Prompt."},"version_id":{"type":"string","description":"Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned."},"type":{"type":"string","enum":["agent"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Agent Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Agent."},"committed_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who committed the Agent Version."},"committed_at":{"type":"string","format":"date-time","description":"The date and time the Agent Version was committed."},"status":{"$ref":"#/components/schemas/VersionStatus","description":"The status of the Agent Version."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Agent Version"},"total_logs_count":{"type":"integer","description":"The number of logs that have been generated across all Agent Versions"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/InputResponse"},"description":"Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"Evaluators that have been attached to this Agent that are used for monitoring logs."},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Agent Version."},"raw_file_content":{"type":"string","description":"The raw content of the Agent. Corresponds to the .agent file."}},"required":["path","id","model","tools","name","version_id","created_at","updated_at","status","last_used_at","version_logs_count","total_logs_count","inputs"],"description":"Base type that all File Responses should inherit from.\n\nAttributes defined here are common to all File Responses and should be overridden\nin the inheriting classes with documentation and appropriate Field definitions.","title":"AgentResponse"},"VersionDeploymentResponseFile":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"description":"The File that the deployed Version belongs to.","title":"VersionDeploymentResponseFile"},"VersionDeploymentResponse":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/VersionDeploymentResponseFile","description":"The File that the deployed Version belongs to."},"environment":{"$ref":"#/components/schemas/EnvironmentResponse","description":"The Environment that the Version is deployed to."},"type":{"type":"string","enum":["environment"]}},"required":["file","environment","type"],"description":"A variable reference to the Version deployed to an Environment","title":"VersionDeploymentResponse"},"VersionIdResponseVersion":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"description":"The specific Version being referenced.","title":"VersionIdResponseVersion"},"VersionIdResponse":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/VersionIdResponseVersion","description":"The specific Version being referenced."},"type":{"type":"string","enum":["version"]}},"required":["version","type"],"description":"A reference to a specific Version by its ID","title":"VersionIdResponse"},"VersionReferenceResponse":{"oneOf":[{"$ref":"#/components/schemas/VersionDeploymentResponse"},{"$ref":"#/components/schemas/VersionIdResponse"}],"title":"VersionReferenceResponse"},"MonitoringEvaluatorState":{"type":"string","enum":["active","inactive"],"description":"State of an evaluator connected to a file","title":"MonitoringEvaluatorState"},"MonitoringEvaluatorResponse":{"type":"object","properties":{"version_reference":{"$ref":"#/components/schemas/VersionReferenceResponse","description":"The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment."},"version":{"$ref":"#/components/schemas/EvaluatorResponse","description":"The deployed Version."},"state":{"$ref":"#/components/schemas/MonitoringEvaluatorState","description":"The state of the Monitoring Evaluator. Either `active` or `inactive`"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["version_reference","state","created_at","updated_at"],"title":"MonitoringEvaluatorResponse"},"PromptResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Prompt, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Prompt."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/PromptResponseTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/PromptResponseStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/PromptResponseReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolFunction"},"description":"The tool specification that the model can choose to call if Tool calling is supported."},"linked_tools":{"type":"array","items":{"$ref":"#/components/schemas/LinkedToolResponse"},"description":"The tools linked to your prompt that the model can call."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"version_name":{"type":"string","description":"Unique name for the Prompt version. Version names must be unique for a given Prompt."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"description":{"type":"string","description":"Description of the Prompt."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"readme":{"type":"string","description":"Long description of the file."},"name":{"type":"string","description":"Name of the Prompt."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the Prompt."},"version_id":{"type":"string","description":"Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned."},"type":{"type":"string","enum":["prompt"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Prompt Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Prompt."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Prompt Version"},"total_logs_count":{"type":"integer","description":"The number of logs that have been generated across all Prompt Versions"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/InputResponse"},"description":"Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"Evaluators that have been attached to this Prompt that are used for monitoring logs."},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Prompt Version."},"raw_file_content":{"type":"string","description":"The raw content of the Prompt. Corresponds to the .prompt file."}},"required":["path","id","model","name","version_id","created_at","updated_at","last_used_at","version_logs_count","total_logs_count","inputs"],"description":"Base type that all File Responses should inherit from.\n\nAttributes defined here are common to all File Responses and should be overridden\nin the inheriting classes with documentation and appropriate Field definitions.","title":"PromptResponse"},"EvaluatorLogResponseJudgment":{"oneOf":[{"type":"boolean"},{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"number","format":"double"}],"description":"Evaluator assessment of the Log.","title":"EvaluatorLogResponseJudgment"},"EvaluatorLogResponse":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"parent_id":{"type":"string","description":"Identifier of the evaluated Log. The newly created Log will have this one set as parent."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the LLM. Only populated for LLM Evaluator Logs."},"judgment":{"$ref":"#/components/schemas/EvaluatorLogResponseJudgment","description":"Evaluator assessment of the Log."},"marked_completed":{"type":"boolean","description":"Whether the Log has been manually marked as completed by a user."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."},"evaluator":{"$ref":"#/components/schemas/EvaluatorResponse","description":"Evaluator used to generate the judgment."},"parent":{"$ref":"#/components/schemas/LogResponse","description":"The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the "}},"required":["id","evaluator_logs","evaluator"],"description":"General request for creating a Log","title":"EvaluatorLogResponse"},"PromptLogResponse":{"type":"object","properties":{"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/PromptLogResponseToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"prompt":{"$ref":"#/components/schemas/PromptResponse","description":"Prompt used to generate the Log."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."}},"required":["prompt","id","evaluator_logs"],"description":"General request for creating a Log","title":"PromptLogResponse"},"ToolLogResponse":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."},"tool":{"$ref":"#/components/schemas/ToolResponse","description":"Tool used to generate the Log."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the Tool."}},"required":["id","evaluator_logs","tool"],"description":"General request for creating a Log","title":"ToolLogResponse"},"LogStatus":{"type":"string","enum":["complete","incomplete"],"description":"An enumeration.","title":"LogStatus"},"FlowLogResponse":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages that were used as an input to the Flow."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The output message returned by this Flow."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the Flow Log."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."},"flow":{"$ref":"#/components/schemas/FlowResponse","description":"Flow used to generate the Log."}},"required":["id","evaluator_logs","flow"],"description":"General request for creating a Log","title":"FlowLogResponse"},"AgentLogResponseToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentLogResponseToolChoice"},"AgentLogResponse":{"type":"object","properties":{"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/AgentLogResponseToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"agent":{"$ref":"#/components/schemas/AgentResponse","description":"Agent that generated the Log."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."}},"required":["agent","id","evaluator_logs"],"description":"General request for creating a Log","title":"AgentLogResponse"},"LogResponse":{"oneOf":[{"$ref":"#/components/schemas/PromptLogResponse"},{"$ref":"#/components/schemas/ToolLogResponse"},{"$ref":"#/components/schemas/EvaluatorLogResponse"},{"$ref":"#/components/schemas/FlowLogResponse"},{"$ref":"#/components/schemas/AgentLogResponse"}],"title":"LogResponse"},"prompts_PromptsCallRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptsCallRequestToolChoice"},"prompts_PromptsCallRequestPrompt":{"oneOf":[{"$ref":"#/components/schemas/PromptKernelRequest"},{"type":"string"}],"description":"The Prompt configuration to use. Two formats are supported:\n- An object representing the details of the Prompt configuration\n- A string representing the raw contents of a .prompt file\n\nA new Prompt version will be created if the provided details do not match any existing version.","title":"PromptsCallRequestPrompt"},"ProviderApiKeys":{"type":"object","properties":{"openai":{"type":"string"},"mock":{"type":"string"},"anthropic":{"type":"string"},"deepseek":{"type":"string"},"bedrock":{"type":"string"},"cohere":{"type":"string"},"openai_azure":{"type":"string"},"openai_azure_endpoint":{"type":"string"},"google":{"type":"string"}},"title":"ProviderApiKeys"},"PromptCallResponseToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptCallResponseToolChoice"},"PromptCallLogResponse":{"type":"object","properties":{"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"index":{"type":"integer","description":"The index of the sample in the batch."}},"required":["index"],"description":"Sample specific response details for a Prompt call","title":"PromptCallLogResponse"},"PromptCallResponse":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/PromptCallResponseToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"prompt":{"$ref":"#/components/schemas/PromptResponse","description":"Prompt used to generate the Log."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"ID of the log."},"trace_id":{"type":"string","description":"ID of the Trace containing the Prompt Call Log."},"logs":{"type":"array","items":{"$ref":"#/components/schemas/PromptCallLogResponse"},"description":"The logs generated by the Prompt call."}},"required":["prompt","id","logs"],"description":"Response model for a Prompt call with potentially multiple log samples.","title":"PromptCallResponse"},"prompts_PromptsCallStreamRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"PromptsCallStreamRequestToolChoice"},"prompts_PromptsCallStreamRequestPrompt":{"oneOf":[{"$ref":"#/components/schemas/PromptKernelRequest"},{"type":"string"}],"description":"The Prompt configuration to use. Two formats are supported:\n- An object representing the details of the Prompt configuration\n- A string representing the raw contents of a .prompt file\n\nA new Prompt version will be created if the provided details do not match any existing version.","title":"PromptsCallStreamRequestPrompt"},"PromptCallStreamResponse":{"type":"object","properties":{"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"index":{"type":"integer","description":"The index of the sample in the batch."},"id":{"type":"string","description":"ID of the log."},"prompt_id":{"type":"string","description":"ID of the Prompt the log belongs to."},"version_id":{"type":"string","description":"ID of the specific version of the Prompt."}},"required":["index","id","prompt_id","version_id"],"description":"Response model for calling Prompt in streaming mode.","title":"PromptCallStreamResponse"},"FileSortBy":{"type":"string","enum":["created_at","updated_at","name"],"description":"An enumeration.","title":"FileSortBy"},"SortOrder":{"type":"string","enum":["asc","desc"],"description":"An enumeration.","title":"SortOrder"},"PaginatedDataPromptResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/PromptResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataPromptResponse"},"prompts_PromptRequestTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"PromptRequestTemplate"},"prompts_PromptRequestStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"PromptRequestStop"},"prompts_PromptRequestReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"PromptRequestReasoningEffort"},"PopulateTemplateResponseTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"PopulateTemplateResponseTemplate"},"PopulateTemplateResponseStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"PopulateTemplateResponseStop"},"PopulateTemplateResponseReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"PopulateTemplateResponseReasoningEffort"},"PopulateTemplateResponsePopulatedTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template populated with the input values you provided in the request. Returns None if no template exists.","title":"PopulateTemplateResponsePopulatedTemplate"},"PopulateTemplateResponse":{"type":"object","properties":{"path":{"type":"string","description":"Path of the Prompt, including the name, which is used as a unique identifier."},"id":{"type":"string","description":"Unique identifier for the Prompt."},"directory_id":{"type":"string","description":"ID of the directory that the file is in on Humanloop."},"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/PopulateTemplateResponseTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/PopulateTemplateResponseStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/PopulateTemplateResponseReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolFunction"},"description":"The tool specification that the model can choose to call if Tool calling is supported."},"linked_tools":{"type":"array","items":{"$ref":"#/components/schemas/LinkedToolResponse"},"description":"The tools linked to your prompt that the model can call."},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"version_name":{"type":"string","description":"Unique name for the Prompt version. Version names must be unique for a given Prompt."},"version_description":{"type":"string","description":"Description of the version, e.g., the changes made in this version."},"description":{"type":"string","description":"Description of the Prompt."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the file."},"readme":{"type":"string","description":"Long description of the file."},"name":{"type":"string","description":"Name of the Prompt."},"schema":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The JSON schema for the Prompt."},"version_id":{"type":"string","description":"Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned."},"type":{"type":"string","enum":["prompt"]},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentResponse"},"description":"The list of environments the Prompt Version is deployed to."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The user who created the Prompt."},"last_used_at":{"type":"string","format":"date-time"},"version_logs_count":{"type":"integer","description":"The number of logs that have been generated for this Prompt Version"},"total_logs_count":{"type":"integer","description":"The number of logs that have been generated across all Prompt Versions"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/InputResponse"},"description":"Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/MonitoringEvaluatorResponse"},"description":"Evaluators that have been attached to this Prompt that are used for monitoring logs."},"evaluator_aggregates":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorAggregate"},"description":"Aggregation of Evaluator results for the Prompt Version."},"raw_file_content":{"type":"string","description":"The raw content of the Prompt. Corresponds to the .prompt file."},"populated_template":{"$ref":"#/components/schemas/PopulateTemplateResponsePopulatedTemplate","description":"The template populated with the input values you provided in the request. Returns None if no template exists."}},"required":["path","id","model","name","version_id","created_at","updated_at","last_used_at","version_logs_count","total_logs_count","inputs"],"description":"Base type that all File Responses should inherit from.\n\nAttributes defined here are common to all File Responses and should be overridden\nin the inheriting classes with documentation and appropriate Field definitions.","title":"PopulateTemplateResponse"},"ListPrompts":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/PromptResponse"},"description":"The list of Prompts."}},"required":["records"],"title":"ListPrompts"},"UpdateVersionRequest":{"type":"object","properties":{"name":{"type":"string","description":"Name of the version."},"description":{"type":"string","description":"Description of the version."}},"title":"UpdateVersionRequest"},"FileEnvironmentResponseFile":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"description":"The version of the File that is deployed to the Environment, if one is deployed.","title":"FileEnvironmentResponseFile"},"FileEnvironmentResponse":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"tag":{"$ref":"#/components/schemas/EnvironmentTag"},"file":{"$ref":"#/components/schemas/FileEnvironmentResponseFile","description":"The version of the File that is deployed to the Environment, if one is deployed."}},"required":["id","created_at","name","tag"],"description":"Response model for the List Environments endpoint under Files.\n\nContains the deployed version of the File, if one is deployed to the Environment.","title":"FileEnvironmentResponse"},"MonitoringEvaluatorVersionRequest":{"type":"object","properties":{"evaluator_version_id":{"type":"string","description":"Unique identifier for the Evaluator Version to be used for monitoring."}},"required":["evaluator_version_id"],"title":"MonitoringEvaluatorVersionRequest"},"MonitoringEvaluatorEnvironmentRequest":{"type":"object","properties":{"evaluator_id":{"type":"string","description":"Unique identifier for the Evaluator to be used for monitoring."},"environment_id":{"type":"string","description":"Unique identifier for the Environment. The Evaluator Version deployed to this Environment will be used for monitoring."}},"required":["evaluator_id","environment_id"],"title":"MonitoringEvaluatorEnvironmentRequest"},"EvaluatorActivationDeactivationRequestActivateItem":{"oneOf":[{"$ref":"#/components/schemas/MonitoringEvaluatorVersionRequest"},{"$ref":"#/components/schemas/MonitoringEvaluatorEnvironmentRequest"}],"title":"EvaluatorActivationDeactivationRequestActivateItem"},"EvaluatorActivationDeactivationRequestDeactivateItem":{"oneOf":[{"$ref":"#/components/schemas/MonitoringEvaluatorVersionRequest"},{"$ref":"#/components/schemas/MonitoringEvaluatorEnvironmentRequest"}],"title":"EvaluatorActivationDeactivationRequestDeactivateItem"},"EvaluatorActivationDeactivationRequest":{"type":"object","properties":{"activate":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequestActivateItem"},"description":"Evaluators to activate for Monitoring. These will be automatically run on new Logs."},"deactivate":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorActivationDeactivationRequestDeactivateItem"},"description":"Evaluators to deactivate. These will not be run on new Logs."}},"title":"EvaluatorActivationDeactivationRequest"},"agents_AgentLogRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentLogRequestToolChoice"},"AgentKernelRequestTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"AgentKernelRequestTemplate"},"AgentKernelRequestStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"AgentKernelRequestStop"},"AgentKernelRequestReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"AgentKernelRequestReasoningEffort"},"AgentLinkedFileRequest":{"type":"object","properties":{"type":{"type":"string","enum":["file"]},"link":{"$ref":"#/components/schemas/LinkedFileRequest"},"on_agent_call":{"$ref":"#/components/schemas/OnAgentCallEnum"}},"required":["type","link"],"title":"AgentLinkedFileRequest"},"AgentKernelRequestToolsItem":{"oneOf":[{"$ref":"#/components/schemas/AgentLinkedFileRequest"},{"$ref":"#/components/schemas/AgentInlineTool"}],"title":"AgentKernelRequestToolsItem"},"AgentKernelRequest":{"type":"object","properties":{"model":{"type":"string","description":"The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)"},"endpoint":{"$ref":"#/components/schemas/ModelEndpoints","description":"The provider model endpoint used."},"template":{"$ref":"#/components/schemas/AgentKernelRequestTemplate","description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`."},"template_language":{"$ref":"#/components/schemas/TemplateLanguage","description":"The template language to use for rendering the template."},"provider":{"$ref":"#/components/schemas/ModelProviders","description":"The company providing the underlying model service."},"max_tokens":{"type":"integer","default":-1,"description":"The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt"},"temperature":{"type":"number","format":"double","default":1,"description":"What sampling temperature to use when making a generation. Higher values means the model will be more creative."},"top_p":{"type":"number","format":"double","default":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."},"stop":{"$ref":"#/components/schemas/AgentKernelRequestStop","description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence."},"presence_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far."},"frequency_penalty":{"type":"number","format":"double","default":0,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far."},"other":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Other parameter values to be passed to the provider call."},"seed":{"type":"integer","description":"If specified, model will make a best effort to sample deterministically, but it is not guaranteed."},"response_format":{"$ref":"#/components/schemas/ResponseFormat","description":"The format of the response. Only `{\"type\": \"json_object\"}` is currently supported for chat."},"reasoning_effort":{"$ref":"#/components/schemas/AgentKernelRequestReasoningEffort","description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/AgentKernelRequestToolsItem"}},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used."},"max_iterations":{"type":"integer","description":"The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called."}},"required":["model"],"description":"Base class used by both PromptKernelRequest and AgentKernelRequest.\n\nContains the consistent Prompt-related fields.","title":"AgentKernelRequest"},"agents_AgentLogRequestAgent":{"oneOf":[{"$ref":"#/components/schemas/AgentKernelRequest"},{"type":"string"}],"description":"The Agent configuration to use. Two formats are supported:\n- An object representing the details of the Agent configuration\n- A string representing the raw contents of a .agent file\n\nA new Agent version will be created if the provided details do not match any existing version.","title":"AgentLogRequestAgent"},"CreateAgentLogResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Log."},"agent_id":{"type":"string","description":"Unique identifier for the Agent."},"version_id":{"type":"string","description":"Unique identifier for the Agent Version."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Agent Log. When a Agent Log is marked as `complete`, no more Logs can be added to it."}},"required":["id","agent_id","version_id"],"description":"Response for an Agent Log.","title":"CreateAgentLogResponse"},"agents_AgentsCallRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentsCallRequestToolChoice"},"agents_AgentsCallRequestAgent":{"oneOf":[{"$ref":"#/components/schemas/AgentKernelRequest"},{"type":"string"}],"description":"The Agent configuration to use. Two formats are supported:\n- An object representing the details of the Agent configuration\n- A string representing the raw contents of a .agent file\n\nA new Agent version will be created if the provided details do not match any existing version.","title":"AgentsCallRequestAgent"},"AgentCallResponseToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentCallResponseToolChoice"},"AgentCallResponse":{"type":"object","properties":{"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/AgentCallResponseToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"agent":{"$ref":"#/components/schemas/AgentResponse","description":"Agent that generated the Log."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Agent Log. If `incomplete`, the Agent turn was suspended due to a tool call and can be continued by calling /agents/continue with responses to the Agent's last message (which should contain tool calls). See the `previous_agent_message` field for easy access to the Agent's last message."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."},"previous_agent_message":{"$ref":"#/components/schemas/ChatMessage","description":"The Agent's last message, which should contain tool calls. Only populated if the Log is incomplete due to a suspended Agent turn with tool calls. This is useful for continuing the Agent call by calling /agents/continue."}},"required":["agent","id","evaluator_logs"],"description":"Response model for a Agent call.","title":"AgentCallResponse"},"agents_AgentsCallStreamRequestToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentsCallStreamRequestToolChoice"},"agents_AgentsCallStreamRequestAgent":{"oneOf":[{"$ref":"#/components/schemas/AgentKernelRequest"},{"type":"string"}],"description":"The Agent configuration to use. Two formats are supported:\n- An object representing the details of the Agent configuration\n- A string representing the raw contents of a .agent file\n\nA new Agent version will be created if the provided details do not match any existing version.","title":"AgentsCallStreamRequestAgent"},"AgentLogStreamResponse":{"type":"object","properties":{"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"id":{"type":"string","description":"ID of the log."},"agent_id":{"type":"string","description":"ID of the Agent the log belongs to."},"version_id":{"type":"string","description":"ID of the specific version of the Agent."}},"required":["id","agent_id","version_id"],"description":"Prompt specific log output shared between PromptLogRequest and PromptCallLogResponse.","title":"AgentLogStreamResponse"},"LogStreamResponse":{"oneOf":[{"$ref":"#/components/schemas/PromptCallStreamResponse"},{"$ref":"#/components/schemas/AgentLogStreamResponse"}],"title":"LogStreamResponse"},"AgentCallStreamResponsePayload":{"oneOf":[{"$ref":"#/components/schemas/LogStreamResponse"},{"$ref":"#/components/schemas/LogResponse"},{"$ref":"#/components/schemas/ToolCall"}],"title":"AgentCallStreamResponsePayload"},"EventType":{"type":"string","enum":["agent_turn_start","agent_turn_suspend","agent_turn_continue","agent_turn_end","agent_turn_error","agent_start","agent_update","agent_end","tool_start","tool_update","tool_end","error"],"description":"An enumeration.","title":"EventType"},"AgentCallStreamResponse":{"type":"object","properties":{"log_id":{"type":"string"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AgentCallStreamResponsePayload"},"type":{"$ref":"#/components/schemas/EventType"},"created_at":{"type":"string","format":"date-time"}},"required":["log_id","message","type","created_at"],"description":"Response model for calling Agent in streaming mode.","title":"AgentCallStreamResponse"},"AgentContinueCallResponseToolChoice":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/ToolChoice"}],"description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.","title":"AgentContinueCallResponseToolChoice"},"AgentContinueCallResponse":{"type":"object","properties":{"output_message":{"$ref":"#/components/schemas/ChatMessage","description":"The message returned by the provider."},"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt used to generate the output."},"reasoning_tokens":{"type":"integer","description":"Number of reasoning tokens used to generate the output."},"output_tokens":{"type":"integer","description":"Number of tokens in the output generated by the model."},"prompt_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the prompt."},"output_cost":{"type":"number","format":"double","description":"Cost in dollars associated to the tokens in the output."},"finish_reason":{"type":"string","description":"Reason the generation finished."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"The messages passed to the to provider chat endpoint."},"tool_choice":{"$ref":"#/components/schemas/AgentContinueCallResponseToolChoice","description":"Controls how the model uses tools. The following options are supported: \n- `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. \n- `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. \n- `'required'` means the model must call one or more of the provided tools. \n- `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function."},"agent":{"$ref":"#/components/schemas/AgentResponse","description":"Agent that generated the Log."},"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Agent Log. If `incomplete`, the Agent turn was suspended due to a tool call and can be continued by calling /agents/continue with responses to the Agent's last message (which should contain tool calls). See the `previous_agent_message` field for easy access to the Agent's last message."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"Unique identifier for the Log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"Identifier for the Trace that the Log belongs to."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."},"previous_agent_message":{"$ref":"#/components/schemas/ChatMessage","description":"The Agent's last message, which should contain tool calls. Only populated if the Log is incomplete due to a suspended Agent turn with tool calls. This is useful for continuing the Agent call by calling /agents/continue."}},"required":["agent","id","evaluator_logs"],"description":"Response model for continuing an Agent call.","title":"AgentContinueCallResponse"},"AgentContinueCallStreamResponsePayload":{"oneOf":[{"$ref":"#/components/schemas/LogStreamResponse"},{"$ref":"#/components/schemas/LogResponse"},{"$ref":"#/components/schemas/ToolCall"}],"title":"AgentContinueCallStreamResponsePayload"},"AgentContinueCallStreamResponse":{"type":"object","properties":{"log_id":{"type":"string"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AgentContinueCallStreamResponsePayload"},"type":{"$ref":"#/components/schemas/EventType"},"created_at":{"type":"string","format":"date-time"}},"required":["log_id","message","type","created_at"],"description":"Response model for continuing an Agent call in streaming mode.","title":"AgentContinueCallStreamResponse"},"PaginatedDataAgentResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataAgentResponse"},"agents_AgentRequestTemplate":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}],"description":"The template contains the main structure and instructions for the model, including input variables for dynamic values. \n\nFor chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable.\nFor completion models, provide a prompt template as a string. \n\nInput variables should be specified with double curly bracket syntax: `{{input_name}}`.","title":"AgentRequestTemplate"},"agents_AgentRequestStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.","title":"AgentRequestStop"},"agents_AgentRequestReasoningEffort":{"oneOf":[{"$ref":"#/components/schemas/OpenAiReasoningEffort"},{"type":"integer"}],"description":"Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.","title":"AgentRequestReasoningEffort"},"agents_AgentRequestToolsItem":{"oneOf":[{"$ref":"#/components/schemas/AgentLinkedFileRequest"},{"$ref":"#/components/schemas/AgentInlineTool"}],"title":"AgentRequestToolsItem"},"ListAgents":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"},"description":"The list of Agents."}},"required":["records"],"title":"ListAgents"},"FlowKernelRequest":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"A key-value object identifying the Flow Version."}},"required":["attributes"],"title":"FlowKernelRequest"},"CreateFlowLogResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Log."},"flow_id":{"type":"string","description":"Unique identifier for the Flow."},"version_id":{"type":"string","description":"Unique identifier for the Flow Version."},"log_status":{"$ref":"#/components/schemas/LogStatus","description":"Status of the Flow Log. When a Flow Log is marked as `complete`, no more Logs can be added to it."}},"required":["id","flow_id","version_id"],"description":"Response for a Flow Log.","title":"CreateFlowLogResponse"},"PaginatedDataFlowResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/FlowResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataFlowResponse"},"ListFlows":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/FlowResponse"},"description":"The list of Flows."}},"required":["records"],"title":"ListFlows"},"evaluators_CreateEvaluatorLogRequestJudgment":{"oneOf":[{"type":"boolean"},{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"number","format":"double"}],"description":"Evaluator assessment of the Log.","title":"CreateEvaluatorLogRequestJudgment"},"evaluators_CreateEvaluatorLogRequestSpec":{"oneOf":[{"$ref":"#/components/schemas/LlmEvaluatorRequest"},{"$ref":"#/components/schemas/CodeEvaluatorRequest"},{"$ref":"#/components/schemas/HumanEvaluatorRequest"},{"$ref":"#/components/schemas/ExternalEvaluatorRequest"}],"title":"CreateEvaluatorLogRequestSpec"},"CreateEvaluatorLogResponse":{"type":"object","properties":{"id":{"type":"string","description":"String identifier of the new Log."},"parent_id":{"type":"string","description":"Identifier of the evaluated parent Log."},"session_id":{"type":"string","description":"Identifier of the Session containing both the parent and the new child Log. If the parent Log does not belong to a Session, a new Session is created with this ID."},"version_id":{"type":"string","description":"Identifier of Evaluator Version for which the Log was registered."}},"required":["id","parent_id","version_id"],"title":"CreateEvaluatorLogResponse"},"PaginatedDataEvaluatorResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataEvaluatorResponse"},"evaluators_EvaluatorRequestSpec":{"oneOf":[{"$ref":"#/components/schemas/LlmEvaluatorRequest"},{"$ref":"#/components/schemas/CodeEvaluatorRequest"},{"$ref":"#/components/schemas/HumanEvaluatorRequest"},{"$ref":"#/components/schemas/ExternalEvaluatorRequest"}],"title":"EvaluatorRequestSpec"},"ListEvaluators":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorResponse"},"description":"The list of Evaluators."}},"required":["records"],"title":"ListEvaluators"},"PaginatedDatasetResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/DatasetResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDatasetResponse"},"CreateDatapointRequestTargetValue":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number","format":"double"},{"type":"boolean"},{"type":"array","items":{"description":"Any type"}},{"type":"object","additionalProperties":{"description":"Any type"}}],"title":"CreateDatapointRequestTargetValue"},"CreateDatapointRequest":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{"type":"string"},"description":"The inputs to the prompt template."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"List of chat messages to provide to the model."},"target":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CreateDatapointRequestTargetValue"},"description":"Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation."}},"title":"CreateDatapointRequest"},"UpdateDatesetAction":{"type":"string","enum":["set","add","remove"],"description":"An enumeration.","title":"UpdateDatesetAction"},"PaginatedDatapointResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/DatapointResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDatapointResponse"},"datasets_ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints":{"type":"string","enum":["latest_committed","latest_saved"],"description":"If set to 'latest_saved', include datapoints for the latest saved version. Alternatively, 'latest_committed' (deprecated) includes datapoints for the latest committed version only.","title":"ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints"},"ListDatasets":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/DatasetResponse"},"description":"The list of Datasets."}},"required":["records"],"title":"ListDatasets"},"EvaluationEvaluatorResponse":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/EvaluatorResponse"},"orchestrated":{"type":"boolean","description":"Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API."},"added_at":{"type":"string","format":"date-time","description":"When the Evaluator was added to the Evaluation."}},"required":["version","orchestrated","added_at"],"title":"EvaluationEvaluatorResponse"},"EvaluationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Evaluation. Starts with `evr`."},"runs_count":{"type":"integer","description":"The total number of Runs in the Evaluation."},"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationEvaluatorResponse"},"description":"The Evaluator Versions used to evaluate."},"name":{"type":"string","description":"Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File."},"file_id":{"type":"string","description":"Unique identifier for the File associated with the Evaluation."},"created_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/UserResponse"},"updated_at":{"type":"string","format":"date-time"},"url":{"type":"string","description":"URL to view the Evaluation on the Humanloop."}},"required":["id","runs_count","evaluators","created_at","updated_at"],"title":"EvaluationResponse"},"PaginatedEvaluationResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedEvaluationResponse"},"FileRequest":{"type":"object","properties":{"id":{"type":"string","description":"ID for an existing File."},"path":{"type":"string","description":"Path of the File, including the name. This locates the File in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`."}},"title":"FileRequest"},"EvaluatorVersionId":{"type":"object","properties":{"version_id":{"type":"string","description":"Unique identifier for the Version."},"orchestrated":{"type":"boolean","default":true,"description":"Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API."}},"required":["version_id"],"description":"Base model for specifying an Evaluator for an Evaluation.","title":"EvaluatorVersionId"},"EvaluatorFileId":{"type":"object","properties":{"environment":{"type":"string","description":"If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used."},"id":{"type":"string","description":"Unique identifier for the File."},"orchestrated":{"type":"boolean","default":true,"description":"Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API."}},"required":["id"],"description":"Base model for specifying an Evaluator for an Evaluation.","title":"EvaluatorFileId"},"EvaluatorFilePath":{"type":"object","properties":{"environment":{"type":"string","description":"If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used."},"path":{"type":"string","description":"Path identifying a File. Provide this to specify a File."},"orchestrated":{"type":"boolean","default":true,"description":"Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API."}},"required":["path"],"description":"Base model for specifying an Evaluator for an Evaluation.","title":"EvaluatorFilePath"},"evaluations_CreateEvaluationRequestEvaluatorsItem":{"oneOf":[{"$ref":"#/components/schemas/EvaluatorVersionId"},{"$ref":"#/components/schemas/EvaluatorFileId"},{"$ref":"#/components/schemas/EvaluatorFilePath"}],"title":"CreateEvaluationRequestEvaluatorsItem"},"evaluations_AddEvaluatorsRequestEvaluatorsItem":{"oneOf":[{"$ref":"#/components/schemas/EvaluatorVersionId"},{"$ref":"#/components/schemas/EvaluatorFileId"},{"$ref":"#/components/schemas/EvaluatorFilePath"}],"title":"AddEvaluatorsRequestEvaluatorsItem"},"RunVersionResponse":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"title":"RunVersionResponse"},"EvaluationStatus":{"type":"string","enum":["pending","running","completed","cancelled"],"description":"Status of an evaluation.","title":"EvaluationStatus"},"EvaluationRunResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Run."},"dataset":{"$ref":"#/components/schemas/DatasetResponse","description":"The Dataset used in the Run."},"version":{"$ref":"#/components/schemas/RunVersionResponse","description":"The version used in the Run."},"orchestrated":{"type":"boolean","description":"Whether the Run is orchestrated by Humanloop."},"added_at":{"type":"string","format":"date-time","description":"When the Run was added to the Evaluation."},"created_at":{"type":"string","format":"date-time","description":"When the Run was created."},"created_by":{"$ref":"#/components/schemas/UserResponse","description":"The User who created the Run."},"status":{"$ref":"#/components/schemas/EvaluationStatus","description":"The status of the Run."},"control":{"type":"boolean","description":"Stats for other Runs will be displayed in comparison to the control Run."}},"required":["id","orchestrated","added_at","created_at","status","control"],"title":"EvaluationRunResponse"},"EvaluationRunsResponse":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationRunResponse"},"description":"The Runs in the Evaluation."}},"required":["runs"],"title":"EvaluationRunsResponse"},"VersionId":{"type":"object","properties":{"version_id":{"type":"string","description":"Unique identifier for the Version."}},"required":["version_id"],"title":"VersionId"},"FileId":{"type":"object","properties":{"environment":{"type":"string","description":"If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used."},"id":{"type":"string","description":"Unique identifier for the File."}},"required":["id"],"description":"Specification of a File by its ID.","title":"FileId"},"FilePath":{"type":"object","properties":{"environment":{"type":"string","description":"If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used."},"path":{"type":"string","description":"Path identifying a File. Provide this to specify a File."}},"required":["path"],"description":"Specification of a File by its path.","title":"FilePath"},"evaluations_CreateRunRequestDataset":{"oneOf":[{"$ref":"#/components/schemas/VersionId"},{"$ref":"#/components/schemas/FileId"},{"$ref":"#/components/schemas/FilePath"}],"description":"Dataset to use in this Run.","title":"CreateRunRequestDataset"},"evaluations_CreateRunRequestVersion":{"oneOf":[{"$ref":"#/components/schemas/VersionId"},{"$ref":"#/components/schemas/FileId"},{"$ref":"#/components/schemas/FilePath"}],"description":"Version to use in this Run.","title":"CreateRunRequestVersion"},"NumericEvaluatorStatsResponse":{"type":"object","properties":{"evaluator_version_id":{"type":"string","description":"Unique identifier for the Evaluator Version."},"total_logs":{"type":"integer","description":"The total number of Logs generated by this Evaluator Version on the Evaluated Version's Logs. This includes Nulls and Errors."},"num_judgments":{"type":"integer","description":"The total number of Evaluator judgments for this Evaluator Version. This excludes Nulls and Errors."},"num_nulls":{"type":"integer","description":"The total number of null judgments (i.e. abstentions) for this Evaluator Version."},"num_errors":{"type":"integer","description":"The total number of errored Evaluators for this Evaluator Version."},"mean":{"type":"number","format":"double"},"sum":{"type":"number","format":"double"},"std":{"type":"number","format":"double"},"percentiles":{"type":"object","additionalProperties":{"type":"number","format":"double"}}},"required":["evaluator_version_id","total_logs","num_judgments","num_nulls","num_errors","percentiles"],"description":"Base attributes for stats for an Evaluator Version-Evaluated Version pair\nin the Evaluation.","title":"NumericEvaluatorStatsResponse"},"BooleanEvaluatorStatsResponse":{"type":"object","properties":{"evaluator_version_id":{"type":"string","description":"Unique identifier for the Evaluator Version."},"total_logs":{"type":"integer","description":"The total number of Logs generated by this Evaluator Version on the Evaluated Version's Logs. This includes Nulls and Errors."},"num_judgments":{"type":"integer","description":"The total number of Evaluator judgments for this Evaluator Version. This excludes Nulls and Errors."},"num_nulls":{"type":"integer","description":"The total number of null judgments (i.e. abstentions) for this Evaluator Version."},"num_errors":{"type":"integer","description":"The total number of errored Evaluators for this Evaluator Version."},"num_true":{"type":"integer","description":"The total number of `True` judgments for this Evaluator Version."},"num_false":{"type":"integer","description":"The total number of `False` judgments for this Evaluator Version."}},"required":["evaluator_version_id","total_logs","num_judgments","num_nulls","num_errors","num_true","num_false"],"description":"Base attributes for stats for an Evaluator Version-Evaluated Version pair\nin the Evaluation.","title":"BooleanEvaluatorStatsResponse"},"SelectEvaluatorStatsResponse":{"type":"object","properties":{"evaluator_version_id":{"type":"string","description":"Unique identifier for the Evaluator Version."},"total_logs":{"type":"integer","description":"The total number of Logs generated by this Evaluator Version on the Evaluated Version's Logs. This includes Nulls and Errors."},"num_judgments":{"type":"integer","description":"The total number of Evaluator judgments for this Evaluator Version. This excludes Nulls and Errors."},"num_nulls":{"type":"integer","description":"The total number of null judgments (i.e. abstentions) for this Evaluator Version."},"num_errors":{"type":"integer","description":"The total number of errored Evaluators for this Evaluator Version."},"num_judgments_per_option":{"type":"object","additionalProperties":{"type":"integer"},"description":"The total number of Evaluator judgments for this Evaluator Version. This is a mapping of the option name to the number of judgments for that option."}},"required":["evaluator_version_id","total_logs","num_judgments","num_nulls","num_errors","num_judgments_per_option"],"description":"Also used for 'multi_select' Evaluator versions","title":"SelectEvaluatorStatsResponse"},"TextEvaluatorStatsResponse":{"type":"object","properties":{"evaluator_version_id":{"type":"string","description":"Unique identifier for the Evaluator Version."},"total_logs":{"type":"integer","description":"The total number of Logs generated by this Evaluator Version on the Evaluated Version's Logs. This includes Nulls and Errors."},"num_judgments":{"type":"integer","description":"The total number of Evaluator judgments for this Evaluator Version. This excludes Nulls and Errors."},"num_nulls":{"type":"integer","description":"The total number of null judgments (i.e. abstentions) for this Evaluator Version."},"num_errors":{"type":"integer","description":"The total number of errored Evaluators for this Evaluator Version."}},"required":["evaluator_version_id","total_logs","num_judgments","num_nulls","num_errors"],"description":"Base attributes for stats for an Evaluator Version-Evaluated Version pair\nin the Evaluation.","title":"TextEvaluatorStatsResponse"},"RunStatsResponseEvaluatorStatsItem":{"oneOf":[{"$ref":"#/components/schemas/NumericEvaluatorStatsResponse"},{"$ref":"#/components/schemas/BooleanEvaluatorStatsResponse"},{"$ref":"#/components/schemas/SelectEvaluatorStatsResponse"},{"$ref":"#/components/schemas/TextEvaluatorStatsResponse"}],"title":"RunStatsResponseEvaluatorStatsItem"},"RunStatsResponse":{"type":"object","properties":{"run_id":{"type":"string","description":"Unique identifier for the Run."},"version_id":{"type":"string","description":"Unique identifier for the evaluated Version."},"batch_id":{"type":"string","description":"Unique identifier for the batch of Logs to include in the Evaluation."},"num_logs":{"type":"integer","description":"The total number of existing Logs in this Run."},"evaluator_stats":{"type":"array","items":{"$ref":"#/components/schemas/RunStatsResponseEvaluatorStatsItem"},"description":"Stats for each Evaluator Version applied to this Run."},"status":{"$ref":"#/components/schemas/EvaluationStatus","description":"The current status of the Run."}},"required":["run_id","num_logs","evaluator_stats","status"],"description":"Stats for a Run in the Evaluation.","title":"RunStatsResponse"},"EvaluationStats":{"type":"object","properties":{"run_stats":{"type":"array","items":{"$ref":"#/components/schemas/RunStatsResponse"},"description":"Stats for each Run in the Evaluation."},"progress":{"type":"string","description":"A summary string report of the Evaluation's progress you can print to the command line;helpful when integrating Evaluations with CI/CD."},"report":{"type":"string","description":"A summary string report of the Evaluation you can print to command line;helpful when integrating Evaluations with CI/CD."},"status":{"$ref":"#/components/schemas/EvaluationStatus","description":"The current status of the Evaluation."}},"required":["run_stats","status"],"title":"EvaluationStats"},"EvaluationLogResponse":{"type":"object","properties":{"run_id":{"type":"string","description":"Unique identifier for the Run."},"datapoint":{"$ref":"#/components/schemas/DatapointResponse","description":"The Datapoint used to generate the Log"},"log":{"$ref":"#/components/schemas/LogResponse","description":"The Log that was evaluated by the Evaluator."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"The Evaluator Logs containing the judgments for the Log."}},"required":["run_id","log","evaluator_logs"],"title":"EvaluationLogResponse"},"PaginatedDataEvaluationLogResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationLogResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataEvaluationLogResponse"},"ToolKernelRequest":{"type":"object","properties":{"function":{"$ref":"#/components/schemas/ToolFunction","description":"Callable function specification of the Tool shown to the model for tool calling."},"source_code":{"type":"string","description":"Code source of the Tool."},"setup_values":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/"},"attributes":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used."}},"title":"ToolKernelRequest"},"ToolCallResponse":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","description":"When the logged event started."},"end_time":{"type":"string","format":"date-time","description":"When the logged event ended."},"tool":{"$ref":"#/components/schemas/ToolResponse","description":"Tool used to generate the Log."},"output":{"type":"string","description":"Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later."},"created_at":{"type":"string","format":"date-time","description":"User defined timestamp for when the log was created. "},"error":{"type":"string","description":"Error message if the log is an error."},"provider_latency":{"type":"number","format":"double","description":"Duration of the logged event in seconds."},"stdout":{"type":"string","description":"Captured log and debug statements."},"provider_request":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw request sent to provider."},"provider_response":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Raw response received the provider."},"inputs":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The inputs passed to the prompt template."},"source":{"type":"string","description":"Identifies where the model was called from."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Any additional metadata to record."},"source_datapoint_id":{"type":"string","description":"Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair."},"trace_parent_id":{"type":"string","description":"The ID of the parent Log to nest this Log under in a Trace."},"batches":{"type":"array","items":{"type":"string"},"description":"Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations"},"user":{"type":"string","description":"End-user ID related to the Log."},"environment":{"type":"string","description":"The name of the Environment the Log is associated to."},"save":{"type":"boolean","default":true,"description":"Whether the request/response payloads will be stored on Humanloop."},"log_id":{"type":"string","description":"This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you."},"id":{"type":"string","description":"ID of the log."},"evaluator_logs":{"type":"array","items":{"$ref":"#/components/schemas/EvaluatorLogResponse"},"description":"List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log."},"trace_flow_id":{"type":"string","description":"Identifier for the Flow that the Trace belongs to."},"trace_id":{"type":"string","description":"ID of the Trace containing the Tool Call Log."},"trace_children":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"description":"Logs nested under this Log in the Trace."}},"required":["tool","id","evaluator_logs"],"description":"Response model for a Tool call.","title":"ToolCallResponse"},"CreateToolLogResponse":{"type":"object","properties":{"id":{"type":"string","description":"String ID of log."},"tool_id":{"type":"string","description":"ID of the Tool the log belongs to."},"version_id":{"type":"string","description":"ID of the specific version of the Tool."},"session_id":{"type":"string","description":"String ID of session the log belongs to."}},"required":["id","tool_id","version_id"],"title":"CreateToolLogResponse"},"PaginatedDataToolResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataToolResponse"},"ListTools":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponse"},"description":"The list of Tools."}},"required":["records"],"title":"ListTools"},"FileEnvironmentVariableRequest":{"type":"object","properties":{"name":{"type":"string","description":"Name of the environment variable."},"value":{"type":"string","description":"Value of the environment variable."}},"required":["name","value"],"title":"FileEnvironmentVariableRequest"},"FileType":{"type":"string","enum":["prompt","tool","dataset","evaluator","flow","agent"],"description":"Enum for File types.","title":"FileType"},"PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponseRecordsItem":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"title":"PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponseRecordsItem"},"PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponseRecordsItem"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataUnionPromptResponseToolResponseDatasetResponseEvaluatorResponseFlowResponseAgentResponse"},"files_RetrieveByPathFilesRetrieveByPathPostResponse":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"title":"RetrieveByPathFilesRetrieveByPathPostResponse"},"DirectoryResponse":{"type":"object","properties":{"id":{"type":"string","description":"String ID of directory. Starts with `dir_`."},"parent_id":{"type":"string","description":"ID of the parent directory. Will be `None` if the directory is the root directory. Starts with `dir_`."},"name":{"type":"string","description":"Name of the directory."},"description":{"type":"string","description":"Description of the directory."},"path":{"type":"string","description":"Path to the directory, relative to the root directory. Includes name, e.g. `path/to/directory`."},"readme":{"type":"string","description":"Long description of the directory."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the directory."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","path","tags","created_at","updated_at"],"title":"DirectoryResponse"},"DirectoryWithParentsAndChildrenResponseFilesItem":{"oneOf":[{"$ref":"#/components/schemas/PromptResponse"},{"$ref":"#/components/schemas/ToolResponse"},{"$ref":"#/components/schemas/EvaluatorResponse"},{"$ref":"#/components/schemas/DatasetResponse"},{"$ref":"#/components/schemas/FlowResponse"},{"$ref":"#/components/schemas/AgentResponse"}],"title":"DirectoryWithParentsAndChildrenResponseFilesItem"},"DirectoryWithParentsAndChildrenResponse":{"type":"object","properties":{"id":{"type":"string","description":"String ID of directory. Starts with `dir_`."},"parent_id":{"type":"string","description":"ID of the parent directory. Will be `None` if the directory is the root directory. Starts with `dir_`."},"name":{"type":"string","description":"Name of the directory."},"description":{"type":"string","description":"Description of the directory."},"path":{"type":"string","description":"Path to the directory, relative to the root directory. Includes name, e.g. `path/to/directory`."},"readme":{"type":"string","description":"Long description of the directory."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tags associated with the directory."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"subdirectories":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryResponse"},"description":"List of subdirectories in the directory."},"files":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryWithParentsAndChildrenResponseFilesItem"},"description":"List of files in the directory."},"parents":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryResponse"},"description":"List of parent directories of the directory."}},"required":["id","name","path","tags","created_at","updated_at","subdirectories","files","parents"],"title":"DirectoryWithParentsAndChildrenResponse"},"PaginatedDataLogResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"}},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["records","page","size","total"],"title":"PaginatedDataLogResponse"}},"securitySchemes":{"default":{"type":"apiKey","in":"header","name":"X-API-KEY"}}}}