def log(
    project: Optional[str] = None,
    skip_duplicates: bool = True,
    api_key: Optional[str] = None,
    **kwargs,
) -> Log:

source code

Creates one or more logs associated to a project. Logs are LLM-call-level data that might depend on other variables. This method returns the id of the new stored log.

Arguments:

  • project - Name of the project the stored logs will be associated to.
  • skip_duplicates - Whether to skip creating new log entries for identical log
  • api_key - If specified, unify API key to be used. Defaults to the value in the
  • kwargs - Dictionary containing one or more key:value pairs that will be logged

Returns:

The unique id of newly created log entry.