langfuse.api

  1# This file was auto-generated by Fern from our API Definition.
  2
  3from .resources import (
  4    AccessDeniedError,
  5    BaseEvent,
  6    BasePrompt,
  7    BaseScore,
  8    BooleanScore,
  9    CategoricalScore,
 10    ChatMessage,
 11    ChatPrompt,
 12    Comment,
 13    CommentObjectType,
 14    ConfigCategory,
 15    CreateChatPromptRequest,
 16    CreateCommentRequest,
 17    CreateCommentResponse,
 18    CreateDatasetItemRequest,
 19    CreateDatasetRequest,
 20    CreateDatasetRunItemRequest,
 21    CreateEventBody,
 22    CreateEventEvent,
 23    CreateGenerationBody,
 24    CreateGenerationEvent,
 25    CreateModelRequest,
 26    CreateObservationEvent,
 27    CreatePromptRequest,
 28    CreatePromptRequest_Chat,
 29    CreatePromptRequest_Text,
 30    CreateScoreConfigRequest,
 31    CreateScoreRequest,
 32    CreateScoreResponse,
 33    CreateScoreValue,
 34    CreateSpanBody,
 35    CreateSpanEvent,
 36    CreateTextPromptRequest,
 37    DailyMetrics,
 38    DailyMetricsDetails,
 39    Dataset,
 40    DatasetItem,
 41    DatasetRun,
 42    DatasetRunItem,
 43    DatasetRunWithItems,
 44    DatasetStatus,
 45    Error,
 46    GetCommentsResponse,
 47    GetMediaResponse,
 48    GetMediaUploadUrlRequest,
 49    GetMediaUploadUrlResponse,
 50    GetScoresResponse,
 51    GetScoresResponseData,
 52    GetScoresResponseDataBoolean,
 53    GetScoresResponseDataCategorical,
 54    GetScoresResponseDataNumeric,
 55    GetScoresResponseData_Boolean,
 56    GetScoresResponseData_Categorical,
 57    GetScoresResponseData_Numeric,
 58    GetScoresResponseTraceData,
 59    HealthResponse,
 60    IngestionError,
 61    IngestionEvent,
 62    IngestionEvent_EventCreate,
 63    IngestionEvent_GenerationCreate,
 64    IngestionEvent_GenerationUpdate,
 65    IngestionEvent_ObservationCreate,
 66    IngestionEvent_ObservationUpdate,
 67    IngestionEvent_ScoreCreate,
 68    IngestionEvent_SdkLog,
 69    IngestionEvent_SpanCreate,
 70    IngestionEvent_SpanUpdate,
 71    IngestionEvent_TraceCreate,
 72    IngestionResponse,
 73    IngestionSuccess,
 74    IngestionUsage,
 75    MapValue,
 76    MediaContentType,
 77    MethodNotAllowedError,
 78    Model,
 79    ModelUsageUnit,
 80    NotFoundError,
 81    NumericScore,
 82    Observation,
 83    ObservationBody,
 84    ObservationLevel,
 85    ObservationType,
 86    Observations,
 87    ObservationsView,
 88    ObservationsViews,
 89    OpenAiUsage,
 90    OptionalObservationBody,
 91    PaginatedDatasetItems,
 92    PaginatedDatasetRuns,
 93    PaginatedDatasets,
 94    PaginatedModels,
 95    PaginatedSessions,
 96    PatchMediaBody,
 97    Project,
 98    Projects,
 99    Prompt,
100    PromptMeta,
101    PromptMetaListResponse,
102    Prompt_Chat,
103    Prompt_Text,
104    Score,
105    ScoreBody,
106    ScoreConfig,
107    ScoreConfigs,
108    ScoreDataType,
109    ScoreEvent,
110    ScoreSource,
111    Score_Boolean,
112    Score_Categorical,
113    Score_Numeric,
114    SdkLogBody,
115    SdkLogEvent,
116    ServiceUnavailableError,
117    Session,
118    SessionWithTraces,
119    Sort,
120    TextPrompt,
121    Trace,
122    TraceBody,
123    TraceEvent,
124    TraceWithDetails,
125    TraceWithFullDetails,
126    Traces,
127    UnauthorizedError,
128    UpdateEventBody,
129    UpdateGenerationBody,
130    UpdateGenerationEvent,
131    UpdateObservationEvent,
132    UpdateSpanBody,
133    UpdateSpanEvent,
134    Usage,
135    UsageByModel,
136    comments,
137    commons,
138    dataset_items,
139    dataset_run_items,
140    datasets,
141    health,
142    ingestion,
143    media,
144    metrics,
145    models,
146    observations,
147    projects,
148    prompts,
149    score,
150    score_configs,
151    sessions,
152    trace,
153    utils,
154)
155
156__all__ = [
157    "AccessDeniedError",
158    "BaseEvent",
159    "BasePrompt",
160    "BaseScore",
161    "BooleanScore",
162    "CategoricalScore",
163    "ChatMessage",
164    "ChatPrompt",
165    "Comment",
166    "CommentObjectType",
167    "ConfigCategory",
168    "CreateChatPromptRequest",
169    "CreateCommentRequest",
170    "CreateCommentResponse",
171    "CreateDatasetItemRequest",
172    "CreateDatasetRequest",
173    "CreateDatasetRunItemRequest",
174    "CreateEventBody",
175    "CreateEventEvent",
176    "CreateGenerationBody",
177    "CreateGenerationEvent",
178    "CreateModelRequest",
179    "CreateObservationEvent",
180    "CreatePromptRequest",
181    "CreatePromptRequest_Chat",
182    "CreatePromptRequest_Text",
183    "CreateScoreConfigRequest",
184    "CreateScoreRequest",
185    "CreateScoreResponse",
186    "CreateScoreValue",
187    "CreateSpanBody",
188    "CreateSpanEvent",
189    "CreateTextPromptRequest",
190    "DailyMetrics",
191    "DailyMetricsDetails",
192    "Dataset",
193    "DatasetItem",
194    "DatasetRun",
195    "DatasetRunItem",
196    "DatasetRunWithItems",
197    "DatasetStatus",
198    "Error",
199    "GetCommentsResponse",
200    "GetMediaResponse",
201    "GetMediaUploadUrlRequest",
202    "GetMediaUploadUrlResponse",
203    "GetScoresResponse",
204    "GetScoresResponseData",
205    "GetScoresResponseDataBoolean",
206    "GetScoresResponseDataCategorical",
207    "GetScoresResponseDataNumeric",
208    "GetScoresResponseData_Boolean",
209    "GetScoresResponseData_Categorical",
210    "GetScoresResponseData_Numeric",
211    "GetScoresResponseTraceData",
212    "HealthResponse",
213    "IngestionError",
214    "IngestionEvent",
215    "IngestionEvent_EventCreate",
216    "IngestionEvent_GenerationCreate",
217    "IngestionEvent_GenerationUpdate",
218    "IngestionEvent_ObservationCreate",
219    "IngestionEvent_ObservationUpdate",
220    "IngestionEvent_ScoreCreate",
221    "IngestionEvent_SdkLog",
222    "IngestionEvent_SpanCreate",
223    "IngestionEvent_SpanUpdate",
224    "IngestionEvent_TraceCreate",
225    "IngestionResponse",
226    "IngestionSuccess",
227    "IngestionUsage",
228    "MapValue",
229    "MediaContentType",
230    "MethodNotAllowedError",
231    "Model",
232    "ModelUsageUnit",
233    "NotFoundError",
234    "NumericScore",
235    "Observation",
236    "ObservationBody",
237    "ObservationLevel",
238    "ObservationType",
239    "Observations",
240    "ObservationsView",
241    "ObservationsViews",
242    "OpenAiUsage",
243    "OptionalObservationBody",
244    "PaginatedDatasetItems",
245    "PaginatedDatasetRuns",
246    "PaginatedDatasets",
247    "PaginatedModels",
248    "PaginatedSessions",
249    "PatchMediaBody",
250    "Project",
251    "Projects",
252    "Prompt",
253    "PromptMeta",
254    "PromptMetaListResponse",
255    "Prompt_Chat",
256    "Prompt_Text",
257    "Score",
258    "ScoreBody",
259    "ScoreConfig",
260    "ScoreConfigs",
261    "ScoreDataType",
262    "ScoreEvent",
263    "ScoreSource",
264    "Score_Boolean",
265    "Score_Categorical",
266    "Score_Numeric",
267    "SdkLogBody",
268    "SdkLogEvent",
269    "ServiceUnavailableError",
270    "Session",
271    "SessionWithTraces",
272    "Sort",
273    "TextPrompt",
274    "Trace",
275    "TraceBody",
276    "TraceEvent",
277    "TraceWithDetails",
278    "TraceWithFullDetails",
279    "Traces",
280    "UnauthorizedError",
281    "UpdateEventBody",
282    "UpdateGenerationBody",
283    "UpdateGenerationEvent",
284    "UpdateObservationEvent",
285    "UpdateSpanBody",
286    "UpdateSpanEvent",
287    "Usage",
288    "UsageByModel",
289    "comments",
290    "commons",
291    "dataset_items",
292    "dataset_run_items",
293    "datasets",
294    "health",
295    "ingestion",
296    "media",
297    "metrics",
298    "models",
299    "observations",
300    "projects",
301    "prompts",
302    "score",
303    "score_configs",
304    "sessions",
305    "trace",
306    "utils",
307]
class AccessDeniedError(langfuse.api.core.api_error.ApiError):
 9class AccessDeniedError(ApiError):
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=403, body=body)

Common base class for all non-exit exceptions.

AccessDeniedError(body: Any)
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=403, body=body)
Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class BaseEvent(pydantic.v1.main.BaseModel):
11class BaseEvent(pydantic_v1.BaseModel):
12    id: str = pydantic_v1.Field()
13    """
14    UUID v4 that identifies the event
15    """
16
17    timestamp: str = pydantic_v1.Field()
18    """
19    Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
20    """
21
22    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
23    """
24    Optional. Metadata field used by the Langfuse SDKs for debugging.
25    """
26
27    def json(self, **kwargs: typing.Any) -> str:
28        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        return super().json(**kwargs_with_defaults)
30
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
33        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
34
35        return deep_union_pydantic_dicts(
36            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
37        )
38
39    class Config:
40        frozen = True
41        smart_union = True
42        extra = pydantic_v1.Extra.allow
43        json_encoders = {dt.datetime: serialize_datetime}
id: str

UUID v4 that identifies the event

timestamp: str

Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).

metadata: Optional[Any]

Optional. Metadata field used by the Langfuse SDKs for debugging.

def json(self, **kwargs: Any) -> str:
27    def json(self, **kwargs: typing.Any) -> str:
28        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
33        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
34
35        return deep_union_pydantic_dicts(
36            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
37        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class BaseEvent.Config:
39    class Config:
40        frozen = True
41        smart_union = True
42        extra = pydantic_v1.Extra.allow
43        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class BasePrompt(pydantic.v1.main.BaseModel):
11class BasePrompt(pydantic_v1.BaseModel):
12    name: str
13    version: int
14    config: typing.Any
15    labels: typing.List[str] = pydantic_v1.Field()
16    """
17    List of deployment labels of this prompt version.
18    """
19
20    tags: typing.List[str] = pydantic_v1.Field()
21    """
22    List of tags. Used to filter via UI and API. The same across versions of a prompt.
23    """
24
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)
28
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )
36
37    class Config:
38        frozen = True
39        smart_union = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
name: str
version: int
config: Any
labels: List[str]

List of deployment labels of this prompt version.

tags: List[str]

List of tags. Used to filter via UI and API. The same across versions of a prompt.

def json(self, **kwargs: Any) -> str:
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class BasePrompt.Config:
37    class Config:
38        frozen = True
39        smart_union = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class BaseScore(pydantic.v1.main.BaseModel):
12class BaseScore(pydantic_v1.BaseModel):
13    id: str
14    trace_id: str = pydantic_v1.Field(alias="traceId")
15    name: str
16    source: ScoreSource
17    observation_id: typing.Optional[str] = pydantic_v1.Field(
18        alias="observationId", default=None
19    )
20    timestamp: dt.datetime
21    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
22    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
23    author_user_id: typing.Optional[str] = pydantic_v1.Field(
24        alias="authorUserId", default=None
25    )
26    comment: typing.Optional[str] = None
27    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
28    """
29    Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range
30    """
31
32    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
33    """
34    Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
35    """
36
37    def json(self, **kwargs: typing.Any) -> str:
38        kwargs_with_defaults: typing.Any = {
39            "by_alias": True,
40            "exclude_unset": True,
41            **kwargs,
42        }
43        return super().json(**kwargs_with_defaults)
44
45    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
46        kwargs_with_defaults_exclude_unset: typing.Any = {
47            "by_alias": True,
48            "exclude_unset": True,
49            **kwargs,
50        }
51        kwargs_with_defaults_exclude_none: typing.Any = {
52            "by_alias": True,
53            "exclude_none": True,
54            **kwargs,
55        }
56
57        return deep_union_pydantic_dicts(
58            super().dict(**kwargs_with_defaults_exclude_unset),
59            super().dict(**kwargs_with_defaults_exclude_none),
60        )
61
62    class Config:
63        frozen = True
64        smart_union = True
65        allow_population_by_field_name = True
66        populate_by_name = True
67        extra = pydantic_v1.Extra.allow
68        json_encoders = {dt.datetime: serialize_datetime}
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]

Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range

queue_id: Optional[str]

Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.

def json(self, **kwargs: Any) -> str:
37    def json(self, **kwargs: typing.Any) -> str:
38        kwargs_with_defaults: typing.Any = {
39            "by_alias": True,
40            "exclude_unset": True,
41            **kwargs,
42        }
43        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
45    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
46        kwargs_with_defaults_exclude_unset: typing.Any = {
47            "by_alias": True,
48            "exclude_unset": True,
49            **kwargs,
50        }
51        kwargs_with_defaults_exclude_none: typing.Any = {
52            "by_alias": True,
53            "exclude_none": True,
54            **kwargs,
55        }
56
57        return deep_union_pydantic_dicts(
58            super().dict(**kwargs_with_defaults_exclude_unset),
59            super().dict(**kwargs_with_defaults_exclude_none),
60        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class BaseScore.Config:
62    class Config:
63        frozen = True
64        smart_union = True
65        allow_population_by_field_name = True
66        populate_by_name = True
67        extra = pydantic_v1.Extra.allow
68        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class BooleanScore(langfuse.api.BaseScore):
12class BooleanScore(BaseScore):
13    value: float = pydantic_v1.Field()
14    """
15    The numeric value of the score. Equals 1 for "True" and 0 for "False"
16    """
17
18    string_value: str = pydantic_v1.Field(alias="stringValue")
19    """
20    The string representation of the score value. Is inferred from the numeric value and equals "True" or "False"
21    """
22
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)
26
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )
34
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
value: float

The numeric value of the score. Equals 1 for "True" and 0 for "False"

string_value: str

The string representation of the score value. Is inferred from the numeric value and equals "True" or "False"

def json(self, **kwargs: Any) -> str:
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class BooleanScore.Config:
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CategoricalScore(langfuse.api.BaseScore):
12class CategoricalScore(BaseScore):
13    value: typing.Optional[float] = pydantic_v1.Field(default=None)
14    """
15    Only defined if a config is linked. Represents the numeric category mapping of the stringValue
16    """
17
18    string_value: str = pydantic_v1.Field(alias="stringValue")
19    """
20    The string representation of the score value. If no config is linked, can be any string. Otherwise, must map to a config category
21    """
22
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)
26
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )
34
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
value: Optional[float]

Only defined if a config is linked. Represents the numeric category mapping of the stringValue

string_value: str

The string representation of the score value. If no config is linked, can be any string. Otherwise, must map to a config category

def json(self, **kwargs: Any) -> str:
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class CategoricalScore.Config:
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ChatMessage(pydantic.v1.main.BaseModel):
11class ChatMessage(pydantic_v1.BaseModel):
12    role: str
13    content: str
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
role: str
content: str
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ChatMessage.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ChatPrompt(langfuse.api.BasePrompt):
13class ChatPrompt(BasePrompt):
14    prompt: typing.List[ChatMessage]
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
prompt: List[ChatMessage]
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BasePrompt
name
version
config
labels
tags
class ChatPrompt.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Comment(pydantic.v1.main.BaseModel):
12class Comment(pydantic_v1.BaseModel):
13    id: str
14    project_id: str = pydantic_v1.Field(alias="projectId")
15    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
16    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
17    object_type: CommentObjectType = pydantic_v1.Field(alias="objectType")
18    object_id: str = pydantic_v1.Field(alias="objectId")
19    content: str
20    author_user_id: typing.Optional[str] = pydantic_v1.Field(
21        alias="authorUserId", default=None
22    )
23
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().json(**kwargs_with_defaults)
31
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
38        kwargs_with_defaults_exclude_none: typing.Any = {
39            "by_alias": True,
40            "exclude_none": True,
41            **kwargs,
42        }
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset),
46            super().dict(**kwargs_with_defaults_exclude_none),
47        )
48
49    class Config:
50        frozen = True
51        smart_union = True
52        allow_population_by_field_name = True
53        populate_by_name = True
54        extra = pydantic_v1.Extra.allow
55        json_encoders = {dt.datetime: serialize_datetime}
id: str
project_id: str
created_at: datetime.datetime
updated_at: datetime.datetime
object_type: CommentObjectType
object_id: str
content: str
author_user_id: Optional[str]
def json(self, **kwargs: Any) -> str:
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
38        kwargs_with_defaults_exclude_none: typing.Any = {
39            "by_alias": True,
40            "exclude_none": True,
41            **kwargs,
42        }
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset),
46            super().dict(**kwargs_with_defaults_exclude_none),
47        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Comment.Config:
49    class Config:
50        frozen = True
51        smart_union = True
52        allow_population_by_field_name = True
53        populate_by_name = True
54        extra = pydantic_v1.Extra.allow
55        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CommentObjectType(builtins.str, enum.Enum):
10class CommentObjectType(str, enum.Enum):
11    TRACE = "TRACE"
12    OBSERVATION = "OBSERVATION"
13    SESSION = "SESSION"
14    PROMPT = "PROMPT"
15
16    def visit(
17        self,
18        trace: typing.Callable[[], T_Result],
19        observation: typing.Callable[[], T_Result],
20        session: typing.Callable[[], T_Result],
21        prompt: typing.Callable[[], T_Result],
22    ) -> T_Result:
23        if self is CommentObjectType.TRACE:
24            return trace()
25        if self is CommentObjectType.OBSERVATION:
26            return observation()
27        if self is CommentObjectType.SESSION:
28            return session()
29        if self is CommentObjectType.PROMPT:
30            return prompt()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

