1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
* langfuse
*
* ## Authentication Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings: - username: Langfuse Public Key - password: Langfuse Secret Key ## Exports - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct Trace {
/// The unique identifier of a trace
#[serde(rename = "id")]
pub id: String,
/// The timestamp when the trace was created
#[serde(rename = "timestamp")]
pub timestamp: String,
/// The name of the trace
#[serde(
rename = "name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub name: Option<Option<String>>,
/// The input data of the trace. Can be any JSON.
#[serde(
rename = "input",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub input: Option<Option<serde_json::Value>>,
/// The output data of the trace. Can be any JSON.
#[serde(
rename = "output",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub output: Option<Option<serde_json::Value>>,
/// The session identifier associated with the trace
#[serde(
rename = "sessionId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub session_id: Option<Option<String>>,
/// The release version of the application when the trace was created
#[serde(
rename = "release",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub release: Option<Option<String>>,
/// The version of the trace
#[serde(
rename = "version",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub version: Option<Option<String>>,
/// The user identifier associated with the trace
#[serde(
rename = "userId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub user_id: Option<Option<String>>,
/// The metadata associated with the trace. Can be any JSON.
#[serde(
rename = "metadata",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub metadata: Option<Option<serde_json::Value>>,
/// The tags associated with the trace.
#[serde(rename = "tags")]
pub tags: Vec<String>,
/// Public traces are accessible via url without login
#[serde(rename = "public")]
pub public: bool,
/// The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
#[serde(rename = "environment")]
pub environment: String,
}
impl Trace {
pub fn new(
id: String,
timestamp: String,
tags: Vec<String>,
public: bool,
environment: String,
) -> Trace {
Trace {
id,
timestamp,
name: None,
input: None,
output: None,
session_id: None,
release: None,
version: None,
user_id: None,
metadata: None,
tags,
public,
environment,
}
}
}