> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://humanloop.com/docs/v4/api/logs/update/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/_mcp/server. # Update PATCH https://api.humanloop.com/v4/logs/{id} Content-Type: application/json Update a logged datapoint in your Humanloop project. Reference: https://humanloop.com/docs/v4/api/logs/update ## Authentication - `X-API-KEY` header (required) — API Key authentication via header ## Request ### Path parameters - `id` (string, required) — String ID of logged datapoint to return. Starts with `data_`. ### Body (application/json) This endpoint expects an UpdateLogRequest. - `output` (string, optional) — Generated output from your model for the provided inputs. - `error` (string, optional) — Error message if the log is an error. - `duration` (double, optional) — Duration of the logged event in seconds. ## Response ### 200 Successful Response - `id` (string, required) — String ID of logged datapoint. Starts with `data_`. - `config` (ConfigResponse, required) - `evaluation_results` (list of EvaluationResultResponse, required) - `observability_status` (enum, required) — Status of a Log for observability. Observability is implemented by running monitoring Evaluators on Logs. - Allowed values: `pending`, `running`, `completed`, `failed` - `updated_at` (datetime, required) - `project` (string, optional) — The name of the project associated with this log - `project_id` (string, optional) — The unique ID of the project associated with this log. - `session_id` (string, optional) — ID of the session to associate the datapoint. - `session_reference_id` (string, optional) — A unique string identifying the session to associate the datapoint to. Allows you to log multiple datapoints to a session (using an ID kept by your internal systems) by passing the same `session_reference_id` in subsequent log requests. Specify at most one of this or `session_id`. - `parent_id` (string, optional) — ID associated to the parent datapoint in a session. - `parent_reference_id` (string, optional) — A unique string identifying the previously-logged parent datapoint in a session. Allows you to log nested datapoints with your internal system IDs by passing the same reference ID as `parent_id` in a prior log request. Specify at most one of this or `parent_id`. Note that this cannot refer to a datapoint being logged in the same request. - `inputs` (map from string to any, optional) — The inputs passed to the prompt template. - `source` (string, optional) — Identifies where the model was called from. - `metadata` (map from string to any, optional) — Any additional metadata to record. - `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop. - `source_datapoint_id` (string, optional) — ID of the source datapoint if this is a log derived from a datapoint in a dataset. - `reference_id` (string, optional) — Unique user-provided string identifying the datapoint. - `messages` (list of ChatMessageWithToolCall, optional) — The messages passed to the to provider chat endpoint. - `output` (string, optional) — Generated output from your model for the provided inputs. Can be `None` if logging an error, or if logging a parent datapoint with the intention to populate it later - `judgment` (Judgment, optional) - `config_id` (string, optional) — Unique ID of a config to associate to the log. - `environment` (string, optional) — The environment name used to create the log. - `feedback` (list of FeedbackResponse, optional) - `created_at` (datetime, optional) — User defined timestamp for when the log was created. - `error` (string, optional) — Error message if the log is an error. - `stdout` (string, optional) — Captured log and debug statements. - `duration` (double, optional) — Duration of the logged event in seconds. - `output_message` (ChatMessageWithToolCall, optional) — The message returned by the provider. - `prompt_tokens` (integer, optional) — Number of tokens in the prompt used to generate the output. - `output_tokens` (integer, optional) — Number of tokens in the output generated by the model. - `prompt_cost` (double, optional) — Cost in dollars associated to the tokens in the prompt. - `output_cost` (double, optional) — Cost in dollars associated to the tokens in the output. - `provider_request` (map from string to any, optional) — Raw request sent to provider. - `provider_response` (map from string to any, optional) — Raw response received the provider. - `user` (string, optional) — User email address provided when creating the datapoint. - `provider_latency` (double, optional) — Latency of provider response. - `tokens` (integer, optional) — Total number of tokens in the prompt and output. - `raw_output` (string, optional) — Raw output from the provider. - `finish_reason` (string, optional) — Reason the generation finished. - `tools` (list of ToolResultResponse, optional) - `tool_choice` (LogResponseToolChoice, optional) — Controls how the model uses tools. The following options are supported: 'none' forces the model to not call a tool; the default when no tools are provided as part of the model config. 'auto' the model can decide to call one of the provided tools; the default when tools are provided as part of the model config. Providing \{'type': 'function', 'function': \{name': \}} forces the model to use the named function. - `batch_ids` (list of string, optional) — List of batch IDs the log belongs to. ## Errors ### 422 Logs Update Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### ConfigResponse - `type`: `model` - `id` (string, required) — String ID of config. Starts with `config_`. - `model` (string, required) — The model instance used. E.g. text-davinci-002. - `chat_template` (list of ChatMessageWithToolCall, optional) — Messages prepended to the list of messages sent to the provider. These messages that will take your specified inputs to form your final request to the provider model. NB: Input variables within the template should be specified with syntax: `{{input_name}}`. - `description` (string, optional) — A description of the model config. - `endpoint` (enum, optional) — The provider model endpoint used. - Allowed values: `complete`, `chat`, `edit` - `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. - `max_tokens` (integer, optional, default: -1) — 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 - `name` (string, optional) — A friendly display name for the model config. If not provided, a name will be generated. - `other` (map from string to any, optional) — Other parameter values to be passed to the provider call. - `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. - `prompt_template` (string, optional) — Prompt template that will take your specified inputs to form your final request to the model. NB: Input variables within the prompt template should be specified with syntax: `{{input_name}}`. - `provider` (enum, optional) — The company providing the underlying model service. - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate` - `reasoning_effort` (ModelConfigResponseReasoningEffort, optional) — 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. - `response_format` (ResponseFormat, optional) — The format of the response. Only type json_object is currently supported for chat. - `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed. - `stop` (ModelConfigResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. - `temperature` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative. - `template_language` (enum, optional) — The template language to use for rendering the template. - Allowed values: `default`, `jinja` - `tools` (list of ToolResponse, optional) — Tools shown to the model. - `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. - `tool_configs` (list of ToolConfigResponse, optional, deprecated) — NB: Deprecated with tools field. Definition of tools shown to the model. - `type`: `tool` - `id` (string, required) — String ID of config. Starts with `config_`. - `name` (string, required) — Name for the tool referenced by the model. - `status` (string, required) — Whether the config is committed or not. - `created_by` (UserResponse, optional) — The user who created the config. - `description` (string, optional) — Description of the tool referenced by the model - `is_preset` (boolean, optional) — Whether the tool is one where Humanloop defines runtime or not. - `other` (map from string to any, optional) — Other parameters that define the config. - `parameters` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `preset_name` (string, optional) — If is_preset = true, this is the name of the preset tool on Humanloop. This is used as the key to lookup the Humanloop runtime of the tool - `setup_schema` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `signature` (string, optional) — The function signature of the tool when being called. - `source` (enum, optional) — Source of the tool. If defined at an organization level will be 'organization' else 'inline'. - Allowed values: `organization`, `inline` - `source_code` (string, optional) — Code source of the tool. - `type`: `evaluator` - `evaluator_type` (string, required) — Type of evaluator. - `id` (string, required) — String ID of config. Starts with `config_`. - `name` (string, required) — Name of config. - `status` (string, required) — Whether the config is committed or not. - `arguments_type` (enum, optional) — Whether this evaluator is target-free or target-required. - Allowed values: `target_free`, `target_required` - `code` (string, optional) — The code for the evaluator. This code will be executed in a sandboxed environment. - `created_by` (UserResponse, optional) — The user who created the config. - `description` (string, optional) — Description of config. - `model_config` (ModelConfigResponse, optional) — The model config defining the LLM evaluator. - `other` (map from string to any, optional) — Other parameters that define the config. - `return_type` (enum, optional) — The type of the return value of the evaluator. - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text` - `type`: `agent` - `agent_class` (string, required) — Class of the agent. - `id` (string, required) — String ID of config. Starts with `config_`. - `model_config` (ModelConfigRequest, required) — Model config associated with the agent. - `name` (string, required) — Name of config. - `status` (string, required) — Whether the config is committed or not. - `created_by` (UserResponse, optional) — The user who created the config. - `description` (string, optional) — Description of config. - `other` (map from string to any, optional) — Other parameters that define the config. - `tools` (list of ToolConfigRequest, optional) — Tools associated with the agent. - `type`: `generic` - `id` (string, required) — String ID of config. Starts with `config_`. - `name` (string, required) — Name of config. - `status` (string, required) — Whether the config is committed or not. - `created_by` (UserResponse, optional) — The user who created the config. - `description` (string, optional) — Description of config. - `other` (map from string to any, optional) — Other parameters that define the config. ### EvaluationResultResponse - `id` (string, required) - `evaluator_id` (string, required) - `evaluator_version_id` (string, required) - `log_id` (string, required) - `updated_at` (datetime, required) - `created_at` (datetime, required) - `evaluation_id` (string, optional) - `log` (LogResponse, optional) — Request model for logging a datapoint. - `version_id` (string, optional) - `version` (any, optional) - `value` (Value, optional) - `error` (string, optional) - `evaluator_log` (LogResponse, optional) — Request model for logging a datapoint. ### ChatMessageWithToolCall - `role` (enum, required) — Role of the message author. - Allowed values: `user`, `assistant`, `system`, `tool`, `developer` - `content` (Content, optional) — The content of the message. - `name` (string, optional) — Optional name of the message author. - `tool_call_id` (string, optional) — Tool call that this message is responding to. - `tool_calls` (list of ToolCall, optional) — A list of tool calls requested by the assistant. - `thinking` (list of ChatMessageWithToolCallThinkingItem, optional) — Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. - `tool_call` (FunctionTool, optional, deprecated) — NB: Deprecated in favour of tool_calls. A tool call requested by the assistant. ### Judgment ### FeedbackResponse - `type` (FeedbackResponseType, required) — The type of feedback. The default feedback types available are 'rating', 'action', 'issue', 'correction', and 'comment'. - `id` (string, required) — String ID of user feedback. Starts with `ann_`, short for annotation. - `value` (FeedbackResponseValue, optional) — The feedback value to set. This would be the appropriate text for 'correction' or 'comment', or a label to apply for 'rating', 'action', or 'issue'. - `data_id` (string, optional) — ID to associate the feedback to a previously logged datapoint. - `user` (string, optional) — A unique identifier to who provided the feedback. - `created_at` (datetime, optional) — User defined timestamp for when the feedback was created. ### ToolResultResponse A result from a tool used to populate the prompt template - `id` (string, required) - `name` (string, required) - `signature` (string, required) - `result` (string, required) ### LogResponseToolChoice Controls how the model uses tools. The following options are supported: 'none' forces the model to not call a tool; the default when no tools are provided as part of the model config. 'auto' the model can decide to call one of the provided tools; the default when tools are provided as part of the model config. Providing \{'type': 'function', 'function': \{name': \}} forces the model to use the named function. ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ModelConfigResponseReasoningEffort 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. ### ResponseFormat Response format of the model. - `type` (enum, required) - Allowed values: `json_object`, `json_schema` - `json_schema` (map from string to any, optional) — The JSON schema of the response format if type is json_schema. ### ModelConfigResponseStop The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. ### ToolResponse - `id` (string, required) — The ID of the tool. Starts with either `config_` or `oc_`. - `name` (string, required) — Name for the tool referenced by the model. - `description` (string, optional) — Description of the tool referenced by the model - `parameters` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `source` (string, optional) — The origin of the tool ### ToolConfigResponse - `id` (string, required) — String ID of config. Starts with `config_`. - `status` (string, required) — Whether the config is committed or not. - `name` (string, required) — Name for the tool referenced by the model. - `other` (map from string to any, optional) — Other parameters that define the config. - `created_by` (UserResponse, optional) — The user who created the config. - `description` (string, optional) — Description of the tool referenced by the model - `source` (enum, optional) — Source of the tool. If defined at an organization level will be 'organization' else 'inline'. - Allowed values: `organization`, `inline` - `source_code` (string, optional) — Code source of the tool. - `setup_schema` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `parameters` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `signature` (string, optional) — The function signature of the tool when being called. - `is_preset` (boolean, optional) — Whether the tool is one where Humanloop defines runtime or not. - `preset_name` (string, optional) — If is_preset = true, this is the name of the preset tool on Humanloop. This is used as the key to lookup the Humanloop runtime of the tool ### UserResponse - `id` (string, required) — String ID of user. Starts with `usr_`. - `email_address` (string, required) — The user's email address. - `verified` (boolean, required) — Whether the user has verified their email address. - `full_name` (string, optional) — The user's full name. ### ModelConfigResponse Model config request. Contains fields that are common to all (i.e. both chat and complete) endpoints. - `id` (string, required) — String ID of config. Starts with `config_`. - `model` (string, required) — The model instance used. E.g. text-davinci-002. - `other` (map from string to any, optional) — Other parameter values to be passed to the provider call. - `name` (string, optional) — A friendly display name for the model config. If not provided, a name will be generated. - `description` (string, optional) — A description of the model config. - `provider` (enum, optional) — The company providing the underlying model service. - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate` - `max_tokens` (integer, optional, default: -1) — 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` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative. - `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. - `stop` (ModelConfigResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. - `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. - `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. - `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed. - `response_format` (ResponseFormat, optional) — The format of the response. Only type json_object is currently supported for chat. - `reasoning_effort` (ModelConfigResponseReasoningEffort, optional) — 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. - `template_language` (enum, optional) — The template language to use for rendering the template. - Allowed values: `default`, `jinja` - `prompt_template` (string, optional) — Prompt template that will take your specified inputs to form your final request to the model. NB: Input variables within the prompt template should be specified with syntax: `{{input_name}}`. - `chat_template` (list of ChatMessageWithToolCall, optional) — Messages prepended to the list of messages sent to the provider. These messages that will take your specified inputs to form your final request to the provider model. NB: Input variables within the template should be specified with syntax: `{{input_name}}`. - `tools` (list of ToolResponse, optional) — Tools shown to the model. - `endpoint` (enum, optional) — The provider model endpoint used. - Allowed values: `complete`, `chat`, `edit` - `tool_configs` (list of ToolConfigResponse, optional, deprecated) — NB: Deprecated with tools field. Definition of tools shown to the model. ### ModelConfigRequest Model config used for logging both chat and completion. - `model` (string, required) — The model instance used. E.g. text-davinci-002. - `name` (string, optional) — A friendly display name for the model config. If not provided, a name will be generated. - `description` (string, optional) — A description of the model config. - `provider` (enum, optional) — The company providing the underlying model service. - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate` - `max_tokens` (integer, optional, default: -1) — 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` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative. - `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. - `stop` (ModelConfigRequestStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. - `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. - `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. - `other` (map from string to any, optional) — Other parameter values to be passed to the provider call. - `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed. - `response_format` (ResponseFormat, optional) — The format of the response. Only type json_object is currently supported for chat. - `reasoning_effort` (ModelConfigRequestReasoningEffort, optional) — 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. - `template_language` (enum, optional) — The template language to use for rendering the template. - Allowed values: `default`, `jinja` - `endpoint` (enum, optional) — The provider model endpoint used. - Allowed values: `complete`, `chat`, `edit` - `prompt_template` (string, optional) — Prompt template that will take your specified inputs to form your final request to the model. Input variables within the prompt template should be specified with syntax: `{{input_name}}`. - `chat_template` (list of ChatMessageWithToolCall, optional) — Messages prepended to the list of messages sent to the provider. These messages that will take your specified inputs to form your final request to the provider model. Input variables within the template should be specified with syntax: `{{input_name}}`. - `tools` (list of ModelConfigRequestToolsItem, optional) — Make tools available to OpenAIs chat model as functions. ### ToolConfigRequest Definition of tool within a model config. The subset of ToolConfig parameters received by the chat endpoint. Does not have things like the signature or setup schema. - `name` (string, required) — The name of the tool shown to the model. - `description` (string, optional) — The description of the tool shown to the model. - `strict` (boolean, optional) — Whether the tool is strict or not. If strict, the model will be forced to respond with JSON matching the parameters schema. - `parameters` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `source` (enum, optional) — Source of the tool. If defined at an organization level will be 'organization' else 'inline'. - Allowed values: `organization`, `inline` - `source_code` (string, optional) — Code source of the tool. - `other` (map from string to any, optional) — Other parameters that define the config. - `preset_name` (string, optional) — If is_preset = true, this is the name of the preset tool on Humanloop. This is used as the key to look up the Humanloop runtime of the tool ### LogResponse Request model for logging a datapoint. - `id` (string, required) — String ID of logged datapoint. Starts with `data_`. - `config` (ConfigResponse, required) - `evaluation_results` (list of EvaluationResultResponse, required) - `observability_status` (enum, required) — Status of a Log for observability. Observability is implemented by running monitoring Evaluators on Logs. - Allowed values: `pending`, `running`, `completed`, `failed` - `updated_at` (datetime, required) - `project` (string, optional) — The name of the project associated with this log - `project_id` (string, optional) — The unique ID of the project associated with this log. - `session_id` (string, optional) — ID of the session to associate the datapoint. - `session_reference_id` (string, optional) — A unique string identifying the session to associate the datapoint to. Allows you to log multiple datapoints to a session (using an ID kept by your internal systems) by passing the same `session_reference_id` in subsequent log requests. Specify at most one of this or `session_id`. - `parent_id` (string, optional) — ID associated to the parent datapoint in a session. - `parent_reference_id` (string, optional) — A unique string identifying the previously-logged parent datapoint in a session. Allows you to log nested datapoints with your internal system IDs by passing the same reference ID as `parent_id` in a prior log request. Specify at most one of this or `parent_id`. Note that this cannot refer to a datapoint being logged in the same request. - `inputs` (map from string to any, optional) — The inputs passed to the prompt template. - `source` (string, optional) — Identifies where the model was called from. - `metadata` (map from string to any, optional) — Any additional metadata to record. - `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop. - `source_datapoint_id` (string, optional) — ID of the source datapoint if this is a log derived from a datapoint in a dataset. - `reference_id` (string, optional) — Unique user-provided string identifying the datapoint. - `messages` (list of ChatMessageWithToolCall, optional) — The messages passed to the to provider chat endpoint. - `output` (string, optional) — Generated output from your model for the provided inputs. Can be `None` if logging an error, or if logging a parent datapoint with the intention to populate it later - `judgment` (Judgment, optional) - `config_id` (string, optional) — Unique ID of a config to associate to the log. - `environment` (string, optional) — The environment name used to create the log. - `feedback` (list of FeedbackResponse, optional) - `created_at` (datetime, optional) — User defined timestamp for when the log was created. - `error` (string, optional) — Error message if the log is an error. - `stdout` (string, optional) — Captured log and debug statements. - `duration` (double, optional) — Duration of the logged event in seconds. - `output_message` (ChatMessageWithToolCall, optional) — The message returned by the provider. - `prompt_tokens` (integer, optional) — Number of tokens in the prompt used to generate the output. - `output_tokens` (integer, optional) — Number of tokens in the output generated by the model. - `prompt_cost` (double, optional) — Cost in dollars associated to the tokens in the prompt. - `output_cost` (double, optional) — Cost in dollars associated to the tokens in the output. - `provider_request` (map from string to any, optional) — Raw request sent to provider. - `provider_response` (map from string to any, optional) — Raw response received the provider. - `user` (string, optional) — User email address provided when creating the datapoint. - `provider_latency` (double, optional) — Latency of provider response. - `tokens` (integer, optional) — Total number of tokens in the prompt and output. - `raw_output` (string, optional) — Raw output from the provider. - `finish_reason` (string, optional) — Reason the generation finished. - `tools` (list of ToolResultResponse, optional) - `tool_choice` (LogResponseToolChoice, optional) — Controls how the model uses tools. The following options are supported: 'none' forces the model to not call a tool; the default when no tools are provided as part of the model config. 'auto' the model can decide to call one of the provided tools; the default when tools are provided as part of the model config. Providing \{'type': 'function', 'function': \{name': \}} forces the model to use the named function. - `batch_ids` (list of string, optional) — List of batch IDs the log belongs to. ### Value ### Content The content of the message. ### ToolCall A tool call to be made. - `id` (string, required) - `type` ("function", required) — The type of tool to call. - `function` (FunctionTool, required) — A function tool to be called by the model where user owns runtime. ### ChatMessageWithToolCallThinkingItem - `type`: `thinking` - `signature` (string, required) — Cryptographic signature that verifies the thinking block was generated by Anthropic. - `thinking` (string, required) — Model's chain-of-thought for providing the response. - `type`: `redacted_thinking` - `data` (string, required) — Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic ### FunctionTool A function tool to be called by the model where user owns runtime. - `name` (string, required) - `arguments` (string, optional) ### FeedbackResponseType The type of feedback. The default feedback types available are 'rating', 'action', 'issue', 'correction', and 'comment'. ### FeedbackResponseValue The feedback value to set. This would be the appropriate text for 'correction' or 'comment', or a label to apply for 'rating', 'action', or 'issue'. ### ToolChoice Tool choice to force the model to use a tool. - `type` ("function", required) — The type of tool to call. - `function` (FunctionToolChoice, required) — A function tool to be called by the model where user owns runtime. ### ValidationErrorLocItem ### ModelConfigRequestStop The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. ### ModelConfigRequestReasoningEffort 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. ### ModelConfigRequestToolsItem ### FunctionToolChoice A function tool to be called by the model where user owns runtime. - `name` (string, required) ### LinkedToolRequest - `id` (string, required) — The ID of the linked tool. Starts with "oc_" - `source` ("organization", required) — The source of the linked tool. For a linked tool it should be `organization` - `name` (string, optional) — The name of the linked tool. - `description` (string, optional) — The description of the linked tool. - `strict` (boolean, optional) — Whether the tool is strict or not. If strict, the model will be forced to respond with JSON matching the parameters schema. - `parameters` (map from string to any, optional) — The parameters of the linked tool. ### ModelConfigToolRequest Definition of tool within a model config. The subset of ToolConfig parameters received by the chat endpoint. Does not have things like the signature or setup schema. - `name` (string, required) — The name of the tool shown to the model. - `description` (string, optional) — The description of the tool shown to the model. - `strict` (boolean, optional) — Whether the tool is strict or not. If strict, the model will be forced to respond with JSON matching the parameters schema. - `parameters` (map from string to any, optional) — Definition of parameters needed to run the tool. Provided in jsonschema format: https://json-schema.org/ - `source` (enum, optional) — Source of the tool. If defined at an organization level will be 'organization' else 'inline'. - Allowed values: `organization`, `inline` - `source_code` (string, optional) — Code source of the tool. - `other` (map from string to any, optional) — Other parameters that define the config. - `preset_name` (string, optional) — If is_preset = true, this is the name of the preset tool on Humanloop. This is used as the key to look up the Humanloop runtime of the tool ## Examples **Request** ```json {} ``` **Response** ```json { "id": "id", "config": { "type": "model", "id": "id", "model": "model", "chat_template": [ { "role": "user" } ], "description": "description", "endpoint": "complete", "frequency_penalty": 1.1, "max_tokens": 1, "name": "name", "other": { "key": "value" }, "presence_penalty": 1.1, "prompt_template": "prompt_template", "provider": "anthropic", "reasoning_effort": "high", "response_format": { "type": "json_object", "json_schema": { "key": "value" } }, "seed": 1, "stop": "stop", "temperature": 1.1, "template_language": "default", "tools": [ { "id": "id", "name": "name" } ], "top_p": 1.1, "tool_configs": [ { "id": "id", "status": "status", "name": "name" } ] }, "evaluation_results": [ { "id": "id", "evaluator_id": "evaluator_id", "evaluator_version_id": "evaluator_version_id", "log_id": "log_id", "updated_at": "2024-01-15T09:30:00Z", "created_at": "2024-01-15T09:30:00Z", "evaluation_id": "evaluation_id", "version_id": "version_id", "version": { "key": "value" }, "value": true, "error": "error" } ], "observability_status": "pending", "updated_at": "2024-01-15T09:30:00Z", "project": "project", "project_id": "project_id", "session_id": "session_id", "session_reference_id": "session_reference_id", "parent_id": "parent_id", "parent_reference_id": "parent_reference_id", "inputs": { "key": "value" }, "source": "source", "metadata": { "key": "value" }, "save": true, "source_datapoint_id": "source_datapoint_id", "reference_id": "reference_id", "messages": [ { "role": "user", "content": "content", "name": "name", "tool_call_id": "tool_call_id", "tool_calls": [ { "id": "id", "type": "function", "function": { "name": "name" } } ], "thinking": [ { "type": "thinking", "signature": "signature", "thinking": "thinking" } ], "tool_call": { "name": "name" } } ], "output": "output", "judgment": true, "config_id": "config_id", "environment": "environment", "feedback": [ { "type": "rating", "id": "id", "value": true, "data_id": "data_id", "user": "user", "created_at": "2024-01-15T09:30:00Z" } ], "created_at": "2024-01-15T09:30:00Z", "error": "error", "stdout": "stdout", "duration": 1.1, "output_message": { "role": "user", "content": "content", "name": "name", "tool_call_id": "tool_call_id", "tool_calls": [ { "id": "id", "type": "function", "function": { "name": "name" } } ], "thinking": [ { "type": "thinking", "signature": "signature", "thinking": "thinking" } ], "tool_call": { "name": "name", "arguments": "arguments" } }, "prompt_tokens": 1, "output_tokens": 1, "prompt_cost": 1.1, "output_cost": 1.1, "provider_request": { "key": "value" }, "provider_response": { "key": "value" }, "user": "user", "provider_latency": 1.1, "tokens": 1, "raw_output": "raw_output", "finish_reason": "finish_reason", "tools": [ { "id": "id", "name": "name", "signature": "signature", "result": "result" } ], "tool_choice": "none", "batch_ids": [ "batch_ids" ] } ``` **SDK Code** ```python import requests url = "https://api.humanloop.com/v4/logs/id" payload = {} headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.humanloop.com/v4/logs/id'; const options = { method: 'PATCH', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v4/logs/id" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v4/logs/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v4/logs/id") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v4/logs/id', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v4/logs/id"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v4/logs/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```