TRACE = <CommentObjectType.TRACE: 'TRACE'>
OBSERVATION = <CommentObjectType.OBSERVATION: 'OBSERVATION'>
SESSION = <CommentObjectType.SESSION: 'SESSION'>
PROMPT = <CommentObjectType.PROMPT: 'PROMPT'>
def visit( self, trace: Callable[[], ~T_Result], observation: Callable[[], ~T_Result], session: Callable[[], ~T_Result], prompt: Callable[[], ~T_Result]) -> ~T_Result:
16    def visit(
17        self,
18        trace: typing.Callable[[], T_Result],
19        observation: typing.Callable[[], T_Result],
20        session: typing.Callable[[], T_Result],
21        prompt: typing.Callable[[], T_Result],
22    ) -> T_Result:
23        if self is CommentObjectType.TRACE:
24            return trace()
25        if self is CommentObjectType.OBSERVATION:
26            return observation()
27        if self is CommentObjectType.SESSION:
28            return session()
29        if self is CommentObjectType.PROMPT:
30            return prompt()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class ConfigCategory(pydantic.v1.main.BaseModel):
11class ConfigCategory(pydantic_v1.BaseModel):
12    value: float
13    label: str
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
value: float
label: str
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ConfigCategory.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateChatPromptRequest(pydantic.v1.main.BaseModel):
12class CreateChatPromptRequest(pydantic_v1.BaseModel):
13    name: str
14    prompt: typing.List[ChatMessage]
15    config: typing.Optional[typing.Any] = None
16    labels: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
17    """
18    List of deployment labels of this prompt version.
19    """
20
21    tags: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
22    """
23    List of tags to apply to all versions of this prompt.
24    """
25
26    def json(self, **kwargs: typing.Any) -> str:
27        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        return super().json(**kwargs_with_defaults)
29
30    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
33
34        return deep_union_pydantic_dicts(
35            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
36        )
37
38    class Config:
39        frozen = True
40        smart_union = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
name: str
prompt: List[ChatMessage]
config: Optional[Any]
labels: Optional[List[str]]

List of deployment labels of this prompt version.

tags: Optional[List[str]]

List of tags to apply to all versions of this prompt.

def json(self, **kwargs: Any) -> str:
26    def json(self, **kwargs: typing.Any) -> str:
27        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
30    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
33
34        return deep_union_pydantic_dicts(
35            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
36        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateChatPromptRequest.Config:
38    class Config:
39        frozen = True
40        smart_union = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateCommentRequest(pydantic.v1.main.BaseModel):
11class CreateCommentRequest(pydantic_v1.BaseModel):
12    project_id: str = pydantic_v1.Field(alias="projectId")
13    """
14    The id of the project to attach the comment to.
15    """
16
17    object_type: str = pydantic_v1.Field(alias="objectType")
18    """
19    The type of the object to attach the comment to (trace, observation, session, prompt).
20    """
21
22    object_id: str = pydantic_v1.Field(alias="objectId")
23    """
24    The id of the object to attach the comment to. If this does not reference a valid existing object, an error will be thrown.
25    """
26
27    content: str = pydantic_v1.Field()
28    """
29    The content of the comment. May include markdown. Currently limited to 500 characters.
30    """
31
32    author_user_id: typing.Optional[str] = pydantic_v1.Field(
33        alias="authorUserId", default=None
34    )
35    """
36    The id of the user who created the comment.
37    """
38
39    def json(self, **kwargs: typing.Any) -> str:
40        kwargs_with_defaults: typing.Any = {
41            "by_alias": True,
42            "exclude_unset": True,
43            **kwargs,
44        }
45        return super().json(**kwargs_with_defaults)
46
47    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
48        kwargs_with_defaults_exclude_unset: typing.Any = {
49            "by_alias": True,
50            "exclude_unset": True,
51            **kwargs,
52        }
53        kwargs_with_defaults_exclude_none: typing.Any = {
54            "by_alias": True,
55            "exclude_none": True,
56            **kwargs,
57        }
58
59        return deep_union_pydantic_dicts(
60            super().dict(**kwargs_with_defaults_exclude_unset),
61            super().dict(**kwargs_with_defaults_exclude_none),
62        )
63
64    class Config:
65        frozen = True
66        smart_union = True
67        allow_population_by_field_name = True
68        populate_by_name = True
69        extra = pydantic_v1.Extra.allow
70        json_encoders = {dt.datetime: serialize_datetime}
project_id: str

The id of the project to attach the comment to.

object_type: str

The type of the object to attach the comment to (trace, observation, session, prompt).

object_id: str

The id of the object to attach the comment to. If this does not reference a valid existing object, an error will be thrown.

content: str

The content of the comment. May include markdown. Currently limited to 500 characters.

author_user_id: Optional[str]

The id of the user who created the comment.

def json(self, **kwargs: Any) -> str:
39    def json(self, **kwargs: typing.Any) -> str:
40        kwargs_with_defaults: typing.Any = {
41            "by_alias": True,
42            "exclude_unset": True,
43            **kwargs,
44        }
45        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
47    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
48        kwargs_with_defaults_exclude_unset: typing.Any = {
49            "by_alias": True,
50            "exclude_unset": True,
51            **kwargs,
52        }
53        kwargs_with_defaults_exclude_none: typing.Any = {
54            "by_alias": True,
55            "exclude_none": True,
56            **kwargs,
57        }
58
59        return deep_union_pydantic_dicts(
60            super().dict(**kwargs_with_defaults_exclude_unset),
61            super().dict(**kwargs_with_defaults_exclude_none),
62        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateCommentRequest.Config:
64    class Config:
65        frozen = True
66        smart_union = True
67        allow_population_by_field_name = True
68        populate_by_name = True
69        extra = pydantic_v1.Extra.allow
70        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateCommentResponse(pydantic.v1.main.BaseModel):
11class CreateCommentResponse(pydantic_v1.BaseModel):
12    id: str = pydantic_v1.Field()
13    """
14    The id of the created object in Langfuse
15    """
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)
24
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )
41
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
id: str

The id of the created object in Langfuse

def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateCommentResponse.Config:
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateDatasetItemRequest(pydantic.v1.main.BaseModel):
12class CreateDatasetItemRequest(pydantic_v1.BaseModel):
13    dataset_name: str = pydantic_v1.Field(alias="datasetName")
14    input: typing.Optional[typing.Any] = None
15    expected_output: typing.Optional[typing.Any] = pydantic_v1.Field(alias="expectedOutput", default=None)
16    metadata: typing.Optional[typing.Any] = None
17    source_trace_id: typing.Optional[str] = pydantic_v1.Field(alias="sourceTraceId", default=None)
18    source_observation_id: typing.Optional[str] = pydantic_v1.Field(alias="sourceObservationId", default=None)
19    id: typing.Optional[str] = pydantic_v1.Field(default=None)
20    """
21    Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets.
22    """
23
24    status: typing.Optional[DatasetStatus] = pydantic_v1.Field(default=None)
25    """
26    Defaults to ACTIVE for newly created items
27    """
28
29    def json(self, **kwargs: typing.Any) -> str:
30        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        return super().json(**kwargs_with_defaults)
32
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
35        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
39        )
40
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
dataset_name: str
input: Optional[Any]
expected_output: Optional[Any]
metadata: Optional[Any]
source_trace_id: Optional[str]
source_observation_id: Optional[str]
id: Optional[str]

Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets.

status: Optional[DatasetStatus]

Defaults to ACTIVE for newly created items

def json(self, **kwargs: Any) -> str:
29    def json(self, **kwargs: typing.Any) -> str:
30        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
35        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
39        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateDatasetItemRequest.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateDatasetRequest(pydantic.v1.main.BaseModel):
11class CreateDatasetRequest(pydantic_v1.BaseModel):
12    name: str
13    description: typing.Optional[str] = None
14    metadata: typing.Optional[typing.Any] = None
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        extra = pydantic_v1.Extra.allow
32        json_encoders = {dt.datetime: serialize_datetime}
name: str
description: Optional[str]
metadata: Optional[Any]
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateDatasetRequest.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        extra = pydantic_v1.Extra.allow
32        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateDatasetRunItemRequest(pydantic.v1.main.BaseModel):
11class CreateDatasetRunItemRequest(pydantic_v1.BaseModel):
12    run_name: str = pydantic_v1.Field(alias="runName")
13    run_description: typing.Optional[str] = pydantic_v1.Field(alias="runDescription", default=None)
14    """
15    Description of the run. If run exists, description will be updated.
16    """
17
18    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
19    """
20    Metadata of the dataset run, updates run if run already exists
21    """
22
23    dataset_item_id: str = pydantic_v1.Field(alias="datasetItemId")
24    observation_id: typing.Optional[str] = pydantic_v1.Field(alias="observationId", default=None)
25    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
26    """
27    traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
28    """
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        return super().json(**kwargs_with_defaults)
33
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
36        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
37
38        return deep_union_pydantic_dicts(
39            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
40        )
41
42    class Config:
43        frozen = True
44        smart_union = True
45        allow_population_by_field_name = True
46        populate_by_name = True
47        extra = pydantic_v1.Extra.allow
48        json_encoders = {dt.datetime: serialize_datetime}
run_name: str
run_description: Optional[str]

Description of the run. If run exists, description will be updated.

metadata: Optional[Any]

Metadata of the dataset run, updates run if run already exists

dataset_item_id: str
observation_id: Optional[str]
trace_id: Optional[str]

traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.

def json(self, **kwargs: Any) -> str:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
36        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
37
38        return deep_union_pydantic_dicts(
39            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
40        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateDatasetRunItemRequest.Config:
42    class Config:
43        frozen = True
44        smart_union = True
45        allow_population_by_field_name = True
46        populate_by_name = True
47        extra = pydantic_v1.Extra.allow
48        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateEventBody(langfuse.api.OptionalObservationBody):
12class CreateEventBody(OptionalObservationBody):
13    id: typing.Optional[str] = None
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
id: Optional[str]
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class CreateEventBody.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateEventEvent(langfuse.api.BaseEvent):
13class CreateEventEvent(BaseEvent):
14    body: CreateEventBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class CreateEventEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateGenerationBody(langfuse.api.CreateSpanBody):
14class CreateGenerationBody(CreateSpanBody):
15    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="completionStartTime", default=None)
16    model: typing.Optional[str] = None
17    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
18        alias="modelParameters", default=None
19    )
20    usage: typing.Optional[IngestionUsage] = None
21    prompt_name: typing.Optional[str] = pydantic_v1.Field(alias="promptName", default=None)
22    prompt_version: typing.Optional[int] = pydantic_v1.Field(alias="promptVersion", default=None)
23
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)
27
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )
35
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
completion_start_time: Optional[datetime.datetime]
model: Optional[str]
model_parameters: Optional[Dict[str, Union[str, NoneType, int, bool, List[str]]]]
usage: Union[Usage, OpenAiUsage, NoneType]
prompt_name: Optional[str]
prompt_version: Optional[int]
def json(self, **kwargs: Any) -> str:
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateSpanBody
end_time
CreateEventBody
id
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class CreateGenerationBody.Config:
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateGenerationEvent(langfuse.api.BaseEvent):
13class CreateGenerationEvent(BaseEvent):
14    body: CreateGenerationBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class CreateGenerationEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateModelRequest(pydantic.v1.main.BaseModel):
 12class CreateModelRequest(pydantic_v1.BaseModel):
 13    model_name: str = pydantic_v1.Field(alias="modelName")
 14    """
 15    Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
 16    """
 17
 18    match_pattern: str = pydantic_v1.Field(alias="matchPattern")
 19    """
 20    Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$`
 21    """
 22
 23    start_date: typing.Optional[dt.datetime] = pydantic_v1.Field(
 24        alias="startDate", default=None
 25    )
 26    """
 27    Apply only to generations which are newer than this ISO date.
 28    """
 29
 30    unit: ModelUsageUnit = pydantic_v1.Field()
 31    """
 32    Unit used by this model.
 33    """
 34
 35    input_price: typing.Optional[float] = pydantic_v1.Field(
 36        alias="inputPrice", default=None
 37    )
 38    """
 39    Price (USD) per input unit
 40    """
 41
 42    output_price: typing.Optional[float] = pydantic_v1.Field(
 43        alias="outputPrice", default=None
 44    )
 45    """
 46    Price (USD) per output unit
 47    """
 48
 49    total_price: typing.Optional[float] = pydantic_v1.Field(
 50        alias="totalPrice", default=None
 51    )
 52    """
 53    Price (USD) per total units. Cannot be set if input or output price is set.
 54    """
 55
 56    tokenizer_id: typing.Optional[str] = pydantic_v1.Field(
 57        alias="tokenizerId", default=None
 58    )
 59    """
 60    Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
 61    """
 62
 63    tokenizer_config: typing.Optional[typing.Any] = pydantic_v1.Field(
 64        alias="tokenizerConfig", default=None
 65    )
 66    """
 67    Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
 68    """
 69
 70    def json(self, **kwargs: typing.Any) -> str:
 71        kwargs_with_defaults: typing.Any = {
 72            "by_alias": True,
 73            "exclude_unset": True,
 74            **kwargs,
 75        }
 76        return super().json(**kwargs_with_defaults)
 77
 78    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
 79        kwargs_with_defaults_exclude_unset: typing.Any = {
 80            "by_alias": True,
 81            "exclude_unset": True,
 82            **kwargs,
 83        }
 84        kwargs_with_defaults_exclude_none: typing.Any = {
 85            "by_alias": True,
 86            "exclude_none": True,
 87            **kwargs,
 88        }
 89
 90        return deep_union_pydantic_dicts(
 91            super().dict(**kwargs_with_defaults_exclude_unset),
 92            super().dict(**kwargs_with_defaults_exclude_none),
 93        )
 94
 95    class Config:
 96        frozen = True
 97        smart_union = True
 98        allow_population_by_field_name = True
 99        populate_by_name = True
100        extra = pydantic_v1.Extra.allow
101        json_encoders = {dt.datetime: serialize_datetime}
model_name: str

Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime

match_pattern: str

Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use (?i)^modelname$

start_date: Optional[datetime.datetime]

Apply only to generations which are newer than this ISO date.

Unit used by this model.

input_price: Optional[float]

Price (USD) per input unit

output_price: Optional[float]

Price (USD) per output unit

total_price: Optional[float]

Price (USD) per total units. Cannot be set if input or output price is set.

tokenizer_id: Optional[str]

Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.

tokenizer_config: Optional[Any]

Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.

def json(self, **kwargs: Any) -> str:
70    def json(self, **kwargs: typing.Any) -> str:
71        kwargs_with_defaults: typing.Any = {
72            "by_alias": True,
73            "exclude_unset": True,
74            **kwargs,
75        }
76        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
78    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
79        kwargs_with_defaults_exclude_unset: typing.Any = {
80            "by_alias": True,
81            "exclude_unset": True,
82            **kwargs,
83        }
84        kwargs_with_defaults_exclude_none: typing.Any = {
85            "by_alias": True,
86            "exclude_none": True,
87            **kwargs,
88        }
89
90        return deep_union_pydantic_dicts(
91            super().dict(**kwargs_with_defaults_exclude_unset),
92            super().dict(**kwargs_with_defaults_exclude_none),
93        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateModelRequest.Config:
 95    class Config:
 96        frozen = True
 97        smart_union = True
 98        allow_population_by_field_name = True
 99        populate_by_name = True
100        extra = pydantic_v1.Extra.allow
101        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateObservationEvent(langfuse.api.BaseEvent):
13class CreateObservationEvent(BaseEvent):
14    body: ObservationBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class CreateObservationEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
CreatePromptRequest = typing.Union[CreatePromptRequest_Chat, CreatePromptRequest_Text]
class CreatePromptRequest_Chat(pydantic.v1.main.BaseModel):
14class CreatePromptRequest_Chat(pydantic_v1.BaseModel):
15    name: str
16    prompt: typing.List[ChatMessage]
17    config: typing.Optional[typing.Any] = None
18    labels: typing.Optional[typing.List[str]] = None
19    tags: typing.Optional[typing.List[str]] = None
20    type: typing.Literal["chat"] = "chat"
21
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        return super().json(**kwargs_with_defaults)
25
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
29
30        return deep_union_pydantic_dicts(
31            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
32        )
33
34    class Config:
35        frozen = True
36        smart_union = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}
name: str
prompt: List[ChatMessage]
config: Optional[Any]
labels: Optional[List[str]]
tags: Optional[List[str]]
type: Literal['chat']
def json(self, **kwargs: Any) -> str:
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
29
30        return deep_union_pydantic_dicts(
31            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
32        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreatePromptRequest_Chat.Config:
34    class Config:
35        frozen = True
36        smart_union = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreatePromptRequest_Text(pydantic.v1.main.BaseModel):
41class CreatePromptRequest_Text(pydantic_v1.BaseModel):
42    name: str
43    prompt: str
44    config: typing.Optional[typing.Any] = None
45    labels: typing.Optional[typing.List[str]] = None
46    tags: typing.Optional[typing.List[str]] = None
47    type: typing.Literal["text"] = "text"
48
49    def json(self, **kwargs: typing.Any) -> str:
50        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
51        return super().json(**kwargs_with_defaults)
52
53    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
54        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
55        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
56
57        return deep_union_pydantic_dicts(
58            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
59        )
60
61    class Config:
62        frozen = True
63        smart_union = True
64        extra = pydantic_v1.Extra.allow
65        json_encoders = {dt.datetime: serialize_datetime}
name: str
prompt: str
config: Optional[Any]
labels: Optional[List[str]]
tags: Optional[List[str]]
type: Literal['text']
def json(self, **kwargs: Any) -> str:
49    def json(self, **kwargs: typing.Any) -> str:
50        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
51        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
53    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
54        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
55        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
56
57        return deep_union_pydantic_dicts(
58            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
59        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreatePromptRequest_Text.Config:
61    class Config:
62        frozen = True
63        smart_union = True
64        extra = pydantic_v1.Extra.allow
65        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateScoreConfigRequest(pydantic.v1.main.BaseModel):
13class CreateScoreConfigRequest(pydantic_v1.BaseModel):
14    name: str
15    data_type: ScoreDataType = pydantic_v1.Field(alias="dataType")
16    categories: typing.Optional[typing.List[ConfigCategory]] = pydantic_v1.Field(default=None)
17    """
18    Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed
19    """
20
21    min_value: typing.Optional[float] = pydantic_v1.Field(alias="minValue", default=None)
22    """
23    Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
24    """
25
26    max_value: typing.Optional[float] = pydantic_v1.Field(alias="maxValue", default=None)
27    """
28    Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
29    """
30
31    description: typing.Optional[str] = pydantic_v1.Field(default=None)
32    """
33    Description is shown across the Langfuse UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage
34    """
35
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
38        return super().json(**kwargs_with_defaults)
39
40    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
41        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
46        )
47
48    class Config:
49        frozen = True
50        smart_union = True
51        allow_population_by_field_name = True
52        populate_by_name = True
53        extra = pydantic_v1.Extra.allow
54        json_encoders = {dt.datetime: serialize_datetime}
name: str
data_type: ScoreDataType
categories: Optional[List[ConfigCategory]]

Configure custom categories for categorical scores. Pass a list of objects with label and value properties. Categories are autogenerated for boolean configs and cannot be passed

min_value: Optional[float]

Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞

max_value: Optional[float]

Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞

description: Optional[str]

Description is shown across the Langfuse UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage

def json(self, **kwargs: Any) -> str:
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
38        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
40    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
41        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
46        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateScoreConfigRequest.Config:
48    class Config:
49        frozen = True
50        smart_union = True
51        allow_population_by_field_name = True
52        populate_by_name = True
53        extra = pydantic_v1.Extra.allow
54        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateScoreRequest(pydantic.v1.main.BaseModel):
13class CreateScoreRequest(pydantic_v1.BaseModel):
14    """
15    Examples
16    --------
17    from finto import CreateScoreRequest
18
19    CreateScoreRequest(
20        name="novelty",
21        value=0.9,
22        trace_id="cdef-1234-5678-90ab",
23    )
24    """
25
26    id: typing.Optional[str] = None
27    trace_id: str = pydantic_v1.Field(alias="traceId")
28    name: str
29    value: CreateScoreValue = pydantic_v1.Field()
30    """
31    The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)
32    """
33
34    observation_id: typing.Optional[str] = pydantic_v1.Field(alias="observationId", default=None)
35    comment: typing.Optional[str] = None
36    data_type: typing.Optional[ScoreDataType] = pydantic_v1.Field(alias="dataType", default=None)
37    """
38    The data type of the score. When passing a configId this field is inferred. Otherwise, this field must be passed or will default to numeric.
39    """
40
41    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
42    """
43    Reference a score config on a score. The unique langfuse identifier of a score config. When passing this field, the dataType and stringValue fields are automatically populated.
44    """
45
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)
49
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )
57
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}

