DeepchecksLLMClient.log_interaction#

DeepchecksLLMClient.log_interaction(app_name: str, version_name: str, env_type: EnvType | str, input: str | None = None, output: str | None = None, full_prompt: str = None, information_retrieval: List[str] | str = None, history: List[str] | str = None, annotation: AnnotationType | str = None, annotation_reason: str = None, user_interaction_id: str = None, started_at: datetime | float | None = None, finished_at: datetime | float | None = None, steps: List[Step] = None, custom_props: Dict[str, Any] = None, vuln_type: str | None = None, vuln_trigger_str: str | None = None, topic: str | None = None, is_completed: bool = True) str#

Log a single interaction.

Parameters:
app_namestr

Application name

version_namestr

Name of the version to which this interaction will be added

env_typeEnvType or str

Type of environment. Allowed values: ‘eval’, ‘prod’, ‘pentest’

inputstr or None

Input data

outputstr or None

Output data

full_promptstr or None

Full prompt data

information_retrievalstr or list of str

Information retrieval.

historystr

History

annotationAnnotationType or str

Annotation type of the interaction. Allowed values: ‘good’, ‘bad’, ‘unknown’

user_interaction_idstr

Unique identifier of the interaction

started_atdatetime or float

Timestamp the interaction started at. Datetime format is deprecated, use timestamp instead

finished_atdatetime or float

Timestamp the interaction finished at. Datetime format is deprecated, use timestamp instead

stepslist of Step

List of steps taken during the interaction

custom_propsdict

Additional custom properties

annotation_reasonstr, optional

Reason for the annotation

vuln_typestr, optional

Type of vulnerability (Only used in case of EnvType.PENTEST and must be sent there).

vuln_trigger_strstr, optional

Vulnerability trigger string (Only used in case of EnvType.PENTEST and is optional there).

topic: t.Optional[str], optional

The custom topic of the interaction

is_completed: bool

Completed interactions will be shown in the system, and cannot be further modified except for annotations, topics and custom properties.

Returns:
str

The uuid of the interaction