v1

latestOpenAPI 3.1.02026-07-13154170539.0 KB
Logs

Create From Logs

Creates one or more entries based on body.equation and body.referenced_logs.

When body.derived=True (default): Eagerly computes each derived value and stores it in LogEvent.data.

When body.derived=False: Computes values and stores them directly in the base logs as regular entries.

The context parameter can be:

  • A string: Uses the string as the context name with default values (description=None, is_versioned=False)
  • An object: Uses the object's name, description, and is_versioned properties
post/v0/logs/derived

Request body

project_namestring required

Name of the project the stored entries will be associated to.

keystring required

The name of the entry.

equationstring required

The equation for computing the value of each derived entry.

referenced_logsobject required

The logs to use for each newly created derived entry, either as a list of log ids or as a set of arguments for the get_logs endpoint.

derivedboolean

Whether to create derived logs (True) or static entries in base logs (False).

Example request

{
  "project_name": "eval-project",
  "context": {
    "name": "experiment1/trial1",
    "description": "Context for experiment 1 trial 1",
    "is_versioned": true,
    "allow_duplicates": true,
    "unique_keys": {
      "company_id": "int",
      "department_id": "int",
      "first_name": "str",
      "last_name": "str"
    },
    "auto_counting": {
      "company_id": "department_id"
    },
    "foreign_keys": [
      {
        "default": 0,
        "name": "department_id",
        "on_delete": "SET DEFAULT",
        "on_update": "CASCADE",
        "references": "Departments.id"
      }
    ]
  },
  "key": "score_diff",
  "equation": "{log0:score} - {log1:score}",
  "referenced_logs": {
    "log0": [
      0,
      1,
      2
    ],
    "log1": {
      "filter_expr": "score > 0.5"
    }
  }
}

Response

Derived log entries created successfully.

{"stackTrail":"paths:/v0/logs/derived:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}