Examples

from finto import CreateScoreRequest

CreateScoreRequest( name="novelty", value=0.9, trace_id="cdef-1234-5678-90ab", )

id: Optional[str]
trace_id: str
name: str
value: Union[float, str]

The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)

observation_id: Optional[str]
comment: Optional[str]
data_type: Optional[ScoreDataType]

The data type of the score. When passing a configId this field is inferred. Otherwise, this field must be passed or will default to numeric.

config_id: Optional[str]

Reference a score config on a score. The unique langfuse identifier of a score config. When passing this field, the dataType and stringValue fields are automatically populated.

def json(self, **kwargs: Any) -> str:
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateScoreRequest.Config:
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateScoreResponse(pydantic.v1.main.BaseModel):
11class CreateScoreResponse(pydantic_v1.BaseModel):
12    id: str = pydantic_v1.Field()
13    """
14    The id of the created object in Langfuse
15    """
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
id: str

The id of the created object in Langfuse

def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateScoreResponse.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
CreateScoreValue = typing.Union[float, str]
class CreateSpanBody(langfuse.api.CreateEventBody):
12class CreateSpanBody(CreateEventBody):
13    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="endTime", default=None)
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
end_time: Optional[datetime.datetime]
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateEventBody
id
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class CreateSpanBody.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateSpanEvent(langfuse.api.BaseEvent):
13class CreateSpanEvent(BaseEvent):
14    body: CreateSpanBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class CreateSpanEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class CreateTextPromptRequest(pydantic.v1.main.BaseModel):
11class CreateTextPromptRequest(pydantic_v1.BaseModel):
12    name: str
13    prompt: str
14    config: typing.Optional[typing.Any] = None
15    labels: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
16    """
17    List of deployment labels of this prompt version.
18    """
19
20    tags: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
21    """
22    List of tags to apply to all versions of this prompt.
23    """
24
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)
28
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )
36
37    class Config:
38        frozen = True
39        smart_union = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
name: str
prompt: str
config: Optional[Any]
labels: Optional[List[str]]

List of deployment labels of this prompt version.

tags: Optional[List[str]]

List of tags to apply to all versions of this prompt.

def json(self, **kwargs: Any) -> str:
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class CreateTextPromptRequest.Config:
37    class Config:
38        frozen = True
39        smart_union = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DailyMetrics(pydantic.v1.main.BaseModel):
13class DailyMetrics(pydantic_v1.BaseModel):
14    data: typing.List[DailyMetricsDetails] = pydantic_v1.Field()
15    """
16    A list of daily metrics, only days with ingested data are included.
17    """
18
19    meta: MetaResponse
20
21    def json(self, **kwargs: typing.Any) -> str:
22        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        return super().json(**kwargs_with_defaults)
24
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
29        return deep_union_pydantic_dicts(
30            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31        )
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        json_encoders = {dt.datetime: serialize_datetime}
data: List[DailyMetricsDetails]

A list of daily metrics, only days with ingested data are included.

meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
21    def json(self, **kwargs: typing.Any) -> str:
22        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
29        return deep_union_pydantic_dicts(
30            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class DailyMetrics.Config:
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DailyMetricsDetails(pydantic.v1.main.BaseModel):
12class DailyMetricsDetails(pydantic_v1.BaseModel):
13    date: dt.date
14    count_traces: int = pydantic_v1.Field(alias="countTraces")
15    count_observations: int = pydantic_v1.Field(alias="countObservations")
16    total_cost: float = pydantic_v1.Field(alias="totalCost")
17    """
18    Total model cost in USD
19    """
20
21    usage: typing.List[UsageByModel]
22
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)
26
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )
34
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
date: datetime.date
count_traces: int
count_observations: int
total_cost: float

Total model cost in USD

usage: List[UsageByModel]
def json(self, **kwargs: Any) -> str:
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class DailyMetricsDetails.Config:
35    class Config:
36        frozen = True
37        smart_union = True
38        allow_population_by_field_name = True
39        populate_by_name = True
40        extra = pydantic_v1.Extra.allow
41        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Dataset(pydantic.v1.main.BaseModel):
11class Dataset(pydantic_v1.BaseModel):
12    id: str
13    name: str
14    description: typing.Optional[str] = None
15    metadata: typing.Optional[typing.Any] = None
16    project_id: str = pydantic_v1.Field(alias="projectId")
17    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
18    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
19
20    def json(self, **kwargs: typing.Any) -> str:
21        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        return super().json(**kwargs_with_defaults)
23
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
27
28        return deep_union_pydantic_dicts(
29            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
30        )
31
32    class Config:
33        frozen = True
34        smart_union = True
35        allow_population_by_field_name = True
36        populate_by_name = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}
id: str
name: str
description: Optional[str]
metadata: Optional[Any]
project_id: str
created_at: datetime.datetime
updated_at: datetime.datetime
def json(self, **kwargs: Any) -> str:
20    def json(self, **kwargs: typing.Any) -> str:
21        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
27
28        return deep_union_pydantic_dicts(
29            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
30        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Dataset.Config:
32    class Config:
33        frozen = True
34        smart_union = True
35        allow_population_by_field_name = True
36        populate_by_name = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DatasetItem(pydantic.v1.main.BaseModel):
12class DatasetItem(pydantic_v1.BaseModel):
13    id: str
14    status: DatasetStatus
15    input: typing.Optional[typing.Any] = None
16    expected_output: typing.Optional[typing.Any] = pydantic_v1.Field(alias="expectedOutput", default=None)
17    metadata: typing.Optional[typing.Any] = None
18    source_trace_id: typing.Optional[str] = pydantic_v1.Field(alias="sourceTraceId", default=None)
19    source_observation_id: typing.Optional[str] = pydantic_v1.Field(alias="sourceObservationId", default=None)
20    dataset_id: str = pydantic_v1.Field(alias="datasetId")
21    dataset_name: str = pydantic_v1.Field(alias="datasetName")
22    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
23    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
24
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)
28
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )
36
37    class Config:
38        frozen = True
39        smart_union = True
40        allow_population_by_field_name = True
41        populate_by_name = True
42        extra = pydantic_v1.Extra.allow
43        json_encoders = {dt.datetime: serialize_datetime}
id: str
status: DatasetStatus
input: Optional[Any]
expected_output: Optional[Any]
metadata: Optional[Any]
source_trace_id: Optional[str]
source_observation_id: Optional[str]
dataset_id: str
dataset_name: str
created_at: datetime.datetime
updated_at: datetime.datetime
def json(self, **kwargs: Any) -> str:
25    def json(self, **kwargs: typing.Any) -> str:
26        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
32
33        return deep_union_pydantic_dicts(
34            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
35        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class DatasetItem.Config:
37    class Config:
38        frozen = True
39        smart_union = True
40        allow_population_by_field_name = True
41        populate_by_name = True
42        extra = pydantic_v1.Extra.allow
43        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DatasetRun(pydantic.v1.main.BaseModel):
11class DatasetRun(pydantic_v1.BaseModel):
12    id: str = pydantic_v1.Field()
13    """
14    Unique identifier of the dataset run
15    """
16
17    name: str = pydantic_v1.Field()
18    """
19    Name of the dataset run
20    """
21
22    description: typing.Optional[str] = pydantic_v1.Field(default=None)
23    """
24    Description of the run
25    """
26
27    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
28    """
29    Metadata of the dataset run
30    """
31
32    dataset_id: str = pydantic_v1.Field(alias="datasetId")
33    """
34    Id of the associated dataset
35    """
36
37    dataset_name: str = pydantic_v1.Field(alias="datasetName")
38    """
39    Name of the associated dataset
40    """
41
42    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
43    """
44    The date and time when the dataset run was created
45    """
46
47    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
48    """
49    The date and time when the dataset run was last updated
50    """
51
52    def json(self, **kwargs: typing.Any) -> str:
53        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
54        return super().json(**kwargs_with_defaults)
55
56    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
57        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
58        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
59
60        return deep_union_pydantic_dicts(
61            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
62        )
63
64    class Config:
65        frozen = True
66        smart_union = True
67        allow_population_by_field_name = True
68        populate_by_name = True
69        extra = pydantic_v1.Extra.allow
70        json_encoders = {dt.datetime: serialize_datetime}
id: str

Unique identifier of the dataset run

name: str

Name of the dataset run

description: Optional[str]

Description of the run

metadata: Optional[Any]

Metadata of the dataset run

dataset_id: str

Id of the associated dataset

dataset_name: str

Name of the associated dataset

created_at: datetime.datetime

The date and time when the dataset run was created

updated_at: datetime.datetime

The date and time when the dataset run was last updated

def json(self, **kwargs: Any) -> str:
52    def json(self, **kwargs: typing.Any) -> str:
53        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
54        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
56    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
57        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
58        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
59
60        return deep_union_pydantic_dicts(
61            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
62        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class DatasetRun.Config:
64    class Config:
65        frozen = True
66        smart_union = True
67        allow_population_by_field_name = True
68        populate_by_name = True
69        extra = pydantic_v1.Extra.allow
70        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DatasetRunItem(pydantic.v1.main.BaseModel):
11class DatasetRunItem(pydantic_v1.BaseModel):
12    id: str
13    dataset_run_id: str = pydantic_v1.Field(alias="datasetRunId")
14    dataset_run_name: str = pydantic_v1.Field(alias="datasetRunName")
15    dataset_item_id: str = pydantic_v1.Field(alias="datasetItemId")
16    trace_id: str = pydantic_v1.Field(alias="traceId")
17    observation_id: typing.Optional[str] = pydantic_v1.Field(alias="observationId", default=None)
18    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
19    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
20
21    def json(self, **kwargs: typing.Any) -> str:
22        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        return super().json(**kwargs_with_defaults)
24
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
29        return deep_union_pydantic_dicts(
30            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31        )
32
33    class Config:
34        frozen = True
35        smart_union = True
36        allow_population_by_field_name = True
37        populate_by_name = True
38        extra = pydantic_v1.Extra.allow
39        json_encoders = {dt.datetime: serialize_datetime}
id: str
dataset_run_id: str
dataset_run_name: str
dataset_item_id: str
trace_id: str
observation_id: Optional[str]
created_at: datetime.datetime
updated_at: datetime.datetime
def json(self, **kwargs: Any) -> str:
21    def json(self, **kwargs: typing.Any) -> str:
22        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
29        return deep_union_pydantic_dicts(
30            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class DatasetRunItem.Config:
33    class Config:
34        frozen = True
35        smart_union = True
36        allow_population_by_field_name = True
37        populate_by_name = True
38        extra = pydantic_v1.Extra.allow
39        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DatasetRunWithItems(langfuse.api.DatasetRun):
13class DatasetRunWithItems(DatasetRun):
14    dataset_run_items: typing.List[DatasetRunItem] = pydantic_v1.Field(alias="datasetRunItems")
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
dataset_run_items: List[DatasetRunItem]
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
DatasetRun
id
name
description
metadata
dataset_id
dataset_name
created_at
updated_at
class DatasetRunWithItems.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class DatasetStatus(builtins.str, enum.Enum):
10class DatasetStatus(str, enum.Enum):
11    ACTIVE = "ACTIVE"
12    ARCHIVED = "ARCHIVED"
13
14    def visit(self, active: typing.Callable[[], T_Result], archived: typing.Callable[[], T_Result]) -> T_Result:
15        if self is DatasetStatus.ACTIVE:
16            return active()
17        if self is DatasetStatus.ARCHIVED:
18            return archived()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

ACTIVE = <DatasetStatus.ACTIVE: 'ACTIVE'>
ARCHIVED = <DatasetStatus.ARCHIVED: 'ARCHIVED'>
def visit( self, active: Callable[[], ~T_Result], archived: Callable[[], ~T_Result]) -> ~T_Result:
14    def visit(self, active: typing.Callable[[], T_Result], archived: typing.Callable[[], T_Result]) -> T_Result:
15        if self is DatasetStatus.ACTIVE:
16            return active()
17        if self is DatasetStatus.ARCHIVED:
18            return archived()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class Error(langfuse.api.core.api_error.ApiError):
 9class Error(ApiError):
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=400, body=body)

Common base class for all non-exit exceptions.

Error(body: Any)
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=400, body=body)
Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class GetCommentsResponse(pydantic.v1.main.BaseModel):
13class GetCommentsResponse(pydantic_v1.BaseModel):
14    data: typing.List[Comment]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)
24
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )
41
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
data: List[Comment]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetCommentsResponse.Config:
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetMediaResponse(pydantic.v1.main.BaseModel):
11class GetMediaResponse(pydantic_v1.BaseModel):
12    media_id: str = pydantic_v1.Field(alias="mediaId")
13    """
14    The unique langfuse identifier of a media record
15    """
16
17    content_type: str = pydantic_v1.Field(alias="contentType")
18    """
19    The MIME type of the media record
20    """
21
22    content_length: int = pydantic_v1.Field(alias="contentLength")
23    """
24    The size of the media record in bytes
25    """
26
27    uploaded_at: dt.datetime = pydantic_v1.Field(alias="uploadedAt")
28    """
29    The date and time when the media record was uploaded
30    """
31
32    url: str = pydantic_v1.Field()
33    """
34    The download URL of the media record
35    """
36
37    url_expiry: str = pydantic_v1.Field(alias="urlExpiry")
38    """
39    The expiry date and time of the media record download URL
40    """
41
42    def json(self, **kwargs: typing.Any) -> str:
43        kwargs_with_defaults: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().json(**kwargs_with_defaults)
49
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {
52            "by_alias": True,
53            "exclude_unset": True,
54            **kwargs,
55        }
56        kwargs_with_defaults_exclude_none: typing.Any = {
57            "by_alias": True,
58            "exclude_none": True,
59            **kwargs,
60        }
61
62        return deep_union_pydantic_dicts(
63            super().dict(**kwargs_with_defaults_exclude_unset),
64            super().dict(**kwargs_with_defaults_exclude_none),
65        )
66
67    class Config:
68        frozen = True
69        smart_union = True
70        allow_population_by_field_name = True
71        populate_by_name = True
72        extra = pydantic_v1.Extra.allow
73        json_encoders = {dt.datetime: serialize_datetime}
media_id: str

The unique langfuse identifier of a media record

content_type: str

The MIME type of the media record

content_length: int

The size of the media record in bytes

uploaded_at: datetime.datetime

The date and time when the media record was uploaded

url: str

The download URL of the media record

url_expiry: str

The expiry date and time of the media record download URL

def json(self, **kwargs: Any) -> str:
42    def json(self, **kwargs: typing.Any) -> str:
43        kwargs_with_defaults: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {
52            "by_alias": True,
53            "exclude_unset": True,
54            **kwargs,
55        }
56        kwargs_with_defaults_exclude_none: typing.Any = {
57            "by_alias": True,
58            "exclude_none": True,
59            **kwargs,
60        }
61
62        return deep_union_pydantic_dicts(
63            super().dict(**kwargs_with_defaults_exclude_unset),
64            super().dict(**kwargs_with_defaults_exclude_none),
65        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetMediaResponse.Config:
67    class Config:
68        frozen = True
69        smart_union = True
70        allow_population_by_field_name = True
71        populate_by_name = True
72        extra = pydantic_v1.Extra.allow
73        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetMediaUploadUrlRequest(pydantic.v1.main.BaseModel):
12class GetMediaUploadUrlRequest(pydantic_v1.BaseModel):
13    trace_id: str = pydantic_v1.Field(alias="traceId")
14    """
15    The trace ID associated with the media record
16    """
17
18    observation_id: typing.Optional[str] = pydantic_v1.Field(
19        alias="observationId", default=None
20    )
21    """
22    The observation ID associated with the media record. If the media record is associated directly with a trace, this will be null.
23    """
24
25    content_type: MediaContentType = pydantic_v1.Field(alias="contentType")
26    content_length: int = pydantic_v1.Field(alias="contentLength")
27    """
28    The size of the media record in bytes
29    """
30
31    sha_256_hash: str = pydantic_v1.Field(alias="sha256Hash")
32    """
33    The SHA-256 hash of the media record
34    """
35
36    field: str = pydantic_v1.Field()
37    """
38    The trace / observation field the media record is associated with. This can be one of `input`, `output`, `metadata`
39    """
40
41    def json(self, **kwargs: typing.Any) -> str:
42        kwargs_with_defaults: typing.Any = {
43            "by_alias": True,
44            "exclude_unset": True,
45            **kwargs,
46        }
47        return super().json(**kwargs_with_defaults)
48
49    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
50        kwargs_with_defaults_exclude_unset: typing.Any = {
51            "by_alias": True,
52            "exclude_unset": True,
53            **kwargs,
54        }
55        kwargs_with_defaults_exclude_none: typing.Any = {
56            "by_alias": True,
57            "exclude_none": True,
58            **kwargs,
59        }
60
61        return deep_union_pydantic_dicts(
62            super().dict(**kwargs_with_defaults_exclude_unset),
63            super().dict(**kwargs_with_defaults_exclude_none),
64        )
65
66    class Config:
67        frozen = True
68        smart_union = True
69        allow_population_by_field_name = True
70        populate_by_name = True
71        extra = pydantic_v1.Extra.allow
72        json_encoders = {dt.datetime: serialize_datetime}
trace_id: str

The trace ID associated with the media record

observation_id: Optional[str]

The observation ID associated with the media record. If the media record is associated directly with a trace, this will be null.

content_type: Literal['image/png', 'image/jpeg', 'image/jpg', 'image/webp', 'audio/mpeg', 'audio/mp3', 'audio/wav', 'text/plain', 'application/pdf']
content_length: int

The size of the media record in bytes

sha_256_hash: str

The SHA-256 hash of the media record

field: str

The trace / observation field the media record is associated with. This can be one of input, output, metadata

def json(self, **kwargs: Any) -> str:
41    def json(self, **kwargs: typing.Any) -> str:
42        kwargs_with_defaults: typing.Any = {
43            "by_alias": True,
44            "exclude_unset": True,
45            **kwargs,
46        }
47        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
49    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
50        kwargs_with_defaults_exclude_unset: typing.Any = {
51            "by_alias": True,
52            "exclude_unset": True,
53            **kwargs,
54        }
55        kwargs_with_defaults_exclude_none: typing.Any = {
56            "by_alias": True,
57            "exclude_none": True,
58            **kwargs,
59        }
60
61        return deep_union_pydantic_dicts(
62            super().dict(**kwargs_with_defaults_exclude_unset),
63            super().dict(**kwargs_with_defaults_exclude_none),
64        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetMediaUploadUrlRequest.Config:
66    class Config:
67        frozen = True
68        smart_union = True
69        allow_population_by_field_name = True
70        populate_by_name = True
71        extra = pydantic_v1.Extra.allow
72        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetMediaUploadUrlResponse(pydantic.v1.main.BaseModel):
11class GetMediaUploadUrlResponse(pydantic_v1.BaseModel):
12    upload_url: typing.Optional[str] = pydantic_v1.Field(
13        alias="uploadUrl", default=None
14    )
15    """
16    The presigned upload URL. If the asset is already uploaded, this will be null
17    """
18
19    media_id: str = pydantic_v1.Field(alias="mediaId")
20    """
21    The unique langfuse identifier of a media record
22    """
23
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().json(**kwargs_with_defaults)
31
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
38        kwargs_with_defaults_exclude_none: typing.Any = {
39            "by_alias": True,
40            "exclude_none": True,
41            **kwargs,
42        }
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset),
46            super().dict(**kwargs_with_defaults_exclude_none),
47        )
48
49    class Config:
50        frozen = True
51        smart_union = True
52        allow_population_by_field_name = True
53        populate_by_name = True
54        extra = pydantic_v1.Extra.allow
55        json_encoders = {dt.datetime: serialize_datetime}
upload_url: Optional[str]

The presigned upload URL. If the asset is already uploaded, this will be null

media_id: str

The unique langfuse identifier of a media record

def json(self, **kwargs: Any) -> str:
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
38        kwargs_with_defaults_exclude_none: typing.Any = {
39            "by_alias": True,
40            "exclude_none": True,
41            **kwargs,
42        }
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset),
46            super().dict(**kwargs_with_defaults_exclude_none),
47        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetMediaUploadUrlResponse.Config:
49    class Config:
50        frozen = True
51        smart_union = True
52        allow_population_by_field_name = True
53        populate_by_name = True
54        extra = pydantic_v1.Extra.allow
55        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponse(pydantic.v1.main.BaseModel):
13class GetScoresResponse(pydantic_v1.BaseModel):
14    data: typing.List[GetScoresResponseData]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)
24
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )
41
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {
19            "by_alias": True,
20            "exclude_unset": True,
21            **kwargs,
22        }
23        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
25    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26        kwargs_with_defaults_exclude_unset: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        kwargs_with_defaults_exclude_none: typing.Any = {
32            "by_alias": True,
33            "exclude_none": True,
34            **kwargs,
35        }
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset),
39            super().dict(**kwargs_with_defaults_exclude_none),
40        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetScoresResponse.Config:
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseDataBoolean(langfuse.api.BooleanScore):
13class GetScoresResponseDataBoolean(BooleanScore):
14    trace: GetScoresResponseTraceData
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)
23
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )
40
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BooleanScore
value
string_value
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class GetScoresResponseDataBoolean.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseDataCategorical(langfuse.api.CategoricalScore):
13class GetScoresResponseDataCategorical(CategoricalScore):
14    trace: GetScoresResponseTraceData
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)
23
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )
40
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CategoricalScore
value
string_value
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class GetScoresResponseDataCategorical.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseDataNumeric(langfuse.api.NumericScore):
13class GetScoresResponseDataNumeric(NumericScore):
14    trace: GetScoresResponseTraceData
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)
23
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )
40
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {
18            "by_alias": True,
19            "exclude_unset": True,
20            **kwargs,
21        }
22        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        kwargs_with_defaults_exclude_none: typing.Any = {
31            "by_alias": True,
32            "exclude_none": True,
33            **kwargs,
34        }
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset),
38            super().dict(**kwargs_with_defaults_exclude_none),
39        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
NumericScore
value
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class GetScoresResponseDataNumeric.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseData_Boolean(pydantic.v1.main.BaseModel):
130class GetScoresResponseData_Boolean(pydantic_v1.BaseModel):
131    trace: GetScoresResponseTraceData
132    value: float
133    string_value: str = pydantic_v1.Field(alias="stringValue")
134    id: str
135    trace_id: str = pydantic_v1.Field(alias="traceId")
136    name: str
137    source: ScoreSource
138    observation_id: typing.Optional[str] = pydantic_v1.Field(
139        alias="observationId", default=None
140    )
141    timestamp: dt.datetime
142    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
143    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
144    author_user_id: typing.Optional[str] = pydantic_v1.Field(
145        alias="authorUserId", default=None
146    )
147    comment: typing.Optional[str] = None
148    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
149    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
150    data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field(
151        alias="dataType", default="BOOLEAN"
152    )
153
154    def json(self, **kwargs: typing.Any) -> str:
155        kwargs_with_defaults: typing.Any = {
156            "by_alias": True,
157            "exclude_unset": True,
158            **kwargs,
159        }
160        return super().json(**kwargs_with_defaults)
161
162    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
163        kwargs_with_defaults_exclude_unset: typing.Any = {
164            "by_alias": True,
165            "exclude_unset": True,
166            **kwargs,
167        }
168        kwargs_with_defaults_exclude_none: typing.Any = {
169            "by_alias": True,
170            "exclude_none": True,
171            **kwargs,
172        }
173
174        return deep_union_pydantic_dicts(
175            super().dict(**kwargs_with_defaults_exclude_unset),
176            super().dict(**kwargs_with_defaults_exclude_none),
177        )
178
179    class Config:
180        frozen = True
181        smart_union = True
182        allow_population_by_field_name = True
183        populate_by_name = True
184        extra = pydantic_v1.Extra.allow
185        json_encoders = {dt.datetime: serialize_datetime}
value: float
string_value: str
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['BOOLEAN']
def json(self, **kwargs: Any) -> str:
154    def json(self, **kwargs: typing.Any) -> str:
155        kwargs_with_defaults: typing.Any = {
156            "by_alias": True,
157            "exclude_unset": True,
158            **kwargs,
159        }
160        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
162    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
163        kwargs_with_defaults_exclude_unset: typing.Any = {
164            "by_alias": True,
165            "exclude_unset": True,
166            **kwargs,
167        }
168        kwargs_with_defaults_exclude_none: typing.Any = {
169            "by_alias": True,
170            "exclude_none": True,
171            **kwargs,
172        }
173
174        return deep_union_pydantic_dicts(
175            super().dict(**kwargs_with_defaults_exclude_unset),
176            super().dict(**kwargs_with_defaults_exclude_none),
177        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetScoresResponseData_Boolean.Config:
179    class Config:
180        frozen = True
181        smart_union = True
182        allow_population_by_field_name = True
183        populate_by_name = True
184        extra = pydantic_v1.Extra.allow
185        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseData_Categorical(pydantic.v1.main.BaseModel):
 72class GetScoresResponseData_Categorical(pydantic_v1.BaseModel):
 73    trace: GetScoresResponseTraceData
 74    value: typing.Optional[float] = None
 75    string_value: str = pydantic_v1.Field(alias="stringValue")
 76    id: str
 77    trace_id: str = pydantic_v1.Field(alias="traceId")
 78    name: str
 79    source: ScoreSource
 80    observation_id: typing.Optional[str] = pydantic_v1.Field(
 81        alias="observationId", default=None
 82    )
 83    timestamp: dt.datetime
 84    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
 85    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
 86    author_user_id: typing.Optional[str] = pydantic_v1.Field(
 87        alias="authorUserId", default=None
 88    )
 89    comment: typing.Optional[str] = None
 90    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
 91    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
 92    data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field(
 93        alias="dataType", default="CATEGORICAL"
 94    )
 95
 96    def json(self, **kwargs: typing.Any) -> str:
 97        kwargs_with_defaults: typing.Any = {
 98            "by_alias": True,
 99            "exclude_unset": True,
100            **kwargs,
101        }
102        return super().json(**kwargs_with_defaults)
103
104    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
105        kwargs_with_defaults_exclude_unset: typing.Any = {
106            "by_alias": True,
107            "exclude_unset": True,
108            **kwargs,
109        }
110        kwargs_with_defaults_exclude_none: typing.Any = {
111            "by_alias": True,
112            "exclude_none": True,
113            **kwargs,
114        }
115
116        return deep_union_pydantic_dicts(
117            super().dict(**kwargs_with_defaults_exclude_unset),
118            super().dict(**kwargs_with_defaults_exclude_none),
119        )
120
121    class Config:
122        frozen = True
123        smart_union = True
124        allow_population_by_field_name = True
125        populate_by_name = True
126        extra = pydantic_v1.Extra.allow
127        json_encoders = {dt.datetime: serialize_datetime}
value: Optional[float]
string_value: str
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['CATEGORICAL']
def json(self, **kwargs: Any) -> str:
 96    def json(self, **kwargs: typing.Any) -> str:
 97        kwargs_with_defaults: typing.Any = {
 98            "by_alias": True,
 99            "exclude_unset": True,
100            **kwargs,
101        }
102        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
104    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
105        kwargs_with_defaults_exclude_unset: typing.Any = {
106            "by_alias": True,
107            "exclude_unset": True,
108            **kwargs,
109        }
110        kwargs_with_defaults_exclude_none: typing.Any = {
111            "by_alias": True,
112            "exclude_none": True,
113            **kwargs,
114        }
115
116        return deep_union_pydantic_dicts(
117            super().dict(**kwargs_with_defaults_exclude_unset),
118            super().dict(**kwargs_with_defaults_exclude_none),
119        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetScoresResponseData_Categorical.Config:
121    class Config:
122        frozen = True
123        smart_union = True
124        allow_population_by_field_name = True
125        populate_by_name = True
126        extra = pydantic_v1.Extra.allow
127        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseData_Numeric(pydantic.v1.main.BaseModel):
15class GetScoresResponseData_Numeric(pydantic_v1.BaseModel):
16    trace: GetScoresResponseTraceData
17    value: float
18    id: str
19    trace_id: str = pydantic_v1.Field(alias="traceId")
20    name: str
21    source: ScoreSource
22    observation_id: typing.Optional[str] = pydantic_v1.Field(
23        alias="observationId", default=None
24    )
25    timestamp: dt.datetime
26    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
27    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
28    author_user_id: typing.Optional[str] = pydantic_v1.Field(
29        alias="authorUserId", default=None
30    )
31    comment: typing.Optional[str] = None
32    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
33    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
34    data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field(
35        alias="dataType", default="NUMERIC"
36    )
37
38    def json(self, **kwargs: typing.Any) -> str:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().json(**kwargs_with_defaults)
45
46    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
47        kwargs_with_defaults_exclude_unset: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        kwargs_with_defaults_exclude_none: typing.Any = {
53            "by_alias": True,
54            "exclude_none": True,
55            **kwargs,
56        }
57
58        return deep_union_pydantic_dicts(
59            super().dict(**kwargs_with_defaults_exclude_unset),
60            super().dict(**kwargs_with_defaults_exclude_none),
61        )
62
63    class Config:
64        frozen = True
65        smart_union = True
66        allow_population_by_field_name = True
67        populate_by_name = True
68        extra = pydantic_v1.Extra.allow
69        json_encoders = {dt.datetime: serialize_datetime}
value: float
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['NUMERIC']
def json(self, **kwargs: Any) -> str:
38    def json(self, **kwargs: typing.Any) -> str:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
46    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
47        kwargs_with_defaults_exclude_unset: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        kwargs_with_defaults_exclude_none: typing.Any = {
53            "by_alias": True,
54            "exclude_none": True,
55            **kwargs,
56        }
57
58        return deep_union_pydantic_dicts(
59            super().dict(**kwargs_with_defaults_exclude_unset),
60            super().dict(**kwargs_with_defaults_exclude_none),
61        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetScoresResponseData_Numeric.Config:
63    class Config:
64        frozen = True
65        smart_union = True
66        allow_population_by_field_name = True
67        populate_by_name = True
68        extra = pydantic_v1.Extra.allow
69        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class GetScoresResponseTraceData(pydantic.v1.main.BaseModel):
11class GetScoresResponseTraceData(pydantic_v1.BaseModel):
12    user_id: typing.Optional[str] = pydantic_v1.Field(alias="userId", default=None)
13    """
14    The user ID associated with the trace referenced by score
15    """
16
17    tags: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
18    """
19    A list of tags associated with the trace referenced by score
20    """
21
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().json(**kwargs_with_defaults)
29
30    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31        kwargs_with_defaults_exclude_unset: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        kwargs_with_defaults_exclude_none: typing.Any = {
37            "by_alias": True,
38            "exclude_none": True,
39            **kwargs,
40        }
41
42        return deep_union_pydantic_dicts(
43            super().dict(**kwargs_with_defaults_exclude_unset),
44            super().dict(**kwargs_with_defaults_exclude_none),
45        )
46
47    class Config:
48        frozen = True
49        smart_union = True
50        allow_population_by_field_name = True
51        populate_by_name = True
52        extra = pydantic_v1.Extra.allow
53        json_encoders = {dt.datetime: serialize_datetime}
user_id: Optional[str]

The user ID associated with the trace referenced by score

tags: Optional[List[str]]

A list of tags associated with the trace referenced by score

def json(self, **kwargs: Any) -> str:
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
30    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31        kwargs_with_defaults_exclude_unset: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        kwargs_with_defaults_exclude_none: typing.Any = {
37            "by_alias": True,
38            "exclude_none": True,
39            **kwargs,
40        }
41
42        return deep_union_pydantic_dicts(
43            super().dict(**kwargs_with_defaults_exclude_unset),
44            super().dict(**kwargs_with_defaults_exclude_none),
45        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class GetScoresResponseTraceData.Config:
47    class Config:
48        frozen = True
49        smart_union = True
50        allow_population_by_field_name = True
51        populate_by_name = True
52        extra = pydantic_v1.Extra.allow
53        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class HealthResponse(pydantic.v1.main.BaseModel):
11class HealthResponse(pydantic_v1.BaseModel):
12    """
13    Examples
14    --------
15    from finto import HealthResponse
16
17    HealthResponse(
18        version="1.25.0",
19        status="OK",
20    )
21    """
22
23    version: str = pydantic_v1.Field()
24    """
25    Langfuse server version
26    """
27
28    status: str
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        return super().json(**kwargs_with_defaults)
33
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
36        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
37
38        return deep_union_pydantic_dicts(
39            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
40        )
41
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}

Examples

from finto import HealthResponse

HealthResponse( version="1.25.0", status="OK", )

version: str

Langfuse server version

status: str
def json(self, **kwargs: Any) -> str:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
36        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
37
38        return deep_union_pydantic_dicts(
39            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
40        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class HealthResponse.Config:
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionError(pydantic.v1.main.BaseModel):
11class IngestionError(pydantic_v1.BaseModel):
12    id: str
13    status: int
14    message: typing.Optional[str] = None
15    error: typing.Optional[typing.Any] = None
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
id: str
status: int
message: Optional[str]
error: Optional[Any]
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionError.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_EventCreate(pydantic.v1.main.BaseModel):
178class IngestionEvent_EventCreate(pydantic_v1.BaseModel):
179    body: CreateEventBody
180    id: str
181    timestamp: str
182    metadata: typing.Optional[typing.Any] = None
183    type: typing.Literal["event-create"] = "event-create"
184
185    def json(self, **kwargs: typing.Any) -> str:
186        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
187        return super().json(**kwargs_with_defaults)
188
189    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
190        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
191        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
192
193        return deep_union_pydantic_dicts(
194            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
195        )
196
197    class Config:
198        frozen = True
199        smart_union = True
200        extra = pydantic_v1.Extra.allow
201        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['event-create']
def json(self, **kwargs: Any) -> str:
185    def json(self, **kwargs: typing.Any) -> str:
186        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
187        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
189    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
190        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
191        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
192
193        return deep_union_pydantic_dicts(
194            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
195        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_EventCreate.Config:
197    class Config:
198        frozen = True
199        smart_union = True
200        extra = pydantic_v1.Extra.allow
201        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_GenerationCreate(pydantic.v1.main.BaseModel):
126class IngestionEvent_GenerationCreate(pydantic_v1.BaseModel):
127    body: CreateGenerationBody
128    id: str
129    timestamp: str
130    metadata: typing.Optional[typing.Any] = None
131    type: typing.Literal["generation-create"] = "generation-create"
132
133    def json(self, **kwargs: typing.Any) -> str:
134        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
135        return super().json(**kwargs_with_defaults)
136
137    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
138        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
139        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
140
141        return deep_union_pydantic_dicts(
142            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
143        )
144
145    class Config:
146        frozen = True
147        smart_union = True
148        extra = pydantic_v1.Extra.allow
149        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['generation-create']
def json(self, **kwargs: Any) -> str:
133    def json(self, **kwargs: typing.Any) -> str:
134        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
135        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
137    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
138        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
139        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
140
141        return deep_union_pydantic_dicts(
142            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
143        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_GenerationCreate.Config:
145    class Config:
146        frozen = True
147        smart_union = True
148        extra = pydantic_v1.Extra.allow
149        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_GenerationUpdate(pydantic.v1.main.BaseModel):
152class IngestionEvent_GenerationUpdate(pydantic_v1.BaseModel):
153    body: UpdateGenerationBody
154    id: str
155    timestamp: str
156    metadata: typing.Optional[typing.Any] = None
157    type: typing.Literal["generation-update"] = "generation-update"
158
159    def json(self, **kwargs: typing.Any) -> str:
160        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
161        return super().json(**kwargs_with_defaults)
162
163    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
164        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
165        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
166
167        return deep_union_pydantic_dicts(
168            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
169        )
170
171    class Config:
172        frozen = True
173        smart_union = True
174        extra = pydantic_v1.Extra.allow
175        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['generation-update']
def json(self, **kwargs: Any) -> str:
159    def json(self, **kwargs: typing.Any) -> str:
160        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
161        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
163    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
164        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
165        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
166
167        return deep_union_pydantic_dicts(
168            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
169        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_GenerationUpdate.Config:
171    class Config:
172        frozen = True
173        smart_union = True
174        extra = pydantic_v1.Extra.allow
175        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_ObservationCreate(pydantic.v1.main.BaseModel):
230class IngestionEvent_ObservationCreate(pydantic_v1.BaseModel):
231    body: ObservationBody
232    id: str
233    timestamp: str
234    metadata: typing.Optional[typing.Any] = None
235    type: typing.Literal["observation-create"] = "observation-create"
236
237    def json(self, **kwargs: typing.Any) -> str:
238        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
239        return super().json(**kwargs_with_defaults)
240
241    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
242        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
243        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
244
245        return deep_union_pydantic_dicts(
246            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
247        )
248
249    class Config:
250        frozen = True
251        smart_union = True
252        extra = pydantic_v1.Extra.allow
253        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['observation-create']
def json(self, **kwargs: Any) -> str:
237    def json(self, **kwargs: typing.Any) -> str:
238        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
239        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
241    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
242        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
243        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
244
245        return deep_union_pydantic_dicts(
246            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
247        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_ObservationCreate.Config:
249    class Config:
250        frozen = True
251        smart_union = True
252        extra = pydantic_v1.Extra.allow
253        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_ObservationUpdate(pydantic.v1.main.BaseModel):
256class IngestionEvent_ObservationUpdate(pydantic_v1.BaseModel):
257    body: ObservationBody
258    id: str
259    timestamp: str
260    metadata: typing.Optional[typing.Any] = None
261    type: typing.Literal["observation-update"] = "observation-update"
262
263    def json(self, **kwargs: typing.Any) -> str:
264        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
265        return super().json(**kwargs_with_defaults)
266
267    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
268        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
269        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
270
271        return deep_union_pydantic_dicts(
272            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
273        )
274
275    class Config:
276        frozen = True
277        smart_union = True
278        extra = pydantic_v1.Extra.allow
279        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['observation-update']
def json(self, **kwargs: Any) -> str:
263    def json(self, **kwargs: typing.Any) -> str:
264        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
265        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
267    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
268        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
269        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
270
271        return deep_union_pydantic_dicts(
272            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
273        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_ObservationUpdate.Config:
275    class Config:
276        frozen = True
277        smart_union = True
278        extra = pydantic_v1.Extra.allow
279        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_ScoreCreate(pydantic.v1.main.BaseModel):
48class IngestionEvent_ScoreCreate(pydantic_v1.BaseModel):
49    body: ScoreBody
50    id: str
51    timestamp: str
52    metadata: typing.Optional[typing.Any] = None
53    type: typing.Literal["score-create"] = "score-create"
54
55    def json(self, **kwargs: typing.Any) -> str:
56        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
57        return super().json(**kwargs_with_defaults)
58
59    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
60        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
61        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
62
63        return deep_union_pydantic_dicts(
64            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
65        )
66
67    class Config:
68        frozen = True
69        smart_union = True
70        extra = pydantic_v1.Extra.allow
71        json_encoders = {dt.datetime: serialize_datetime}
body: ScoreBody
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['score-create']
def json(self, **kwargs: Any) -> str:
55    def json(self, **kwargs: typing.Any) -> str:
56        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
57        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
59    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
60        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
61        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
62
63        return deep_union_pydantic_dicts(
64            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
65        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_ScoreCreate.Config:
67    class Config:
68        frozen = True
69        smart_union = True
70        extra = pydantic_v1.Extra.allow
71        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_SdkLog(pydantic.v1.main.BaseModel):
204class IngestionEvent_SdkLog(pydantic_v1.BaseModel):
205    body: SdkLogBody
206    id: str
207    timestamp: str
208    metadata: typing.Optional[typing.Any] = None
209    type: typing.Literal["sdk-log"] = "sdk-log"
210
211    def json(self, **kwargs: typing.Any) -> str:
212        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
213        return super().json(**kwargs_with_defaults)
214
215    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
216        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
217        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
218
219        return deep_union_pydantic_dicts(
220            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
221        )
222
223    class Config:
224        frozen = True
225        smart_union = True
226        extra = pydantic_v1.Extra.allow
227        json_encoders = {dt.datetime: serialize_datetime}
body: SdkLogBody
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['sdk-log']
def json(self, **kwargs: Any) -> str:
211    def json(self, **kwargs: typing.Any) -> str:
212        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
213        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
215    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
216        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
217        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
218
219        return deep_union_pydantic_dicts(
220            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
221        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_SdkLog.Config:
223    class Config:
224        frozen = True
225        smart_union = True
226        extra = pydantic_v1.Extra.allow
227        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_SpanCreate(pydantic.v1.main.BaseModel):
74class IngestionEvent_SpanCreate(pydantic_v1.BaseModel):
75    body: CreateSpanBody
76    id: str
77    timestamp: str
78    metadata: typing.Optional[typing.Any] = None
79    type: typing.Literal["span-create"] = "span-create"
80
81    def json(self, **kwargs: typing.Any) -> str:
82        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
83        return super().json(**kwargs_with_defaults)
84
85    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
86        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
87        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
88
89        return deep_union_pydantic_dicts(
90            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
91        )
92
93    class Config:
94        frozen = True
95        smart_union = True
96        extra = pydantic_v1.Extra.allow
97        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['span-create']
def json(self, **kwargs: Any) -> str:
81    def json(self, **kwargs: typing.Any) -> str:
82        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
83        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
85    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
86        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
87        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
88
89        return deep_union_pydantic_dicts(
90            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
91        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_SpanCreate.Config:
93    class Config:
94        frozen = True
95        smart_union = True
96        extra = pydantic_v1.Extra.allow
97        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_SpanUpdate(pydantic.v1.main.BaseModel):
100class IngestionEvent_SpanUpdate(pydantic_v1.BaseModel):
101    body: UpdateSpanBody
102    id: str
103    timestamp: str
104    metadata: typing.Optional[typing.Any] = None
105    type: typing.Literal["span-update"] = "span-update"
106
107    def json(self, **kwargs: typing.Any) -> str:
108        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
109        return super().json(**kwargs_with_defaults)
110
111    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
112        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
113        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
114
115        return deep_union_pydantic_dicts(
116            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
117        )
118
119    class Config:
120        frozen = True
121        smart_union = True
122        extra = pydantic_v1.Extra.allow
123        json_encoders = {dt.datetime: serialize_datetime}
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['span-update']
def json(self, **kwargs: Any) -> str:
107    def json(self, **kwargs: typing.Any) -> str:
108        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
109        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
111    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
112        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
113        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
114
115        return deep_union_pydantic_dicts(
116            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
117        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_SpanUpdate.Config:
119    class Config:
120        frozen = True
121        smart_union = True
122        extra = pydantic_v1.Extra.allow
123        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionEvent_TraceCreate(pydantic.v1.main.BaseModel):
22class IngestionEvent_TraceCreate(pydantic_v1.BaseModel):
23    body: TraceBody
24    id: str
25    timestamp: str
26    metadata: typing.Optional[typing.Any] = None
27    type: typing.Literal["trace-create"] = "trace-create"
28
29    def json(self, **kwargs: typing.Any) -> str:
30        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        return super().json(**kwargs_with_defaults)
32
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
35        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
39        )
40
41    class Config:
42        frozen = True
43        smart_union = True
44        extra = pydantic_v1.Extra.allow
45        json_encoders = {dt.datetime: serialize_datetime}
body: TraceBody
id: str
timestamp: str
metadata: Optional[Any]
type: Literal['trace-create']
def json(self, **kwargs: Any) -> str:
29    def json(self, **kwargs: typing.Any) -> str:
30        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
31        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
35        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
36
37        return deep_union_pydantic_dicts(
38            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
39        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionEvent_TraceCreate.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        extra = pydantic_v1.Extra.allow
45        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionResponse(pydantic.v1.main.BaseModel):
13class IngestionResponse(pydantic_v1.BaseModel):
14    successes: typing.List[IngestionSuccess]
15    errors: typing.List[IngestionError]
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
successes: List[IngestionSuccess]
errors: List[IngestionError]
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionResponse.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class IngestionSuccess(pydantic.v1.main.BaseModel):
11class IngestionSuccess(pydantic_v1.BaseModel):
12    id: str
13    status: int
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
id: str
status: int
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class IngestionSuccess.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
IngestionUsage = typing.Union[Usage, OpenAiUsage]
MapValue = typing.Union[str, NoneType, int, bool, typing.List[str]]
MediaContentType = typing.Literal['image/png', 'image/jpeg', 'image/jpg', 'image/webp', 'audio/mpeg', 'audio/mp3', 'audio/wav', 'text/plain', 'application/pdf']
class MethodNotAllowedError(langfuse.api.core.api_error.ApiError):
 9class MethodNotAllowedError(ApiError):
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=405, body=body)

Common base class for all non-exit exceptions.

MethodNotAllowedError(body: Any)
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=405, body=body)
Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class Model(pydantic.v1.main.BaseModel):
 12class Model(pydantic_v1.BaseModel):
 13    """
 14    Model definition used for transforming usage into USD cost and/or tokenization.
 15    """
 16
 17    id: str
 18    model_name: str = pydantic_v1.Field(alias="modelName")
 19    """
 20    Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
 21    """
 22
 23    match_pattern: str = pydantic_v1.Field(alias="matchPattern")
 24    """
 25    Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$`
 26    """
 27
 28    start_date: typing.Optional[dt.date] = pydantic_v1.Field(
 29        alias="startDate", default=None
 30    )
 31    """
 32    Apply only to generations which are newer than this ISO date.
 33    """
 34
 35    unit: ModelUsageUnit = pydantic_v1.Field()
 36    """
 37    Unit used by this model.
 38    """
 39
 40    input_price: typing.Optional[float] = pydantic_v1.Field(
 41        alias="inputPrice", default=None
 42    )
 43    """
 44    Price (USD) per input unit
 45    """
 46
 47    output_price: typing.Optional[float] = pydantic_v1.Field(
 48        alias="outputPrice", default=None
 49    )
 50    """
 51    Price (USD) per output unit
 52    """
 53
 54    total_price: typing.Optional[float] = pydantic_v1.Field(
 55        alias="totalPrice", default=None
 56    )
 57    """
 58    Price (USD) per total unit. Cannot be set if input or output price is set.
 59    """
 60
 61    tokenizer_id: typing.Optional[str] = pydantic_v1.Field(
 62        alias="tokenizerId", default=None
 63    )
 64    """
 65    Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
 66    """
 67
 68    tokenizer_config: typing.Optional[typing.Any] = pydantic_v1.Field(
 69        alias="tokenizerConfig", default=None
 70    )
 71    """
 72    Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
 73    """
 74
 75    is_langfuse_managed: bool = pydantic_v1.Field(alias="isLangfuseManaged")
 76
 77    def json(self, **kwargs: typing.Any) -> str:
 78        kwargs_with_defaults: typing.Any = {
 79            "by_alias": True,
 80            "exclude_unset": True,
 81            **kwargs,
 82        }
 83        return super().json(**kwargs_with_defaults)
 84
 85    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
 86        kwargs_with_defaults_exclude_unset: typing.Any = {
 87            "by_alias": True,
 88            "exclude_unset": True,
 89            **kwargs,
 90        }
 91        kwargs_with_defaults_exclude_none: typing.Any = {
 92            "by_alias": True,
 93            "exclude_none": True,
 94            **kwargs,
 95        }
 96
 97        return deep_union_pydantic_dicts(
 98            super().dict(**kwargs_with_defaults_exclude_unset),
 99            super().dict(**kwargs_with_defaults_exclude_none),
100        )
101
102    class Config:
103        frozen = True
104        smart_union = True
105        allow_population_by_field_name = True
106        populate_by_name = True
107        extra = pydantic_v1.Extra.allow
108        json_encoders = {dt.datetime: serialize_datetime}

Model definition used for transforming usage into USD cost and/or tokenization.

id: str
model_name: str

Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime

match_pattern: str

Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use (?i)^modelname$

start_date: Optional[datetime.date]

Apply only to generations which are newer than this ISO date.

Unit used by this model.

input_price: Optional[float]

Price (USD) per input unit

output_price: Optional[float]

Price (USD) per output unit

total_price: Optional[float]

Price (USD) per total unit. Cannot be set if input or output price is set.

tokenizer_id: Optional[str]

Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.

tokenizer_config: Optional[Any]

Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.

is_langfuse_managed: bool
def json(self, **kwargs: Any) -> str:
77    def json(self, **kwargs: typing.Any) -> str:
78        kwargs_with_defaults: typing.Any = {
79            "by_alias": True,
80            "exclude_unset": True,
81            **kwargs,
82        }
83        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
 85    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
 86        kwargs_with_defaults_exclude_unset: typing.Any = {
 87            "by_alias": True,
 88            "exclude_unset": True,
 89            **kwargs,
 90        }
 91        kwargs_with_defaults_exclude_none: typing.Any = {
 92            "by_alias": True,
 93            "exclude_none": True,
 94            **kwargs,
 95        }
 96
 97        return deep_union_pydantic_dicts(
 98            super().dict(**kwargs_with_defaults_exclude_unset),
 99            super().dict(**kwargs_with_defaults_exclude_none),
100        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Model.Config:
102    class Config:
103        frozen = True
104        smart_union = True
105        allow_population_by_field_name = True
106        populate_by_name = True
107        extra = pydantic_v1.Extra.allow
108        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ModelUsageUnit(builtins.str, enum.Enum):
10class ModelUsageUnit(str, enum.Enum):
11    """
12    Unit of usage in Langfuse
13    """
14
15    CHARACTERS = "CHARACTERS"
16    TOKENS = "TOKENS"
17    MILLISECONDS = "MILLISECONDS"
18    SECONDS = "SECONDS"
19    IMAGES = "IMAGES"
20    REQUESTS = "REQUESTS"
21
22    def visit(
23        self,
24        characters: typing.Callable[[], T_Result],
25        tokens: typing.Callable[[], T_Result],
26        milliseconds: typing.Callable[[], T_Result],
27        seconds: typing.Callable[[], T_Result],
28        images: typing.Callable[[], T_Result],
29        requests: typing.Callable[[], T_Result],
30    ) -> T_Result:
31        if self is ModelUsageUnit.CHARACTERS:
32            return characters()
33        if self is ModelUsageUnit.TOKENS:
34            return tokens()
35        if self is ModelUsageUnit.MILLISECONDS:
36            return milliseconds()
37        if self is ModelUsageUnit.SECONDS:
38            return seconds()
39        if self is ModelUsageUnit.IMAGES:
40            return images()
41        if self is ModelUsageUnit.REQUESTS:
42            return requests()

Unit of usage in Langfuse

CHARACTERS = <ModelUsageUnit.CHARACTERS: 'CHARACTERS'>
TOKENS = <ModelUsageUnit.TOKENS: 'TOKENS'>
MILLISECONDS = <ModelUsageUnit.MILLISECONDS: 'MILLISECONDS'>
SECONDS = <ModelUsageUnit.SECONDS: 'SECONDS'>
IMAGES = <ModelUsageUnit.IMAGES: 'IMAGES'>
REQUESTS = <ModelUsageUnit.REQUESTS: 'REQUESTS'>
def visit( self, characters: Callable[[], ~T_Result], tokens: Callable[[], ~T_Result], milliseconds: Callable[[], ~T_Result], seconds: Callable[[], ~T_Result], images: Callable[[], ~T_Result], requests: Callable[[], ~T_Result]) -> ~T_Result:
22    def visit(
23        self,
24        characters: typing.Callable[[], T_Result],
25        tokens: typing.Callable[[], T_Result],
26        milliseconds: typing.Callable[[], T_Result],
27        seconds: typing.Callable[[], T_Result],
28        images: typing.Callable[[], T_Result],
29        requests: typing.Callable[[], T_Result],
30    ) -> T_Result:
31        if self is ModelUsageUnit.CHARACTERS:
32            return characters()
33        if self is ModelUsageUnit.TOKENS:
34            return tokens()
35        if self is ModelUsageUnit.MILLISECONDS:
36            return milliseconds()
37        if self is ModelUsageUnit.SECONDS:
38            return seconds()
39        if self is ModelUsageUnit.IMAGES:
40            return images()
41        if self is ModelUsageUnit.REQUESTS:
42            return requests()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class NotFoundError(langfuse.api.core.api_error.ApiError):
 9class NotFoundError(ApiError):
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=404, body=body)

Common base class for all non-exit exceptions.

NotFoundError(body: Any)
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=404, body=body)
Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class NumericScore(langfuse.api.BaseScore):
12class NumericScore(BaseScore):
13    value: float = pydantic_v1.Field()
14    """
15    The numeric value of the score
16    """
17
18    def json(self, **kwargs: typing.Any) -> str:
19        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        return super().json(**kwargs_with_defaults)
21
22    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
25
26        return deep_union_pydantic_dicts(
27            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
28        )
29
30    class Config:
31        frozen = True
32        smart_union = True
33        allow_population_by_field_name = True
34        populate_by_name = True
35        extra = pydantic_v1.Extra.allow
36        json_encoders = {dt.datetime: serialize_datetime}
value: float

The numeric value of the score

def json(self, **kwargs: Any) -> str:
18    def json(self, **kwargs: typing.Any) -> str:
19        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
22    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
25
26        return deep_union_pydantic_dicts(
27            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
28        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
queue_id
class NumericScore.Config:
30    class Config:
31        frozen = True
32        smart_union = True
33        allow_population_by_field_name = True
34        populate_by_name = True
35        extra = pydantic_v1.Extra.allow
36        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Observation(pydantic.v1.main.BaseModel):
 14class Observation(pydantic_v1.BaseModel):
 15    id: str = pydantic_v1.Field()
 16    """
 17    The unique identifier of the observation
 18    """
 19
 20    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
 21    """
 22    The trace ID associated with the observation
 23    """
 24
 25    type: str = pydantic_v1.Field()
 26    """
 27    The type of the observation
 28    """
 29
 30    name: typing.Optional[str] = pydantic_v1.Field(default=None)
 31    """
 32    The name of the observation
 33    """
 34
 35    start_time: dt.datetime = pydantic_v1.Field(alias="startTime")
 36    """
 37    The start time of the observation
 38    """
 39
 40    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="endTime", default=None)
 41    """
 42    The end time of the observation.
 43    """
 44
 45    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="completionStartTime", default=None)
 46    """
 47    The completion start time of the observation
 48    """
 49
 50    model: typing.Optional[str] = pydantic_v1.Field(default=None)
 51    """
 52    The model used for the observation
 53    """
 54
 55    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
 56        alias="modelParameters", default=None
 57    )
 58    """
 59    The parameters of the model used for the observation
 60    """
 61
 62    input: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
 63    """
 64    The input data of the observation
 65    """
 66
 67    version: typing.Optional[str] = pydantic_v1.Field(default=None)
 68    """
 69    The version of the observation
 70    """
 71
 72    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
 73    """
 74    Additional metadata of the observation
 75    """
 76
 77    output: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
 78    """
 79    The output data of the observation
 80    """
 81
 82    usage: typing.Optional[Usage] = pydantic_v1.Field(default=None)
 83    """
 84    The usage data of the observation
 85    """
 86
 87    level: ObservationLevel = pydantic_v1.Field()
 88    """
 89    The level of the observation
 90    """
 91
 92    status_message: typing.Optional[str] = pydantic_v1.Field(alias="statusMessage", default=None)
 93    """
 94    The status message of the observation
 95    """
 96
 97    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(alias="parentObservationId", default=None)
 98    """
 99    The parent observation ID
100    """
101
102    prompt_id: typing.Optional[str] = pydantic_v1.Field(alias="promptId", default=None)
103    """
104    The prompt ID associated with the observation
105    """
106
107    def json(self, **kwargs: typing.Any) -> str:
108        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
109        return super().json(**kwargs_with_defaults)
110
111    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
112        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
113        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
114
115        return deep_union_pydantic_dicts(
116            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
117        )
118
119    class Config:
120        frozen = True
121        smart_union = True
122        allow_population_by_field_name = True
123        populate_by_name = True
124        extra = pydantic_v1.Extra.allow
125        json_encoders = {dt.datetime: serialize_datetime}
id: str

The unique identifier of the observation

trace_id: Optional[str]

The trace ID associated with the observation

type: str

The type of the observation

name: Optional[str]

The name of the observation

start_time: datetime.datetime

The start time of the observation

end_time: Optional[datetime.datetime]

The end time of the observation.

completion_start_time: Optional[datetime.datetime]

The completion start time of the observation

model: Optional[str]

The model used for the observation

model_parameters: Optional[Dict[str, Union[str, NoneType, int, bool, List[str]]]]

The parameters of the model used for the observation

input: Optional[Any]

The input data of the observation

version: Optional[str]

The version of the observation

metadata: Optional[Any]

Additional metadata of the observation

output: Optional[Any]

The output data of the observation

usage: Optional[Usage]

The usage data of the observation

The level of the observation

status_message: Optional[str]

The status message of the observation

parent_observation_id: Optional[str]

The parent observation ID

prompt_id: Optional[str]

The prompt ID associated with the observation

def json(self, **kwargs: Any) -> str:
107    def json(self, **kwargs: typing.Any) -> str:
108        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
109        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
111    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
112        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
113        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
114
115        return deep_union_pydantic_dicts(
116            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
117        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Observation.Config:
119    class Config:
120        frozen = True
121        smart_union = True
122        allow_population_by_field_name = True
123        populate_by_name = True
124        extra = pydantic_v1.Extra.allow
125        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ObservationBody(pydantic.v1.main.BaseModel):
15class ObservationBody(pydantic_v1.BaseModel):
16    id: typing.Optional[str] = None
17    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
18    type: ObservationType
19    name: typing.Optional[str] = None
20    start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="startTime", default=None)
21    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="endTime", default=None)
22    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="completionStartTime", default=None)
23    model: typing.Optional[str] = None
24    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
25        alias="modelParameters", default=None
26    )
27    input: typing.Optional[typing.Any] = None
28    version: typing.Optional[str] = None
29    metadata: typing.Optional[typing.Any] = None
30    output: typing.Optional[typing.Any] = None
31    usage: typing.Optional[Usage] = None
32    level: typing.Optional[ObservationLevel] = None
33    status_message: typing.Optional[str] = pydantic_v1.Field(alias="statusMessage", default=None)
34    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(alias="parentObservationId", default=None)
35
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
38        return super().json(**kwargs_with_defaults)
39
40    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
41        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
46        )
47
48    class Config:
49        frozen = True
50        smart_union = True
51        allow_population_by_field_name = True
52        populate_by_name = True
53        extra = pydantic_v1.Extra.allow
54        json_encoders = {dt.datetime: serialize_datetime}
id: Optional[str]
trace_id: Optional[str]
name: Optional[str]
start_time: Optional[datetime.datetime]
end_time: Optional[datetime.datetime]
completion_start_time: Optional[datetime.datetime]
model: Optional[str]
model_parameters: Optional[Dict[str, Union[str, NoneType, int, bool, List[str]]]]
input: Optional[Any]
version: Optional[str]
metadata: Optional[Any]
output: Optional[Any]
usage: Optional[Usage]
level: Optional[ObservationLevel]
status_message: Optional[str]
parent_observation_id: Optional[str]
def json(self, **kwargs: Any) -> str:
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
38        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
40    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
41        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
43
44        return deep_union_pydantic_dicts(
45            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
46        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ObservationBody.Config:
48    class Config:
49        frozen = True
50        smart_union = True
51        allow_population_by_field_name = True
52        populate_by_name = True
53        extra = pydantic_v1.Extra.allow
54        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ObservationLevel(builtins.str, enum.Enum):
10class ObservationLevel(str, enum.Enum):
11    DEBUG = "DEBUG"
12    DEFAULT = "DEFAULT"
13    WARNING = "WARNING"
14    ERROR = "ERROR"
15
16    def visit(
17        self,
18        debug: typing.Callable[[], T_Result],
19        default: typing.Callable[[], T_Result],
20        warning: typing.Callable[[], T_Result],
21        error: typing.Callable[[], T_Result],
22    ) -> T_Result:
23        if self is ObservationLevel.DEBUG:
24            return debug()
25        if self is ObservationLevel.DEFAULT:
26            return default()
27        if self is ObservationLevel.WARNING:
28            return warning()
29        if self is ObservationLevel.ERROR:
30            return error()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

DEBUG = <ObservationLevel.DEBUG: 'DEBUG'>
DEFAULT = <ObservationLevel.DEFAULT: 'DEFAULT'>
WARNING = <ObservationLevel.WARNING: 'WARNING'>
ERROR = <ObservationLevel.ERROR: 'ERROR'>
def visit( self, debug: Callable[[], ~T_Result], default: Callable[[], ~T_Result], warning: Callable[[], ~T_Result], error: Callable[[], ~T_Result]) -> ~T_Result:
16    def visit(
17        self,
18        debug: typing.Callable[[], T_Result],
19        default: typing.Callable[[], T_Result],
20        warning: typing.Callable[[], T_Result],
21        error: typing.Callable[[], T_Result],
22    ) -> T_Result:
23        if self is ObservationLevel.DEBUG:
24            return debug()
25        if self is ObservationLevel.DEFAULT:
26            return default()
27        if self is ObservationLevel.WARNING:
28            return warning()
29        if self is ObservationLevel.ERROR:
30            return error()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class ObservationType(builtins.str, enum.Enum):
10class ObservationType(str, enum.Enum):
11    SPAN = "SPAN"
12    GENERATION = "GENERATION"
13    EVENT = "EVENT"
14
15    def visit(
16        self,
17        span: typing.Callable[[], T_Result],
18        generation: typing.Callable[[], T_Result],
19        event: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ObservationType.SPAN:
22            return span()
23        if self is ObservationType.GENERATION:
24            return generation()
25        if self is ObservationType.EVENT:
26            return event()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

SPAN = <ObservationType.SPAN: 'SPAN'>
GENERATION = <ObservationType.GENERATION: 'GENERATION'>
EVENT = <ObservationType.EVENT: 'EVENT'>
def visit( self, span: Callable[[], ~T_Result], generation: Callable[[], ~T_Result], event: Callable[[], ~T_Result]) -> ~T_Result:
15    def visit(
16        self,
17        span: typing.Callable[[], T_Result],
18        generation: typing.Callable[[], T_Result],
19        event: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ObservationType.SPAN:
22            return span()
23        if self is ObservationType.GENERATION:
24            return generation()
25        if self is ObservationType.EVENT:
26            return event()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class Observations(pydantic.v1.main.BaseModel):
13class Observations(pydantic_v1.BaseModel):
14    data: typing.List[Observation]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[Observation]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Observations.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ObservationsView(langfuse.api.Observation):
12class ObservationsView(Observation):
13    prompt_name: typing.Optional[str] = pydantic_v1.Field(alias="promptName", default=None)
14    """
15    The name of the prompt associated with the observation
16    """
17
18    prompt_version: typing.Optional[int] = pydantic_v1.Field(alias="promptVersion", default=None)
19    """
20    The version of the prompt associated with the observation
21    """
22
23    model_id: typing.Optional[str] = pydantic_v1.Field(alias="modelId", default=None)
24    """
25    The unique identifier of the model
26    """
27
28    input_price: typing.Optional[float] = pydantic_v1.Field(alias="inputPrice", default=None)
29    """
30    The price of the input in USD
31    """
32
33    output_price: typing.Optional[float] = pydantic_v1.Field(alias="outputPrice", default=None)
34    """
35    The price of the output in USD.
36    """
37
38    total_price: typing.Optional[float] = pydantic_v1.Field(alias="totalPrice", default=None)
39    """
40    The total price in USD.
41    """
42
43    calculated_input_cost: typing.Optional[float] = pydantic_v1.Field(alias="calculatedInputCost", default=None)
44    """
45    The calculated cost of the input in USD
46    """
47
48    calculated_output_cost: typing.Optional[float] = pydantic_v1.Field(alias="calculatedOutputCost", default=None)
49    """
50    The calculated cost of the output in USD
51    """
52
53    calculated_total_cost: typing.Optional[float] = pydantic_v1.Field(alias="calculatedTotalCost", default=None)
54    """
55    The calculated total cost in USD
56    """
57
58    latency: typing.Optional[float] = pydantic_v1.Field(default=None)
59    """
60    The latency in seconds.
61    """
62
63    time_to_first_token: typing.Optional[float] = pydantic_v1.Field(alias="timeToFirstToken", default=None)
64    """
65    The time to the first token in seconds
66    """
67
68    def json(self, **kwargs: typing.Any) -> str:
69        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
70        return super().json(**kwargs_with_defaults)
71
72    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
73        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
74        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
75
76        return deep_union_pydantic_dicts(
77            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
78        )
79
80    class Config:
81        frozen = True
82        smart_union = True
83        allow_population_by_field_name = True
84        populate_by_name = True
85        extra = pydantic_v1.Extra.allow
86        json_encoders = {dt.datetime: serialize_datetime}
prompt_name: Optional[str]

The name of the prompt associated with the observation

prompt_version: Optional[int]

The version of the prompt associated with the observation

model_id: Optional[str]

The unique identifier of the model

input_price: Optional[float]

The price of the input in USD

output_price: Optional[float]

The price of the output in USD.

total_price: Optional[float]

The total price in USD.

calculated_input_cost: Optional[float]

The calculated cost of the input in USD

calculated_output_cost: Optional[float]

The calculated cost of the output in USD

calculated_total_cost: Optional[float]

The calculated total cost in USD

latency: Optional[float]

The latency in seconds.

time_to_first_token: Optional[float]

The time to the first token in seconds

def json(self, **kwargs: Any) -> str:
68    def json(self, **kwargs: typing.Any) -> str:
69        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
70        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
72    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
73        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
74        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
75
76        return deep_union_pydantic_dicts(
77            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
78        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
Observation
id
trace_id
type
name
start_time
end_time
completion_start_time
model
model_parameters
input
version
metadata
output
usage
level
status_message
parent_observation_id
prompt_id
class ObservationsView.Config:
80    class Config:
81        frozen = True
82        smart_union = True
83        allow_population_by_field_name = True
84        populate_by_name = True
85        extra = pydantic_v1.Extra.allow
86        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ObservationsViews(pydantic.v1.main.BaseModel):
13class ObservationsViews(pydantic_v1.BaseModel):
14    data: typing.List[ObservationsView]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[ObservationsView]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ObservationsViews.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class OpenAiUsage(pydantic.v1.main.BaseModel):
11class OpenAiUsage(pydantic_v1.BaseModel):
12    """
13    Usage interface of OpenAI for improved compatibility.
14    """
15
16    prompt_tokens: typing.Optional[int] = pydantic_v1.Field(alias="promptTokens", default=None)
17    completion_tokens: typing.Optional[int] = pydantic_v1.Field(alias="completionTokens", default=None)
18    total_tokens: typing.Optional[int] = pydantic_v1.Field(alias="totalTokens", default=None)
19
20    def json(self, **kwargs: typing.Any) -> str:
21        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        return super().json(**kwargs_with_defaults)
23
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
27
28        return deep_union_pydantic_dicts(
29            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
30        )
31
32    class Config:
33        frozen = True
34        smart_union = True
35        allow_population_by_field_name = True
36        populate_by_name = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}

Usage interface of OpenAI for improved compatibility.

prompt_tokens: Optional[int]
completion_tokens: Optional[int]
total_tokens: Optional[int]
def json(self, **kwargs: Any) -> str:
20    def json(self, **kwargs: typing.Any) -> str:
21        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
24    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
25        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
27
28        return deep_union_pydantic_dicts(
29            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
30        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class OpenAiUsage.Config:
32    class Config:
33        frozen = True
34        smart_union = True
35        allow_population_by_field_name = True
36        populate_by_name = True
37        extra = pydantic_v1.Extra.allow
38        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class OptionalObservationBody(pydantic.v1.main.BaseModel):
12class OptionalObservationBody(pydantic_v1.BaseModel):
13    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
14    name: typing.Optional[str] = None
15    start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="startTime", default=None)
16    metadata: typing.Optional[typing.Any] = None
17    input: typing.Optional[typing.Any] = None
18    output: typing.Optional[typing.Any] = None
19    level: typing.Optional[ObservationLevel] = None
20    status_message: typing.Optional[str] = pydantic_v1.Field(alias="statusMessage", default=None)
21    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(alias="parentObservationId", default=None)
22    version: typing.Optional[str] = None
23
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)
27
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )
35
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
trace_id: Optional[str]
name: Optional[str]
start_time: Optional[datetime.datetime]
metadata: Optional[Any]
input: Optional[Any]
output: Optional[Any]
level: Optional[ObservationLevel]
status_message: Optional[str]
parent_observation_id: Optional[str]
version: Optional[str]
def json(self, **kwargs: Any) -> str:
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class OptionalObservationBody.Config:
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PaginatedDatasetItems(pydantic.v1.main.BaseModel):
13class PaginatedDatasetItems(pydantic_v1.BaseModel):
14    data: typing.List[DatasetItem]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[DatasetItem]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PaginatedDatasetItems.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PaginatedDatasetRuns(pydantic.v1.main.BaseModel):
13class PaginatedDatasetRuns(pydantic_v1.BaseModel):
14    data: typing.List[DatasetRun]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[DatasetRun]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PaginatedDatasetRuns.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PaginatedDatasets(pydantic.v1.main.BaseModel):
13class PaginatedDatasets(pydantic_v1.BaseModel):
14    data: typing.List[Dataset]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[Dataset]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PaginatedDatasets.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PaginatedModels(pydantic.v1.main.BaseModel):
13class PaginatedModels(pydantic_v1.BaseModel):
14    data: typing.List[Model]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[Model]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PaginatedModels.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PaginatedSessions(pydantic.v1.main.BaseModel):
13class PaginatedSessions(pydantic_v1.BaseModel):
14    data: typing.List[Session]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[Session]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PaginatedSessions.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PatchMediaBody(pydantic.v1.main.BaseModel):
11class PatchMediaBody(pydantic_v1.BaseModel):
12    uploaded_at: dt.datetime = pydantic_v1.Field(alias="uploadedAt")
13    """
14    The date and time when the media record was uploaded
15    """
16
17    upload_http_status: int = pydantic_v1.Field(alias="uploadHttpStatus")
18    """
19    The HTTP status code of the upload
20    """
21
22    upload_http_error: typing.Optional[str] = pydantic_v1.Field(
23        alias="uploadHttpError", default=None
24    )
25    """
26    The HTTP error message of the upload
27    """
28
29    upload_time_ms: typing.Optional[int] = pydantic_v1.Field(
30        alias="uploadTimeMs", default=None
31    )
32    """
33    The time in milliseconds it took to upload the media record
34    """
35
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().json(**kwargs_with_defaults)
43
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
50        kwargs_with_defaults_exclude_none: typing.Any = {
51            "by_alias": True,
52            "exclude_none": True,
53            **kwargs,
54        }
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset),
58            super().dict(**kwargs_with_defaults_exclude_none),
59        )
60
61    class Config:
62        frozen = True
63        smart_union = True
64        allow_population_by_field_name = True
65        populate_by_name = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
uploaded_at: datetime.datetime

The date and time when the media record was uploaded

upload_http_status: int

The HTTP status code of the upload

upload_http_error: Optional[str]

The HTTP error message of the upload

upload_time_ms: Optional[int]

The time in milliseconds it took to upload the media record

def json(self, **kwargs: Any) -> str:
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
50        kwargs_with_defaults_exclude_none: typing.Any = {
51            "by_alias": True,
52            "exclude_none": True,
53            **kwargs,
54        }
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset),
58            super().dict(**kwargs_with_defaults_exclude_none),
59        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PatchMediaBody.Config:
61    class Config:
62        frozen = True
63        smart_union = True
64        allow_population_by_field_name = True
65        populate_by_name = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Project(pydantic.v1.main.BaseModel):
11class Project(pydantic_v1.BaseModel):
12    id: str
13    name: str
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
id: str
name: str
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Project.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Projects(pydantic.v1.main.BaseModel):
12class Projects(pydantic_v1.BaseModel):
13    data: typing.List[Project]
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
data: List[Project]
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Projects.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        extra = pydantic_v1.Extra.allow
31        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
Prompt = typing.Union[Prompt_Chat, Prompt_Text]
class PromptMeta(pydantic.v1.main.BaseModel):
11class PromptMeta(pydantic_v1.BaseModel):
12    name: str
13    versions: typing.List[int]
14    labels: typing.List[str]
15    tags: typing.List[str]
16    last_updated_at: dt.datetime = pydantic_v1.Field(alias="lastUpdatedAt")
17    last_config: typing.Any = pydantic_v1.Field(alias="lastConfig")
18    """
19    Config object of the most recent prompt version that matches the filters (if any are provided)
20    """
21
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        return super().json(**kwargs_with_defaults)
25
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
29
30        return deep_union_pydantic_dicts(
31            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
32        )
33
34    class Config:
35        frozen = True
36        smart_union = True
37        allow_population_by_field_name = True
38        populate_by_name = True
39        extra = pydantic_v1.Extra.allow
40        json_encoders = {dt.datetime: serialize_datetime}
name: str
versions: List[int]
labels: List[str]
tags: List[str]
last_updated_at: datetime.datetime
last_config: Any

Config object of the most recent prompt version that matches the filters (if any are provided)

def json(self, **kwargs: Any) -> str:
22    def json(self, **kwargs: typing.Any) -> str:
23        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
29
30        return deep_union_pydantic_dicts(
31            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
32        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PromptMeta.Config:
34    class Config:
35        frozen = True
36        smart_union = True
37        allow_population_by_field_name = True
38        populate_by_name = True
39        extra = pydantic_v1.Extra.allow
40        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class PromptMetaListResponse(pydantic.v1.main.BaseModel):
13class PromptMetaListResponse(pydantic_v1.BaseModel):
14    data: typing.List[PromptMeta]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[PromptMeta]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class PromptMetaListResponse.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Prompt_Chat(pydantic.v1.main.BaseModel):
14class Prompt_Chat(pydantic_v1.BaseModel):
15    prompt: typing.List[ChatMessage]
16    name: str
17    version: int
18    config: typing.Any
19    labels: typing.List[str]
20    tags: typing.List[str]
21    type: typing.Literal["chat"] = "chat"
22
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)
26
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )
34
35    class Config:
36        frozen = True
37        smart_union = True
38        extra = pydantic_v1.Extra.allow
39        json_encoders = {dt.datetime: serialize_datetime}
prompt: List[ChatMessage]
name: str
version: int
config: Any
labels: List[str]
tags: List[str]
type: Literal['chat']
def json(self, **kwargs: Any) -> str:
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
27    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
31        return deep_union_pydantic_dicts(
32            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Prompt_Chat.Config:
35    class Config:
36        frozen = True
37        smart_union = True
38        extra = pydantic_v1.Extra.allow
39        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Prompt_Text(pydantic.v1.main.BaseModel):
42class Prompt_Text(pydantic_v1.BaseModel):
43    prompt: str
44    name: str
45    version: int
46    config: typing.Any
47    labels: typing.List[str]
48    tags: typing.List[str]
49    type: typing.Literal["text"] = "text"
50
51    def json(self, **kwargs: typing.Any) -> str:
52        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
53        return super().json(**kwargs_with_defaults)
54
55    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
56        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
57        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
58
59        return deep_union_pydantic_dicts(
60            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
61        )
62
63    class Config:
64        frozen = True
65        smart_union = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
prompt: str
name: str
version: int
config: Any
labels: List[str]
tags: List[str]
type: Literal['text']
def json(self, **kwargs: Any) -> str:
51    def json(self, **kwargs: typing.Any) -> str:
52        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
53        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
55    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
56        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
57        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
58
59        return deep_union_pydantic_dicts(
60            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
61        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Prompt_Text.Config:
63    class Config:
64        frozen = True
65        smart_union = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ScoreBody(pydantic.v1.main.BaseModel):
13class ScoreBody(pydantic_v1.BaseModel):
14    """
15    Examples
16    --------
17    from finto import ScoreBody
18
19    ScoreBody(
20        name="novelty",
21        value=0.9,
22        trace_id="cdef-1234-5678-90ab",
23    )
24    """
25
26    id: typing.Optional[str] = None
27    trace_id: str = pydantic_v1.Field(alias="traceId")
28    name: str
29    value: CreateScoreValue = pydantic_v1.Field()
30    """
31    The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)
32    """
33
34    observation_id: typing.Optional[str] = pydantic_v1.Field(alias="observationId", default=None)
35    comment: typing.Optional[str] = None
36    data_type: typing.Optional[ScoreDataType] = pydantic_v1.Field(alias="dataType", default=None)
37    """
38    When set, must match the score value's type. If not set, will be inferred from the score value or config
39    """
40
41    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
42    """
43    Reference a score config on a score. When set, the score name must equal the config name and scores must comply with the config's range and data type. For categorical scores, the value must map to a config category. Numeric scores might be constrained by the score config's max and min values
44    """
45
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)
49
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )
57
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}

Examples

from finto import ScoreBody

ScoreBody( name="novelty", value=0.9, trace_id="cdef-1234-5678-90ab", )

id: Optional[str]
trace_id: str
name: str
value: Union[float, str]

The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)

observation_id: Optional[str]
comment: Optional[str]
data_type: Optional[ScoreDataType]

When set, must match the score value's type. If not set, will be inferred from the score value or config

config_id: Optional[str]

Reference a score config on a score. When set, the score name must equal the config name and scores must comply with the config's range and data type. For categorical scores, the value must map to a config category. Numeric scores might be constrained by the score config's max and min values

def json(self, **kwargs: Any) -> str:
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ScoreBody.Config:
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ScoreConfig(pydantic.v1.main.BaseModel):
13class ScoreConfig(pydantic_v1.BaseModel):
14    """
15    Configuration for a score
16    """
17
18    id: str
19    name: str
20    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
21    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
22    project_id: str = pydantic_v1.Field(alias="projectId")
23    data_type: ScoreDataType = pydantic_v1.Field(alias="dataType")
24    is_archived: bool = pydantic_v1.Field(alias="isArchived")
25    """
26    Whether the score config is archived. Defaults to false
27    """
28
29    min_value: typing.Optional[float] = pydantic_v1.Field(alias="minValue", default=None)
30    """
31    Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞
32    """
33
34    max_value: typing.Optional[float] = pydantic_v1.Field(alias="maxValue", default=None)
35    """
36    Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞
37    """
38
39    categories: typing.Optional[typing.List[ConfigCategory]] = pydantic_v1.Field(default=None)
40    """
41    Configures custom categories for categorical scores
42    """
43
44    description: typing.Optional[str] = None
45
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)
49
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )
57
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}

Configuration for a score

id: str
name: str
created_at: datetime.datetime
updated_at: datetime.datetime
project_id: str
data_type: ScoreDataType
is_archived: bool

Whether the score config is archived. Defaults to false

min_value: Optional[float]

Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞

max_value: Optional[float]

Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞

categories: Optional[List[ConfigCategory]]

Configures custom categories for categorical scores

description: Optional[str]
def json(self, **kwargs: Any) -> str:
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
48        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
50    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
51        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
52        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
53
54        return deep_union_pydantic_dicts(
55            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
56        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ScoreConfig.Config:
58    class Config:
59        frozen = True
60        smart_union = True
61        allow_population_by_field_name = True
62        populate_by_name = True
63        extra = pydantic_v1.Extra.allow
64        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ScoreConfigs(pydantic.v1.main.BaseModel):
13class ScoreConfigs(pydantic_v1.BaseModel):
14    data: typing.List[ScoreConfig]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[ScoreConfig]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class ScoreConfigs.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ScoreDataType(builtins.str, enum.Enum):
10class ScoreDataType(str, enum.Enum):
11    NUMERIC = "NUMERIC"
12    BOOLEAN = "BOOLEAN"
13    CATEGORICAL = "CATEGORICAL"
14
15    def visit(
16        self,
17        numeric: typing.Callable[[], T_Result],
18        boolean: typing.Callable[[], T_Result],
19        categorical: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ScoreDataType.NUMERIC:
22            return numeric()
23        if self is ScoreDataType.BOOLEAN:
24            return boolean()
25        if self is ScoreDataType.CATEGORICAL:
26            return categorical()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

NUMERIC = <ScoreDataType.NUMERIC: 'NUMERIC'>
BOOLEAN = <ScoreDataType.BOOLEAN: 'BOOLEAN'>
CATEGORICAL = <ScoreDataType.CATEGORICAL: 'CATEGORICAL'>
def visit( self, numeric: Callable[[], ~T_Result], boolean: Callable[[], ~T_Result], categorical: Callable[[], ~T_Result]) -> ~T_Result:
15    def visit(
16        self,
17        numeric: typing.Callable[[], T_Result],
18        boolean: typing.Callable[[], T_Result],
19        categorical: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ScoreDataType.NUMERIC:
22            return numeric()
23        if self is ScoreDataType.BOOLEAN:
24            return boolean()
25        if self is ScoreDataType.CATEGORICAL:
26            return categorical()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class ScoreEvent(langfuse.api.BaseEvent):
13class ScoreEvent(BaseEvent):
14    body: ScoreBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
body: ScoreBody
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class ScoreEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ScoreSource(builtins.str, enum.Enum):
10class ScoreSource(str, enum.Enum):
11    ANNOTATION = "ANNOTATION"
12    API = "API"
13    EVAL = "EVAL"
14
15    def visit(
16        self,
17        annotation: typing.Callable[[], T_Result],
18        api: typing.Callable[[], T_Result],
19        eval: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ScoreSource.ANNOTATION:
22            return annotation()
23        if self is ScoreSource.API:
24            return api()
25        if self is ScoreSource.EVAL:
26            return eval()

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

ANNOTATION = <ScoreSource.ANNOTATION: 'ANNOTATION'>
API = <ScoreSource.API: 'API'>
EVAL = <ScoreSource.EVAL: 'EVAL'>
def visit( self, annotation: Callable[[], ~T_Result], api: Callable[[], ~T_Result], eval: Callable[[], ~T_Result]) -> ~T_Result:
15    def visit(
16        self,
17        annotation: typing.Callable[[], T_Result],
18        api: typing.Callable[[], T_Result],
19        eval: typing.Callable[[], T_Result],
20    ) -> T_Result:
21        if self is ScoreSource.ANNOTATION:
22            return annotation()
23        if self is ScoreSource.API:
24            return api()
25        if self is ScoreSource.EVAL:
26            return eval()
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class Score_Boolean(pydantic.v1.main.BaseModel):
127class Score_Boolean(pydantic_v1.BaseModel):
128    value: float
129    string_value: str = pydantic_v1.Field(alias="stringValue")
130    id: str
131    trace_id: str = pydantic_v1.Field(alias="traceId")
132    name: str
133    source: ScoreSource
134    observation_id: typing.Optional[str] = pydantic_v1.Field(
135        alias="observationId", default=None
136    )
137    timestamp: dt.datetime
138    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
139    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
140    author_user_id: typing.Optional[str] = pydantic_v1.Field(
141        alias="authorUserId", default=None
142    )
143    comment: typing.Optional[str] = None
144    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
145    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
146    data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field(
147        alias="dataType", default="BOOLEAN"
148    )
149
150    def json(self, **kwargs: typing.Any) -> str:
151        kwargs_with_defaults: typing.Any = {
152            "by_alias": True,
153            "exclude_unset": True,
154            **kwargs,
155        }
156        return super().json(**kwargs_with_defaults)
157
158    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
159        kwargs_with_defaults_exclude_unset: typing.Any = {
160            "by_alias": True,
161            "exclude_unset": True,
162            **kwargs,
163        }
164        kwargs_with_defaults_exclude_none: typing.Any = {
165            "by_alias": True,
166            "exclude_none": True,
167            **kwargs,
168        }
169
170        return deep_union_pydantic_dicts(
171            super().dict(**kwargs_with_defaults_exclude_unset),
172            super().dict(**kwargs_with_defaults_exclude_none),
173        )
174
175    class Config:
176        frozen = True
177        smart_union = True
178        allow_population_by_field_name = True
179        populate_by_name = True
180        extra = pydantic_v1.Extra.allow
181        json_encoders = {dt.datetime: serialize_datetime}
value: float
string_value: str
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['BOOLEAN']
def json(self, **kwargs: Any) -> str:
150    def json(self, **kwargs: typing.Any) -> str:
151        kwargs_with_defaults: typing.Any = {
152            "by_alias": True,
153            "exclude_unset": True,
154            **kwargs,
155        }
156        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
158    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
159        kwargs_with_defaults_exclude_unset: typing.Any = {
160            "by_alias": True,
161            "exclude_unset": True,
162            **kwargs,
163        }
164        kwargs_with_defaults_exclude_none: typing.Any = {
165            "by_alias": True,
166            "exclude_none": True,
167            **kwargs,
168        }
169
170        return deep_union_pydantic_dicts(
171            super().dict(**kwargs_with_defaults_exclude_unset),
172            super().dict(**kwargs_with_defaults_exclude_none),
173        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Score_Boolean.Config:
175    class Config:
176        frozen = True
177        smart_union = True
178        allow_population_by_field_name = True
179        populate_by_name = True
180        extra = pydantic_v1.Extra.allow
181        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Score_Categorical(pydantic.v1.main.BaseModel):
 70class Score_Categorical(pydantic_v1.BaseModel):
 71    value: typing.Optional[float] = None
 72    string_value: str = pydantic_v1.Field(alias="stringValue")
 73    id: str
 74    trace_id: str = pydantic_v1.Field(alias="traceId")
 75    name: str
 76    source: ScoreSource
 77    observation_id: typing.Optional[str] = pydantic_v1.Field(
 78        alias="observationId", default=None
 79    )
 80    timestamp: dt.datetime
 81    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
 82    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
 83    author_user_id: typing.Optional[str] = pydantic_v1.Field(
 84        alias="authorUserId", default=None
 85    )
 86    comment: typing.Optional[str] = None
 87    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
 88    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
 89    data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field(
 90        alias="dataType", default="CATEGORICAL"
 91    )
 92
 93    def json(self, **kwargs: typing.Any) -> str:
 94        kwargs_with_defaults: typing.Any = {
 95            "by_alias": True,
 96            "exclude_unset": True,
 97            **kwargs,
 98        }
 99        return super().json(**kwargs_with_defaults)
100
101    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
102        kwargs_with_defaults_exclude_unset: typing.Any = {
103            "by_alias": True,
104            "exclude_unset": True,
105            **kwargs,
106        }
107        kwargs_with_defaults_exclude_none: typing.Any = {
108            "by_alias": True,
109            "exclude_none": True,
110            **kwargs,
111        }
112
113        return deep_union_pydantic_dicts(
114            super().dict(**kwargs_with_defaults_exclude_unset),
115            super().dict(**kwargs_with_defaults_exclude_none),
116        )
117
118    class Config:
119        frozen = True
120        smart_union = True
121        allow_population_by_field_name = True
122        populate_by_name = True
123        extra = pydantic_v1.Extra.allow
124        json_encoders = {dt.datetime: serialize_datetime}
value: Optional[float]
string_value: str
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['CATEGORICAL']
def json(self, **kwargs: Any) -> str:
93    def json(self, **kwargs: typing.Any) -> str:
94        kwargs_with_defaults: typing.Any = {
95            "by_alias": True,
96            "exclude_unset": True,
97            **kwargs,
98        }
99        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
101    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
102        kwargs_with_defaults_exclude_unset: typing.Any = {
103            "by_alias": True,
104            "exclude_unset": True,
105            **kwargs,
106        }
107        kwargs_with_defaults_exclude_none: typing.Any = {
108            "by_alias": True,
109            "exclude_none": True,
110            **kwargs,
111        }
112
113        return deep_union_pydantic_dicts(
114            super().dict(**kwargs_with_defaults_exclude_unset),
115            super().dict(**kwargs_with_defaults_exclude_none),
116        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Score_Categorical.Config:
118    class Config:
119        frozen = True
120        smart_union = True
121        allow_population_by_field_name = True
122        populate_by_name = True
123        extra = pydantic_v1.Extra.allow
124        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Score_Numeric(pydantic.v1.main.BaseModel):
14class Score_Numeric(pydantic_v1.BaseModel):
15    value: float
16    id: str
17    trace_id: str = pydantic_v1.Field(alias="traceId")
18    name: str
19    source: ScoreSource
20    observation_id: typing.Optional[str] = pydantic_v1.Field(
21        alias="observationId", default=None
22    )
23    timestamp: dt.datetime
24    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
25    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
26    author_user_id: typing.Optional[str] = pydantic_v1.Field(
27        alias="authorUserId", default=None
28    )
29    comment: typing.Optional[str] = None
30    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
31    queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
32    data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field(
33        alias="dataType", default="NUMERIC"
34    )
35
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().json(**kwargs_with_defaults)
43
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
50        kwargs_with_defaults_exclude_none: typing.Any = {
51            "by_alias": True,
52            "exclude_none": True,
53            **kwargs,
54        }
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset),
58            super().dict(**kwargs_with_defaults_exclude_none),
59        )
60
61    class Config:
62        frozen = True
63        smart_union = True
64        allow_population_by_field_name = True
65        populate_by_name = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
value: float
id: str
trace_id: str
name: str
source: ScoreSource
observation_id: Optional[str]
timestamp: datetime.datetime
created_at: datetime.datetime
updated_at: datetime.datetime
author_user_id: Optional[str]
comment: Optional[str]
config_id: Optional[str]
queue_id: Optional[str]
data_type: Literal['NUMERIC']
def json(self, **kwargs: Any) -> str:
36    def json(self, **kwargs: typing.Any) -> str:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
50        kwargs_with_defaults_exclude_none: typing.Any = {
51            "by_alias": True,
52            "exclude_none": True,
53            **kwargs,
54        }
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset),
58            super().dict(**kwargs_with_defaults_exclude_none),
59        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Score_Numeric.Config:
61    class Config:
62        frozen = True
63        smart_union = True
64        allow_population_by_field_name = True
65        populate_by_name = True
66        extra = pydantic_v1.Extra.allow
67        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class SdkLogBody(pydantic.v1.main.BaseModel):
11class SdkLogBody(pydantic_v1.BaseModel):
12    log: typing.Any
13
14    def json(self, **kwargs: typing.Any) -> str:
15        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16        return super().json(**kwargs_with_defaults)
17
18    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
21
22        return deep_union_pydantic_dicts(
23            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
24        )
25
26    class Config:
27        frozen = True
28        smart_union = True
29        extra = pydantic_v1.Extra.allow
30        json_encoders = {dt.datetime: serialize_datetime}
log: Any
def json(self, **kwargs: Any) -> str:
14    def json(self, **kwargs: typing.Any) -> str:
15        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
18    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
21
22        return deep_union_pydantic_dicts(
23            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
24        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class SdkLogBody.Config:
26    class Config:
27        frozen = True
28        smart_union = True
29        extra = pydantic_v1.Extra.allow
30        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class SdkLogEvent(langfuse.api.BaseEvent):
13class SdkLogEvent(BaseEvent):
14    body: SdkLogBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
body: SdkLogBody
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class SdkLogEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class ServiceUnavailableError(langfuse.api.core.api_error.ApiError):
7class ServiceUnavailableError(ApiError):
8    def __init__(self) -> None:
9        super().__init__(status_code=503)

Common base class for all non-exit exceptions.

Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class Session(pydantic.v1.main.BaseModel):
11class Session(pydantic_v1.BaseModel):
12    id: str
13    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
14    project_id: str = pydantic_v1.Field(alias="projectId")
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
id: str
created_at: datetime.datetime
project_id: str
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Session.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class SessionWithTraces(langfuse.api.Session):
13class SessionWithTraces(Session):
14    traces: typing.List[Trace]
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
traces: List[Trace]
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
Session
id
created_at
project_id
class SessionWithTraces.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Sort(pydantic.v1.main.BaseModel):
11class Sort(pydantic_v1.BaseModel):
12    id: str
13
14    def json(self, **kwargs: typing.Any) -> str:
15        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16        return super().json(**kwargs_with_defaults)
17
18    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
21
22        return deep_union_pydantic_dicts(
23            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
24        )
25
26    class Config:
27        frozen = True
28        smart_union = True
29        extra = pydantic_v1.Extra.allow
30        json_encoders = {dt.datetime: serialize_datetime}
id: str
def json(self, **kwargs: Any) -> str:
14    def json(self, **kwargs: typing.Any) -> str:
15        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
18    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
21
22        return deep_union_pydantic_dicts(
23            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
24        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Sort.Config:
26    class Config:
27        frozen = True
28        smart_union = True
29        extra = pydantic_v1.Extra.allow
30        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class TextPrompt(langfuse.api.BasePrompt):
12class TextPrompt(BasePrompt):
13    prompt: str
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
prompt: str
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BasePrompt
name
version
config
labels
tags
class TextPrompt.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Trace(pydantic.v1.main.BaseModel):
11class Trace(pydantic_v1.BaseModel):
12    id: str = pydantic_v1.Field()
13    """
14    The unique identifier of a trace
15    """
16
17    timestamp: dt.datetime = pydantic_v1.Field()
18    """
19    The timestamp when the trace was created
20    """
21
22    name: typing.Optional[str] = pydantic_v1.Field(default=None)
23    """
24    The name of the trace
25    """
26
27    input: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
28    """
29    The input data of the trace. Can be any JSON.
30    """
31
32    output: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
33    """
34    The output data of the trace. Can be any JSON.
35    """
36
37    session_id: typing.Optional[str] = pydantic_v1.Field(alias="sessionId", default=None)
38    """
39    The session identifier associated with the trace
40    """
41
42    release: typing.Optional[str] = pydantic_v1.Field(default=None)
43    """
44    The release version of the application when the trace was created
45    """
46
47    version: typing.Optional[str] = pydantic_v1.Field(default=None)
48    """
49    The version of the trace
50    """
51
52    user_id: typing.Optional[str] = pydantic_v1.Field(alias="userId", default=None)
53    """
54    The user identifier associated with the trace
55    """
56
57    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
58    """
59    The metadata associated with the trace. Can be any JSON.
60    """
61
62    tags: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
63    """
64    The tags associated with the trace. Can be an array of strings or null.
65    """
66
67    public: typing.Optional[bool] = pydantic_v1.Field(default=None)
68    """
69    Public traces are accessible via url without login
70    """
71
72    def json(self, **kwargs: typing.Any) -> str:
73        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
74        return super().json(**kwargs_with_defaults)
75
76    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
77        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
78        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
79
80        return deep_union_pydantic_dicts(
81            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
82        )
83
84    class Config:
85        frozen = True
86        smart_union = True
87        allow_population_by_field_name = True
88        populate_by_name = True
89        extra = pydantic_v1.Extra.allow
90        json_encoders = {dt.datetime: serialize_datetime}
id: str

The unique identifier of a trace

timestamp: datetime.datetime

The timestamp when the trace was created

name: Optional[str]

The name of the trace

input: Optional[Any]

The input data of the trace. Can be any JSON.

output: Optional[Any]

The output data of the trace. Can be any JSON.

session_id: Optional[str]

The session identifier associated with the trace

release: Optional[str]

The release version of the application when the trace was created

version: Optional[str]

The version of the trace

user_id: Optional[str]

The user identifier associated with the trace

metadata: Optional[Any]

The metadata associated with the trace. Can be any JSON.

tags: Optional[List[str]]

The tags associated with the trace. Can be an array of strings or null.

public: Optional[bool]

Public traces are accessible via url without login

def json(self, **kwargs: Any) -> str:
72    def json(self, **kwargs: typing.Any) -> str:
73        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
74        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
76    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
77        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
78        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
79
80        return deep_union_pydantic_dicts(
81            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
82        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Trace.Config:
84    class Config:
85        frozen = True
86        smart_union = True
87        allow_population_by_field_name = True
88        populate_by_name = True
89        extra = pydantic_v1.Extra.allow
90        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class TraceBody(pydantic.v1.main.BaseModel):
11class TraceBody(pydantic_v1.BaseModel):
12    id: typing.Optional[str] = None
13    timestamp: typing.Optional[dt.datetime] = None
14    name: typing.Optional[str] = None
15    user_id: typing.Optional[str] = pydantic_v1.Field(alias="userId", default=None)
16    input: typing.Optional[typing.Any] = None
17    output: typing.Optional[typing.Any] = None
18    session_id: typing.Optional[str] = pydantic_v1.Field(alias="sessionId", default=None)
19    release: typing.Optional[str] = None
20    version: typing.Optional[str] = None
21    metadata: typing.Optional[typing.Any] = None
22    tags: typing.Optional[typing.List[str]] = None
23    public: typing.Optional[bool] = pydantic_v1.Field(default=None)
24    """
25    Make trace publicly accessible via url
26    """
27
28    def json(self, **kwargs: typing.Any) -> str:
29        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        return super().json(**kwargs_with_defaults)
31
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
34        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
38        )
39
40    class Config:
41        frozen = True
42        smart_union = True
43        allow_population_by_field_name = True
44        populate_by_name = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
id: Optional[str]
timestamp: Optional[datetime.datetime]
name: Optional[str]
user_id: Optional[str]
input: Optional[Any]
output: Optional[Any]
session_id: Optional[str]
release: Optional[str]
version: Optional[str]
metadata: Optional[Any]
tags: Optional[List[str]]
public: Optional[bool]

Make trace publicly accessible via url

def json(self, **kwargs: Any) -> str:
28    def json(self, **kwargs: typing.Any) -> str:
29        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
32    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
33        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
34        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
35
36        return deep_union_pydantic_dicts(
37            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
38        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class TraceBody.Config:
40    class Config:
41        frozen = True
42        smart_union = True
43        allow_population_by_field_name = True
44        populate_by_name = True
45        extra = pydantic_v1.Extra.allow
46        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class TraceEvent(langfuse.api.BaseEvent):
13class TraceEvent(BaseEvent):
14    body: TraceBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
body: TraceBody
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class TraceEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class TraceWithDetails(langfuse.api.Trace):
12class TraceWithDetails(Trace):
13    html_path: str = pydantic_v1.Field(alias="htmlPath")
14    """
15    Path of trace in Langfuse UI
16    """
17
18    latency: float = pydantic_v1.Field()
19    """
20    Latency of trace in seconds
21    """
22
23    total_cost: float = pydantic_v1.Field(alias="totalCost")
24    """
25    Cost of trace in USD
26    """
27
28    observations: typing.List[str] = pydantic_v1.Field()
29    """
30    List of observation ids
31    """
32
33    scores: typing.List[str] = pydantic_v1.Field()
34    """
35    List of score ids
36    """
37
38    def json(self, **kwargs: typing.Any) -> str:
39        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
40        return super().json(**kwargs_with_defaults)
41
42    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
43        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
44        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
45
46        return deep_union_pydantic_dicts(
47            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
48        )
49
50    class Config:
51        frozen = True
52        smart_union = True
53        allow_population_by_field_name = True
54        populate_by_name = True
55        extra = pydantic_v1.Extra.allow
56        json_encoders = {dt.datetime: serialize_datetime}
html_path: str

Path of trace in Langfuse UI

latency: float

Latency of trace in seconds

total_cost: float

Cost of trace in USD

observations: List[str]

List of observation ids

scores: List[str]

List of score ids

def json(self, **kwargs: Any) -> str:
38    def json(self, **kwargs: typing.Any) -> str:
39        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
40        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
42    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
43        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
44        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
45
46        return deep_union_pydantic_dicts(
47            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
48        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
Trace
id
timestamp
name
input
output
session_id
release
version
user_id
metadata
tags
public
class TraceWithDetails.Config:
50    class Config:
51        frozen = True
52        smart_union = True
53        allow_population_by_field_name = True
54        populate_by_name = True
55        extra = pydantic_v1.Extra.allow
56        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class TraceWithFullDetails(langfuse.api.Trace):
14class TraceWithFullDetails(Trace):
15    html_path: str = pydantic_v1.Field(alias="htmlPath")
16    """
17    Path of trace in Langfuse UI
18    """
19
20    latency: float = pydantic_v1.Field()
21    """
22    Latency of trace in seconds
23    """
24
25    total_cost: float = pydantic_v1.Field(alias="totalCost")
26    """
27    Cost of trace in USD
28    """
29
30    observations: typing.List[ObservationsView] = pydantic_v1.Field()
31    """
32    List of observations
33    """
34
35    scores: typing.List[Score] = pydantic_v1.Field()
36    """
37    List of scores
38    """
39
40    def json(self, **kwargs: typing.Any) -> str:
41        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        return super().json(**kwargs_with_defaults)
43
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
46        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
47
48        return deep_union_pydantic_dicts(
49            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
50        )
51
52    class Config:
53        frozen = True
54        smart_union = True
55        allow_population_by_field_name = True
56        populate_by_name = True
57        extra = pydantic_v1.Extra.allow
58        json_encoders = {dt.datetime: serialize_datetime}
html_path: str

Path of trace in Langfuse UI

latency: float

Latency of trace in seconds

total_cost: float

Cost of trace in USD

observations: List[ObservationsView]

List of observations

List of scores

def json(self, **kwargs: Any) -> str:
40    def json(self, **kwargs: typing.Any) -> str:
41        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
44    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
45        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
46        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
47
48        return deep_union_pydantic_dicts(
49            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
50        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
Trace
id
timestamp
name
input
output
session_id
release
version
user_id
metadata
tags
public
class TraceWithFullDetails.Config:
52    class Config:
53        frozen = True
54        smart_union = True
55        allow_population_by_field_name = True
56        populate_by_name = True
57        extra = pydantic_v1.Extra.allow
58        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Traces(pydantic.v1.main.BaseModel):
13class Traces(pydantic_v1.BaseModel):
14    data: typing.List[TraceWithDetails]
15    meta: MetaResponse
16
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)
20
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )
28
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
data: List[TraceWithDetails]
meta: langfuse.api.resources.utils.resources.pagination.types.meta_response.MetaResponse
def json(self, **kwargs: Any) -> str:
17    def json(self, **kwargs: typing.Any) -> str:
18        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
21    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
25        return deep_union_pydantic_dicts(
26            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Traces.Config:
29    class Config:
30        frozen = True
31        smart_union = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UnauthorizedError(langfuse.api.core.api_error.ApiError):
 9class UnauthorizedError(ApiError):
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=401, body=body)

Common base class for all non-exit exceptions.

UnauthorizedError(body: Any)
10    def __init__(self, body: typing.Any):
11        super().__init__(status_code=401, body=body)
Inherited Members
langfuse.api.core.api_error.ApiError
status_code
body
builtins.BaseException
with_traceback
add_note
args
class UpdateEventBody(langfuse.api.OptionalObservationBody):
12class UpdateEventBody(OptionalObservationBody):
13    id: str
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
id: str
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class UpdateEventBody.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UpdateGenerationBody(langfuse.api.UpdateSpanBody):
14class UpdateGenerationBody(UpdateSpanBody):
15    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="completionStartTime", default=None)
16    model: typing.Optional[str] = None
17    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
18        alias="modelParameters", default=None
19    )
20    usage: typing.Optional[IngestionUsage] = None
21    prompt_name: typing.Optional[str] = pydantic_v1.Field(alias="promptName", default=None)
22    prompt_version: typing.Optional[int] = pydantic_v1.Field(alias="promptVersion", default=None)
23
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)
27
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )
35
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
completion_start_time: Optional[datetime.datetime]
model: Optional[str]
model_parameters: Optional[Dict[str, Union[str, NoneType, int, bool, List[str]]]]
usage: Union[Usage, OpenAiUsage, NoneType]
prompt_name: Optional[str]
prompt_version: Optional[int]
def json(self, **kwargs: Any) -> str:
24    def json(self, **kwargs: typing.Any) -> str:
25        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
31
32        return deep_union_pydantic_dicts(
33            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
34        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
UpdateSpanBody
end_time
UpdateEventBody
id
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class UpdateGenerationBody.Config:
36    class Config:
37        frozen = True
38        smart_union = True
39        allow_population_by_field_name = True
40        populate_by_name = True
41        extra = pydantic_v1.Extra.allow
42        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UpdateGenerationEvent(langfuse.api.BaseEvent):
13class UpdateGenerationEvent(BaseEvent):
14    body: UpdateGenerationBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class UpdateGenerationEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UpdateObservationEvent(langfuse.api.BaseEvent):
13class UpdateObservationEvent(BaseEvent):
14    body: ObservationBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class UpdateObservationEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UpdateSpanBody(langfuse.api.UpdateEventBody):
12class UpdateSpanBody(UpdateEventBody):
13    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(alias="endTime", default=None)
14
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)
18
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )
26
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
end_time: Optional[datetime.datetime]
def json(self, **kwargs: Any) -> str:
15    def json(self, **kwargs: typing.Any) -> str:
16        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
19    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
23        return deep_union_pydantic_dicts(
24            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
UpdateEventBody
id
OptionalObservationBody
trace_id
name
start_time
metadata
input
output
level
status_message
parent_observation_id
version
class UpdateSpanBody.Config:
27    class Config:
28        frozen = True
29        smart_union = True
30        allow_population_by_field_name = True
31        populate_by_name = True
32        extra = pydantic_v1.Extra.allow
33        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UpdateSpanEvent(langfuse.api.BaseEvent):
13class UpdateSpanEvent(BaseEvent):
14    body: UpdateSpanBody
15
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)
19
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )
27
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
def json(self, **kwargs: Any) -> str:
16    def json(self, **kwargs: typing.Any) -> str:
17        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
20    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
24        return deep_union_pydantic_dicts(
25            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
BaseEvent
id
timestamp
metadata
class UpdateSpanEvent.Config:
28    class Config:
29        frozen = True
30        smart_union = True
31        allow_population_by_field_name = True
32        populate_by_name = True
33        extra = pydantic_v1.Extra.allow
34        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class Usage(pydantic.v1.main.BaseModel):
12class Usage(pydantic_v1.BaseModel):
13    """
14    Standard interface for usage and cost
15    """
16
17    input: typing.Optional[int] = pydantic_v1.Field(default=None)
18    """
19    Number of input units (e.g. tokens)
20    """
21
22    output: typing.Optional[int] = pydantic_v1.Field(default=None)
23    """
24    Number of output units (e.g. tokens)
25    """
26
27    total: typing.Optional[int] = pydantic_v1.Field(default=None)
28    """
29    Defaults to input+output if not set
30    """
31
32    unit: typing.Optional[ModelUsageUnit] = None
33    input_cost: typing.Optional[float] = pydantic_v1.Field(alias="inputCost", default=None)
34    """
35    USD input cost
36    """
37
38    output_cost: typing.Optional[float] = pydantic_v1.Field(alias="outputCost", default=None)
39    """
40    USD output cost
41    """
42
43    total_cost: typing.Optional[float] = pydantic_v1.Field(alias="totalCost", default=None)
44    """
45    USD total cost, defaults to input+output
46    """
47
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
50        return super().json(**kwargs_with_defaults)
51
52    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
53        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
54        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
58        )
59
60    class Config:
61        frozen = True
62        smart_union = True
63        allow_population_by_field_name = True
64        populate_by_name = True
65        extra = pydantic_v1.Extra.allow
66        json_encoders = {dt.datetime: serialize_datetime}

Standard interface for usage and cost

input: Optional[int]

Number of input units (e.g. tokens)

output: Optional[int]

Number of output units (e.g. tokens)

total: Optional[int]

Defaults to input+output if not set

unit: Optional[ModelUsageUnit]
input_cost: Optional[float]

USD input cost

output_cost: Optional[float]

USD output cost

total_cost: Optional[float]

USD total cost, defaults to input+output

def json(self, **kwargs: Any) -> str:
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
50        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
52    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
53        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
54        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
55
56        return deep_union_pydantic_dicts(
57            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
58        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class Usage.Config:
60    class Config:
61        frozen = True
62        smart_union = True
63        allow_population_by_field_name = True
64        populate_by_name = True
65        extra = pydantic_v1.Extra.allow
66        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class UsageByModel(pydantic.v1.main.BaseModel):
11class UsageByModel(pydantic_v1.BaseModel):
12    """
13    Daily usage of a given model. Usage corresponds to the unit set for the specific model (e.g. tokens).
14    """
15
16    model: typing.Optional[str] = None
17    input_usage: int = pydantic_v1.Field(alias="inputUsage")
18    """
19    Total number of generation input units (e.g. tokens)
20    """
21
22    output_usage: int = pydantic_v1.Field(alias="outputUsage")
23    """
24    Total number of generation output units (e.g. tokens)
25    """
26
27    total_usage: int = pydantic_v1.Field(alias="totalUsage")
28    """
29    Total number of generation total units (e.g. tokens)
30    """
31
32    count_traces: int = pydantic_v1.Field(alias="countTraces")
33    count_observations: int = pydantic_v1.Field(alias="countObservations")
34    total_cost: float = pydantic_v1.Field(alias="totalCost")
35    """
36    Total model cost in USD
37    """
38
39    def json(self, **kwargs: typing.Any) -> str:
40        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
41        return super().json(**kwargs_with_defaults)
42
43    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
44        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
45        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
46
47        return deep_union_pydantic_dicts(
48            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
49        )
50
51    class Config:
52        frozen = True
53        smart_union = True
54        allow_population_by_field_name = True
55        populate_by_name = True
56        extra = pydantic_v1.Extra.allow
57        json_encoders = {dt.datetime: serialize_datetime}

Daily usage of a given model. Usage corresponds to the unit set for the specific model (e.g. tokens).

model: Optional[str]
input_usage: int

Total number of generation input units (e.g. tokens)

output_usage: int

Total number of generation output units (e.g. tokens)

total_usage: int

Total number of generation total units (e.g. tokens)

count_traces: int
count_observations: int
total_cost: float

Total model cost in USD

def json(self, **kwargs: Any) -> str:
39    def json(self, **kwargs: typing.Any) -> str:
40        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
41        return super().json(**kwargs_with_defaults)

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

def dict(self, **kwargs: Any) -> Dict[str, Any]:
43    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
44        kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
45        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
46
47        return deep_union_pydantic_dicts(
48            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
49        )

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class UsageByModel.Config:
51    class Config:
52        frozen = True
53        smart_union = True
54        allow_population_by_field_name = True
55        populate_by_name = True
56        extra = pydantic_v1.Extra.allow
57        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}