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    ConfigCategory,
 13    CreateChatPromptRequest,
 14    CreateDatasetItemRequest,
 15    CreateDatasetRequest,
 16    CreateDatasetRunItemRequest,
 17    CreateEventBody,
 18    CreateEventEvent,
 19    CreateGenerationBody,
 20    CreateGenerationEvent,
 21    CreateModelRequest,
 22    CreateObservationEvent,
 23    CreatePromptRequest,
 24    CreatePromptRequest_Chat,
 25    CreatePromptRequest_Text,
 26    CreateScoreConfigRequest,
 27    CreateScoreRequest,
 28    CreateScoreResponse,
 29    CreateScoreValue,
 30    CreateSpanBody,
 31    CreateSpanEvent,
 32    CreateTextPromptRequest,
 33    DailyMetrics,
 34    DailyMetricsDetails,
 35    Dataset,
 36    DatasetItem,
 37    DatasetRun,
 38    DatasetRunItem,
 39    DatasetRunWithItems,
 40    DatasetStatus,
 41    Error,
 42    HealthResponse,
 43    IngestionError,
 44    IngestionEvent,
 45    IngestionEvent_EventCreate,
 46    IngestionEvent_GenerationCreate,
 47    IngestionEvent_GenerationUpdate,
 48    IngestionEvent_ObservationCreate,
 49    IngestionEvent_ObservationUpdate,
 50    IngestionEvent_ScoreCreate,
 51    IngestionEvent_SdkLog,
 52    IngestionEvent_SpanCreate,
 53    IngestionEvent_SpanUpdate,
 54    IngestionEvent_TraceCreate,
 55    IngestionResponse,
 56    IngestionSuccess,
 57    IngestionUsage,
 58    MapValue,
 59    MethodNotAllowedError,
 60    Model,
 61    ModelUsageUnit,
 62    NotFoundError,
 63    NumericScore,
 64    Observation,
 65    ObservationBody,
 66    ObservationLevel,
 67    ObservationType,
 68    Observations,
 69    ObservationsView,
 70    ObservationsViews,
 71    OpenAiUsage,
 72    OptionalObservationBody,
 73    PaginatedDatasetItems,
 74    PaginatedDatasetRuns,
 75    PaginatedDatasets,
 76    PaginatedModels,
 77    PaginatedSessions,
 78    Project,
 79    Projects,
 80    Prompt,
 81    PromptMeta,
 82    PromptMetaListResponse,
 83    Prompt_Chat,
 84    Prompt_Text,
 85    Score,
 86    ScoreBody,
 87    ScoreConfig,
 88    ScoreConfigs,
 89    ScoreDataType,
 90    ScoreEvent,
 91    ScoreSource,
 92    Score_Boolean,
 93    Score_Categorical,
 94    Score_Numeric,
 95    Scores,
 96    SdkLogBody,
 97    SdkLogEvent,
 98    ServiceUnavailableError,
 99    Session,
100    SessionWithTraces,
101    Sort,
102    TextPrompt,
103    Trace,
104    TraceBody,
105    TraceEvent,
106    TraceWithDetails,
107    TraceWithFullDetails,
108    Traces,
109    UnauthorizedError,
110    UpdateEventBody,
111    UpdateGenerationBody,
112    UpdateGenerationEvent,
113    UpdateObservationEvent,
114    UpdateSpanBody,
115    UpdateSpanEvent,
116    Usage,
117    UsageByModel,
118    commons,
119    dataset_items,
120    dataset_run_items,
121    datasets,
122    health,
123    ingestion,
124    metrics,
125    models,
126    observations,
127    projects,
128    prompts,
129    score,
130    score_configs,
131    sessions,
132    trace,
133    utils,
134)
135
136__all__ = [
137    "AccessDeniedError",
138    "BaseEvent",
139    "BasePrompt",
140    "BaseScore",
141    "BooleanScore",
142    "CategoricalScore",
143    "ChatMessage",
144    "ChatPrompt",
145    "ConfigCategory",
146    "CreateChatPromptRequest",
147    "CreateDatasetItemRequest",
148    "CreateDatasetRequest",
149    "CreateDatasetRunItemRequest",
150    "CreateEventBody",
151    "CreateEventEvent",
152    "CreateGenerationBody",
153    "CreateGenerationEvent",
154    "CreateModelRequest",
155    "CreateObservationEvent",
156    "CreatePromptRequest",
157    "CreatePromptRequest_Chat",
158    "CreatePromptRequest_Text",
159    "CreateScoreConfigRequest",
160    "CreateScoreRequest",
161    "CreateScoreResponse",
162    "CreateScoreValue",
163    "CreateSpanBody",
164    "CreateSpanEvent",
165    "CreateTextPromptRequest",
166    "DailyMetrics",
167    "DailyMetricsDetails",
168    "Dataset",
169    "DatasetItem",
170    "DatasetRun",
171    "DatasetRunItem",
172    "DatasetRunWithItems",
173    "DatasetStatus",
174    "Error",
175    "HealthResponse",
176    "IngestionError",
177    "IngestionEvent",
178    "IngestionEvent_EventCreate",
179    "IngestionEvent_GenerationCreate",
180    "IngestionEvent_GenerationUpdate",
181    "IngestionEvent_ObservationCreate",
182    "IngestionEvent_ObservationUpdate",
183    "IngestionEvent_ScoreCreate",
184    "IngestionEvent_SdkLog",
185    "IngestionEvent_SpanCreate",
186    "IngestionEvent_SpanUpdate",
187    "IngestionEvent_TraceCreate",
188    "IngestionResponse",
189    "IngestionSuccess",
190    "IngestionUsage",
191    "MapValue",
192    "MethodNotAllowedError",
193    "Model",
194    "ModelUsageUnit",
195    "NotFoundError",
196    "NumericScore",
197    "Observation",
198    "ObservationBody",
199    "ObservationLevel",
200    "ObservationType",
201    "Observations",
202    "ObservationsView",
203    "ObservationsViews",
204    "OpenAiUsage",
205    "OptionalObservationBody",
206    "PaginatedDatasetItems",
207    "PaginatedDatasetRuns",
208    "PaginatedDatasets",
209    "PaginatedModels",
210    "PaginatedSessions",
211    "Project",
212    "Projects",
213    "Prompt",
214    "PromptMeta",
215    "PromptMetaListResponse",
216    "Prompt_Chat",
217    "Prompt_Text",
218    "Score",
219    "ScoreBody",
220    "ScoreConfig",
221    "ScoreConfigs",
222    "ScoreDataType",
223    "ScoreEvent",
224    "ScoreSource",
225    "Score_Boolean",
226    "Score_Categorical",
227    "Score_Numeric",
228    "Scores",
229    "SdkLogBody",
230    "SdkLogEvent",
231    "ServiceUnavailableError",
232    "Session",
233    "SessionWithTraces",
234    "Sort",
235    "TextPrompt",
236    "Trace",
237    "TraceBody",
238    "TraceEvent",
239    "TraceWithDetails",
240    "TraceWithFullDetails",
241    "Traces",
242    "UnauthorizedError",
243    "UpdateEventBody",
244    "UpdateGenerationBody",
245    "UpdateGenerationEvent",
246    "UpdateObservationEvent",
247    "UpdateSpanBody",
248    "UpdateSpanEvent",
249    "Usage",
250    "UsageByModel",
251    "commons",
252    "dataset_items",
253    "dataset_run_items",
254    "datasets",
255    "health",
256    "ingestion",
257    "metrics",
258    "models",
259    "observations",
260    "projects",
261    "prompts",
262    "score",
263    "score_configs",
264    "sessions",
265    "trace",
266    "utils",
267]
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 = {
29            "by_alias": True,
30            "exclude_unset": True,
31            **kwargs,
32        }
33        return super().json(**kwargs_with_defaults)
34
35    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
36        kwargs_with_defaults: typing.Any = {
37            "by_alias": True,
38            "exclude_unset": True,
39            **kwargs,
40        }
41        return super().dict(**kwargs_with_defaults)
42
43    class Config:
44        frozen = True
45        smart_union = True
46        extra = pydantic_v1.Extra.allow
47        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 = {
29            "by_alias": True,
30            "exclude_unset": True,
31            **kwargs,
32        }
33        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]:
35    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
36        kwargs_with_defaults: typing.Any = {
37            "by_alias": True,
38            "exclude_unset": True,
39            **kwargs,
40        }
41        return super().dict(**kwargs_with_defaults)

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:
43    class Config:
44        frozen = True
45        smart_union = True
46        extra = pydantic_v1.Extra.allow
47        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 = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().json(**kwargs_with_defaults)
32
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults: typing.Any = {
35            "by_alias": True,
36            "exclude_unset": True,
37            **kwargs,
38        }
39        return super().dict(**kwargs_with_defaults)
40
41    class Config:
42        frozen = True
43        smart_union = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
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: typing.Any = {
35            "by_alias": True,
36            "exclude_unset": True,
37            **kwargs,
38        }
39        return super().dict(**kwargs_with_defaults)

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:
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 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    def json(self, **kwargs: typing.Any) -> str:
33        kwargs_with_defaults: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
38        return super().json(**kwargs_with_defaults)
39
40    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
41        kwargs_with_defaults: typing.Any = {
42            "by_alias": True,
43            "exclude_unset": True,
44            **kwargs,
45        }
46        return super().dict(**kwargs_with_defaults)
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: 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

def json(self, **kwargs: Any) -> str:
32    def json(self, **kwargs: typing.Any) -> str:
33        kwargs_with_defaults: typing.Any = {
34            "by_alias": True,
35            "exclude_unset": True,
36            **kwargs,
37        }
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: typing.Any = {
42            "by_alias": True,
43            "exclude_unset": True,
44            **kwargs,
45        }
46        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().json(**kwargs_with_defaults)
30
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)
38
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
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: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)

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
class BooleanScore.Config:
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().json(**kwargs_with_defaults)
30
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)
38
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
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: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)

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
class CategoricalScore.Config:
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
prompt: List[ChatMessage]
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().json(**kwargs_with_defaults)
33
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().dict(**kwargs_with_defaults)
41
42    class Config:
43        frozen = True
44        smart_union = True
45        extra = pydantic_v1.Extra.allow
46        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 = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
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: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().dict(**kwargs_with_defaults)

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:
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(
16        alias="expectedOutput", default=None
17    )
18    metadata: typing.Optional[typing.Any] = None
19    source_trace_id: typing.Optional[str] = pydantic_v1.Field(
20        alias="sourceTraceId", default=None
21    )
22    source_observation_id: typing.Optional[str] = pydantic_v1.Field(
23        alias="sourceObservationId", default=None
24    )
25    id: typing.Optional[str] = pydantic_v1.Field(default=None)
26    """
27    Dataset items are upserted on their id. Id needs to be globally unique and cannot be reused across datasets.
28    """
29
30    status: typing.Optional[DatasetStatus] = pydantic_v1.Field(default=None)
31    """
32    Defaults to ACTIVE for newly created items
33    """
34
35    def json(self, **kwargs: typing.Any) -> str:
36        kwargs_with_defaults: typing.Any = {
37            "by_alias": True,
38            "exclude_unset": True,
39            **kwargs,
40        }
41        return super().json(**kwargs_with_defaults)
42
43    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
44        kwargs_with_defaults: typing.Any = {
45            "by_alias": True,
46            "exclude_unset": True,
47            **kwargs,
48        }
49        return super().dict(**kwargs_with_defaults)
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}
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 globally unique and cannot be reused across datasets.

status: Optional[DatasetStatus]

Defaults to ACTIVE for newly created items

def json(self, **kwargs: Any) -> str:
35    def json(self, **kwargs: typing.Any) -> str:
36        kwargs_with_defaults: typing.Any = {
37            "by_alias": True,
38            "exclude_unset": True,
39            **kwargs,
40        }
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: typing.Any = {
45            "by_alias": True,
46            "exclude_unset": True,
47            **kwargs,
48        }
49        return super().dict(**kwargs_with_defaults)

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:
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>}
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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
31
32    class Config:
33        frozen = True
34        smart_union = True
35        extra = pydantic_v1.Extra.allow
36        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
32    class Config:
33        frozen = True
34        smart_union = True
35        extra = pydantic_v1.Extra.allow
36        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(
14        alias="runDescription", default=None
15    )
16    """
17    Description of the run. If run exists, description will be updated.
18    """
19
20    metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None)
21    """
22    Metadata of the dataset run, updates run if run already exists
23    """
24
25    dataset_item_id: str = pydantic_v1.Field(alias="datasetItemId")
26    observation_id: typing.Optional[str] = pydantic_v1.Field(
27        alias="observationId", default=None
28    )
29    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
30    """
31    traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
32    """
33
34    def json(self, **kwargs: typing.Any) -> str:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().json(**kwargs_with_defaults)
41
42    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
43        kwargs_with_defaults: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().dict(**kwargs_with_defaults)
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}
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:
34    def json(self, **kwargs: typing.Any) -> str:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
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: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 CreateGenerationBody(langfuse.api.CreateSpanBody):
14class CreateGenerationBody(CreateSpanBody):
15    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
16        alias="completionStartTime", default=None
17    )
18    model: typing.Optional[str] = None
19    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
20        alias="modelParameters", default=None
21    )
22    usage: typing.Optional[IngestionUsage] = None
23    prompt_name: typing.Optional[str] = pydantic_v1.Field(
24        alias="promptName", default=None
25    )
26    prompt_version: typing.Optional[int] = pydantic_v1.Field(
27        alias="promptVersion", default=None
28    )
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        return super().json(**kwargs_with_defaults)
37
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)
45
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        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]:
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)

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:
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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.date] = 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: typing.Any = {
80            "by_alias": True,
81            "exclude_unset": True,
82            **kwargs,
83        }
84        return super().dict(**kwargs_with_defaults)
85
86    class Config:
87        frozen = True
88        smart_union = True
89        allow_population_by_field_name = True
90        populate_by_name = True
91        extra = pydantic_v1.Extra.allow
92        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.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 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: typing.Any = {
80            "by_alias": True,
81            "exclude_unset": True,
82            **kwargs,
83        }
84        return super().dict(**kwargs_with_defaults)

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:
86    class Config:
87        frozen = True
88        smart_union = True
89        allow_population_by_field_name = True
90        populate_by_name = True
91        extra = pydantic_v1.Extra.allow
92        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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>}
CreatePromptRequest = typing.Union[CreatePromptRequest_Chat, CreatePromptRequest_Text]
class CreatePromptRequest_Chat(langfuse.api.CreateChatPromptRequest):
12class CreatePromptRequest_Chat(CreateChatPromptRequest):
13    type: typing.Literal["chat"] = "chat"
14
15    class Config:
16        frozen = True
17        smart_union = True
18        allow_population_by_field_name = True
19        populate_by_name = True
type: Literal['chat']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateChatPromptRequest
name
prompt
config
labels
tags
json
dict
class CreatePromptRequest_Chat.Config:
15    class Config:
16        frozen = True
17        smart_union = True
18        allow_population_by_field_name = True
19        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class CreatePromptRequest_Text(langfuse.api.CreateTextPromptRequest):
22class CreatePromptRequest_Text(CreateTextPromptRequest):
23    type: typing.Literal["text"] = "text"
24
25    class Config:
26        frozen = True
27        smart_union = True
28        allow_population_by_field_name = True
29        populate_by_name = True
type: Literal['text']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateTextPromptRequest
name
prompt
config
labels
tags
json
dict
class CreatePromptRequest_Text.Config:
25    class Config:
26        frozen = True
27        smart_union = True
28        allow_population_by_field_name = True
29        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
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(
17        default=None
18    )
19    """
20    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
21    """
22
23    min_value: typing.Optional[float] = pydantic_v1.Field(
24        alias="minValue", default=None
25    )
26    """
27    Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
28    """
29
30    max_value: typing.Optional[float] = pydantic_v1.Field(
31        alias="maxValue", default=None
32    )
33    """
34    Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
35    """
36
37    description: typing.Optional[str] = pydantic_v1.Field(default=None)
38    """
39    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
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: typing.Any = {
52            "by_alias": True,
53            "exclude_unset": True,
54            **kwargs,
55        }
56        return super().dict(**kwargs_with_defaults)
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}
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:
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: typing.Any = {
52            "by_alias": True,
53            "exclude_unset": True,
54            **kwargs,
55        }
56        return super().dict(**kwargs_with_defaults)

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:
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 CreateScoreRequest(pydantic.v1.main.BaseModel):
13class CreateScoreRequest(pydantic_v1.BaseModel):
14    """
15    from finto import CreateScoreRequest
16
17    CreateScoreRequest(
18        name="novelty",
19        value=0.9,
20        trace_id="cdef-1234-5678-90ab",
21    )
22    """
23
24    id: typing.Optional[str] = None
25    trace_id: str = pydantic_v1.Field(alias="traceId")
26    name: str
27    value: CreateScoreValue = pydantic_v1.Field()
28    """
29    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)
30    """
31
32    observation_id: typing.Optional[str] = pydantic_v1.Field(
33        alias="observationId", default=None
34    )
35    comment: typing.Optional[str] = None
36    data_type: typing.Optional[ScoreDataType] = pydantic_v1.Field(
37        alias="dataType", default=None
38    )
39    """
40    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.
41    """
42
43    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
44    """
45    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.
46    """
47
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
54        return super().json(**kwargs_with_defaults)
55
56    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
57        kwargs_with_defaults: typing.Any = {
58            "by_alias": True,
59            "exclude_unset": True,
60            **kwargs,
61        }
62        return super().dict(**kwargs_with_defaults)
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}

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:
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
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: typing.Any = {
58            "by_alias": True,
59            "exclude_unset": True,
60            **kwargs,
61        }
62        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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>}
CreateScoreValue = typing.Union[float, str]
class CreateSpanBody(langfuse.api.CreateEventBody):
12class CreateSpanBody(CreateEventBody):
13    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
14        alias="endTime", default=None
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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}
end_time: Optional[datetime.datetime]
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().json(**kwargs_with_defaults)
32
33    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
34        kwargs_with_defaults: typing.Any = {
35            "by_alias": True,
36            "exclude_unset": True,
37            **kwargs,
38        }
39        return super().dict(**kwargs_with_defaults)
40
41    class Config:
42        frozen = True
43        smart_union = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
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: typing.Any = {
35            "by_alias": True,
36            "exclude_unset": True,
37            **kwargs,
38        }
39        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
23            "by_alias": True,
24            "exclude_unset": True,
25            **kwargs,
26        }
27        return super().json(**kwargs_with_defaults)
28
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults: typing.Any = {
31            "by_alias": True,
32            "exclude_unset": True,
33            **kwargs,
34        }
35        return super().dict(**kwargs_with_defaults)
36
37    class Config:
38        frozen = True
39        smart_union = True
40        extra = pydantic_v1.Extra.allow
41        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 = {
23            "by_alias": True,
24            "exclude_unset": True,
25            **kwargs,
26        }
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: typing.Any = {
31            "by_alias": True,
32            "exclude_unset": True,
33            **kwargs,
34        }
35        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().json(**kwargs_with_defaults)
30
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)
38
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
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: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)

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:
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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 = {
22            "by_alias": True,
23            "exclude_unset": True,
24            **kwargs,
25        }
26        return super().json(**kwargs_with_defaults)
27
28    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29        kwargs_with_defaults: typing.Any = {
30            "by_alias": True,
31            "exclude_unset": True,
32            **kwargs,
33        }
34        return super().dict(**kwargs_with_defaults)
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}
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 = {
22            "by_alias": True,
23            "exclude_unset": True,
24            **kwargs,
25        }
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: typing.Any = {
30            "by_alias": True,
31            "exclude_unset": True,
32            **kwargs,
33        }
34        return super().dict(**kwargs_with_defaults)

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:
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 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(
17        alias="expectedOutput", default=None
18    )
19    metadata: typing.Optional[typing.Any] = None
20    source_trace_id: typing.Optional[str] = pydantic_v1.Field(
21        alias="sourceTraceId", default=None
22    )
23    source_observation_id: typing.Optional[str] = pydantic_v1.Field(
24        alias="sourceObservationId", default=None
25    )
26    dataset_id: str = pydantic_v1.Field(alias="datasetId")
27    dataset_name: str = pydantic_v1.Field(alias="datasetName")
28    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
29    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
30
31    def json(self, **kwargs: typing.Any) -> str:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().json(**kwargs_with_defaults)
38
39    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
40        kwargs_with_defaults: typing.Any = {
41            "by_alias": True,
42            "exclude_unset": True,
43            **kwargs,
44        }
45        return super().dict(**kwargs_with_defaults)
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}
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:
31    def json(self, **kwargs: typing.Any) -> str:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        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]:
39    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
40        kwargs_with_defaults: typing.Any = {
41            "by_alias": True,
42            "exclude_unset": True,
43            **kwargs,
44        }
45        return super().dict(**kwargs_with_defaults)

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:
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 DatasetRun(pydantic.v1.main.BaseModel):
11class DatasetRun(pydantic_v1.BaseModel):
12    id: str
13    name: str
14    description: typing.Optional[str] = None
15    metadata: typing.Optional[typing.Any] = None
16    dataset_id: str = pydantic_v1.Field(alias="datasetId")
17    dataset_name: str = pydantic_v1.Field(alias="datasetName")
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 = {
23            "by_alias": True,
24            "exclude_unset": True,
25            **kwargs,
26        }
27        return super().json(**kwargs_with_defaults)
28
29    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30        kwargs_with_defaults: typing.Any = {
31            "by_alias": True,
32            "exclude_unset": True,
33            **kwargs,
34        }
35        return super().dict(**kwargs_with_defaults)
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
name: str
description: Optional[str]
metadata: Optional[Any]
dataset_id: str
dataset_name: 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 = {
23            "by_alias": True,
24            "exclude_unset": True,
25            **kwargs,
26        }
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: typing.Any = {
31            "by_alias": True,
32            "exclude_unset": True,
33            **kwargs,
34        }
35        return super().dict(**kwargs_with_defaults)

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:
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 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(
18        alias="observationId", default=None
19    )
20    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
21    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
22
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().json(**kwargs_with_defaults)
30
31    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32        kwargs_with_defaults: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)
38
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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:
23    def json(self, **kwargs: typing.Any) -> str:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
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: typing.Any = {
33            "by_alias": True,
34            "exclude_unset": True,
35            **kwargs,
36        }
37        return super().dict(**kwargs_with_defaults)

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:
39    class Config:
40        frozen = True
41        smart_union = True
42        allow_population_by_field_name = True
43        populate_by_name = True
44        extra = pydantic_v1.Extra.allow
45        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(
15        alias="datasetRunItems"
16    )
17
18    def json(self, **kwargs: typing.Any) -> str:
19        kwargs_with_defaults: typing.Any = {
20            "by_alias": True,
21            "exclude_unset": True,
22            **kwargs,
23        }
24        return super().json(**kwargs_with_defaults)
25
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().dict(**kwargs_with_defaults)
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}
dataset_run_items: List[DatasetRunItem]
def json(self, **kwargs: Any) -> str:
18    def json(self, **kwargs: typing.Any) -> str:
19        kwargs_with_defaults: typing.Any = {
20            "by_alias": True,
21            "exclude_unset": True,
22            **kwargs,
23        }
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: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().dict(**kwargs_with_defaults)

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:
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 DatasetStatus(builtins.str, enum.Enum):
10class DatasetStatus(str, enum.Enum):
11    ACTIVE = "ACTIVE"
12    ARCHIVED = "ARCHIVED"
13
14    def visit(
15        self,
16        active: typing.Callable[[], T_Result],
17        archived: typing.Callable[[], T_Result],
18    ) -> T_Result:
19        if self is DatasetStatus.ACTIVE:
20            return active()
21        if self is DatasetStatus.ARCHIVED:
22            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(
15        self,
16        active: typing.Callable[[], T_Result],
17        archived: typing.Callable[[], T_Result],
18    ) -> T_Result:
19        if self is DatasetStatus.ACTIVE:
20            return active()
21        if self is DatasetStatus.ARCHIVED:
22            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 HealthResponse(pydantic.v1.main.BaseModel):
11class HealthResponse(pydantic_v1.BaseModel):
12    """
13    from finto import HealthResponse
14
15    HealthResponse(
16        version="1.25.0",
17        status="OK",
18    )
19    """
20
21    version: str = pydantic_v1.Field()
22    """
23    Langfuse server version
24    """
25
26    status: str
27
28    def json(self, **kwargs: typing.Any) -> str:
29        kwargs_with_defaults: typing.Any = {
30            "by_alias": True,
31            "exclude_unset": True,
32            **kwargs,
33        }
34        return super().json(**kwargs_with_defaults)
35
36    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().dict(**kwargs_with_defaults)
43
44    class Config:
45        frozen = True
46        smart_union = True
47        extra = pydantic_v1.Extra.allow
48        json_encoders = {dt.datetime: serialize_datetime}

from finto import HealthResponse

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

version: str

Langfuse server version

status: str
def json(self, **kwargs: Any) -> str:
28    def json(self, **kwargs: typing.Any) -> str:
29        kwargs_with_defaults: typing.Any = {
30            "by_alias": True,
31            "exclude_unset": True,
32            **kwargs,
33        }
34        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]:
36    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
37        kwargs_with_defaults: typing.Any = {
38            "by_alias": True,
39            "exclude_unset": True,
40            **kwargs,
41        }
42        return super().dict(**kwargs_with_defaults)

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:
44    class Config:
45        frozen = True
46        smart_union = True
47        extra = pydantic_v1.Extra.allow
48        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 IngestionEvent_EventCreate(langfuse.api.CreateEventEvent):
80class IngestionEvent_EventCreate(CreateEventEvent):
81    type: typing.Literal["event-create"] = "event-create"
82
83    class Config:
84        frozen = True
85        smart_union = True
86        allow_population_by_field_name = True
87        populate_by_name = True
type: Literal['event-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateEventEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_EventCreate.Config:
83    class Config:
84        frozen = True
85        smart_union = True
86        allow_population_by_field_name = True
87        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_GenerationCreate(langfuse.api.CreateGenerationEvent):
60class IngestionEvent_GenerationCreate(CreateGenerationEvent):
61    type: typing.Literal["generation-create"] = "generation-create"
62
63    class Config:
64        frozen = True
65        smart_union = True
66        allow_population_by_field_name = True
67        populate_by_name = True
type: Literal['generation-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateGenerationEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_GenerationCreate.Config:
63    class Config:
64        frozen = True
65        smart_union = True
66        allow_population_by_field_name = True
67        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_GenerationUpdate(langfuse.api.UpdateGenerationEvent):
70class IngestionEvent_GenerationUpdate(UpdateGenerationEvent):
71    type: typing.Literal["generation-update"] = "generation-update"
72
73    class Config:
74        frozen = True
75        smart_union = True
76        allow_population_by_field_name = True
77        populate_by_name = True
type: Literal['generation-update']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
UpdateGenerationEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_GenerationUpdate.Config:
73    class Config:
74        frozen = True
75        smart_union = True
76        allow_population_by_field_name = True
77        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_ObservationCreate(langfuse.api.CreateObservationEvent):
100class IngestionEvent_ObservationCreate(CreateObservationEvent):
101    type: typing.Literal["observation-create"] = "observation-create"
102
103    class Config:
104        frozen = True
105        smart_union = True
106        allow_population_by_field_name = True
107        populate_by_name = True
type: Literal['observation-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateObservationEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_ObservationCreate.Config:
103    class Config:
104        frozen = True
105        smart_union = True
106        allow_population_by_field_name = True
107        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_ObservationUpdate(langfuse.api.UpdateObservationEvent):
110class IngestionEvent_ObservationUpdate(UpdateObservationEvent):
111    type: typing.Literal["observation-update"] = "observation-update"
112
113    class Config:
114        frozen = True
115        smart_union = True
116        allow_population_by_field_name = True
117        populate_by_name = True
type: Literal['observation-update']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
UpdateObservationEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_ObservationUpdate.Config:
113    class Config:
114        frozen = True
115        smart_union = True
116        allow_population_by_field_name = True
117        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_ScoreCreate(langfuse.api.ScoreEvent):
30class IngestionEvent_ScoreCreate(ScoreEvent):
31    type: typing.Literal["score-create"] = "score-create"
32
33    class Config:
34        frozen = True
35        smart_union = True
36        allow_population_by_field_name = True
37        populate_by_name = True
type: Literal['score-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
ScoreEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_ScoreCreate.Config:
33    class Config:
34        frozen = True
35        smart_union = True
36        allow_population_by_field_name = True
37        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_SdkLog(langfuse.api.SdkLogEvent):
90class IngestionEvent_SdkLog(SdkLogEvent):
91    type: typing.Literal["sdk-log"] = "sdk-log"
92
93    class Config:
94        frozen = True
95        smart_union = True
96        allow_population_by_field_name = True
97        populate_by_name = True
type: Literal['sdk-log']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
SdkLogEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_SdkLog.Config:
93    class Config:
94        frozen = True
95        smart_union = True
96        allow_population_by_field_name = True
97        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_SpanCreate(langfuse.api.CreateSpanEvent):
40class IngestionEvent_SpanCreate(CreateSpanEvent):
41    type: typing.Literal["span-create"] = "span-create"
42
43    class Config:
44        frozen = True
45        smart_union = True
46        allow_population_by_field_name = True
47        populate_by_name = True
type: Literal['span-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
CreateSpanEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_SpanCreate.Config:
43    class Config:
44        frozen = True
45        smart_union = True
46        allow_population_by_field_name = True
47        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_SpanUpdate(langfuse.api.UpdateSpanEvent):
50class IngestionEvent_SpanUpdate(UpdateSpanEvent):
51    type: typing.Literal["span-update"] = "span-update"
52
53    class Config:
54        frozen = True
55        smart_union = True
56        allow_population_by_field_name = True
57        populate_by_name = True
type: Literal['span-update']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
UpdateSpanEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_SpanUpdate.Config:
53    class Config:
54        frozen = True
55        smart_union = True
56        allow_population_by_field_name = True
57        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class IngestionEvent_TraceCreate(langfuse.api.TraceEvent):
20class IngestionEvent_TraceCreate(TraceEvent):
21    type: typing.Literal["trace-create"] = "trace-create"
22
23    class Config:
24        frozen = True
25        smart_union = True
26        allow_population_by_field_name = True
27        populate_by_name = True
type: Literal['trace-create']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
TraceEvent
body
json
dict
BaseEvent
id
timestamp
metadata
class IngestionEvent_TraceCreate.Config:
23    class Config:
24        frozen = True
25        smart_union = True
26        allow_population_by_field_name = True
27        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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]]
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: typing.Any = {
87            "by_alias": True,
88            "exclude_unset": True,
89            **kwargs,
90        }
91        return super().dict(**kwargs_with_defaults)
92
93    class Config:
94        frozen = True
95        smart_union = True
96        allow_population_by_field_name = True
97        populate_by_name = True
98        extra = pydantic_v1.Extra.allow
99        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: typing.Any = {
87            "by_alias": True,
88            "exclude_unset": True,
89            **kwargs,
90        }
91        return super().dict(**kwargs_with_defaults)

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:
93    class Config:
94        frozen = True
95        smart_union = True
96        allow_population_by_field_name = True
97        populate_by_name = True
98        extra = pydantic_v1.Extra.allow
99        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 = {
20            "by_alias": True,
21            "exclude_unset": True,
22            **kwargs,
23        }
24        return super().json(**kwargs_with_defaults)
25
26    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27        kwargs_with_defaults: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().dict(**kwargs_with_defaults)
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}
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 = {
20            "by_alias": True,
21            "exclude_unset": True,
22            **kwargs,
23        }
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: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().dict(**kwargs_with_defaults)

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
class NumericScore.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 Observation(pydantic.v1.main.BaseModel):
14class Observation(pydantic_v1.BaseModel):
15    id: str
16    trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
17    type: str
18    name: typing.Optional[str] = None
19    start_time: dt.datetime = pydantic_v1.Field(alias="startTime")
20    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
21        alias="endTime", default=None
22    )
23    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
24        alias="completionStartTime", default=None
25    )
26    model: typing.Optional[str] = None
27    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
28        alias="modelParameters", default=None
29    )
30    input: typing.Optional[typing.Any] = None
31    version: typing.Optional[str] = None
32    metadata: typing.Optional[typing.Any] = None
33    output: typing.Optional[typing.Any] = None
34    usage: typing.Optional[Usage] = None
35    level: ObservationLevel
36    status_message: typing.Optional[str] = pydantic_v1.Field(
37        alias="statusMessage", default=None
38    )
39    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(
40        alias="parentObservationId", default=None
41    )
42    prompt_id: typing.Optional[str] = pydantic_v1.Field(alias="promptId", default=None)
43
44    def json(self, **kwargs: typing.Any) -> str:
45        kwargs_with_defaults: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
50        return super().json(**kwargs_with_defaults)
51
52    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
53        kwargs_with_defaults: typing.Any = {
54            "by_alias": True,
55            "exclude_unset": True,
56            **kwargs,
57        }
58        return super().dict(**kwargs_with_defaults)
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}
id: str
trace_id: Optional[str]
type: str
name: Optional[str]
start_time: 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]
status_message: Optional[str]
parent_observation_id: Optional[str]
prompt_id: Optional[str]
def json(self, **kwargs: Any) -> str:
44    def json(self, **kwargs: typing.Any) -> str:
45        kwargs_with_defaults: typing.Any = {
46            "by_alias": True,
47            "exclude_unset": True,
48            **kwargs,
49        }
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: typing.Any = {
54            "by_alias": True,
55            "exclude_unset": True,
56            **kwargs,
57        }
58        return super().dict(**kwargs_with_defaults)

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:
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 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(
21        alias="startTime", default=None
22    )
23    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
24        alias="endTime", default=None
25    )
26    completion_start_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
27        alias="completionStartTime", default=None
28    )
29    model: typing.Optional[str] = None
30    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
31        alias="modelParameters", default=None
32    )
33    input: typing.Optional[typing.Any] = None
34    version: typing.Optional[str] = None
35    metadata: typing.Optional[typing.Any] = None
36    output: typing.Optional[typing.Any] = None
37    usage: typing.Optional[Usage] = None
38    level: typing.Optional[ObservationLevel] = None
39    status_message: typing.Optional[str] = pydantic_v1.Field(
40        alias="statusMessage", default=None
41    )
42    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(
43        alias="parentObservationId", default=None
44    )
45
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        return super().json(**kwargs_with_defaults)
53
54    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
55        kwargs_with_defaults: typing.Any = {
56            "by_alias": True,
57            "exclude_unset": True,
58            **kwargs,
59        }
60        return super().dict(**kwargs_with_defaults)
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: 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:
46    def json(self, **kwargs: typing.Any) -> str:
47        kwargs_with_defaults: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        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]:
54    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
55        kwargs_with_defaults: typing.Any = {
56            "by_alias": True,
57            "exclude_unset": True,
58            **kwargs,
59        }
60        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 ObservationsView(langfuse.api.Observation):
12class ObservationsView(Observation):
13    model_id: typing.Optional[str] = pydantic_v1.Field(alias="modelId", default=None)
14    input_price: typing.Optional[float] = pydantic_v1.Field(
15        alias="inputPrice", default=None
16    )
17    output_price: typing.Optional[float] = pydantic_v1.Field(
18        alias="outputPrice", default=None
19    )
20    total_price: typing.Optional[float] = pydantic_v1.Field(
21        alias="totalPrice", default=None
22    )
23    calculated_input_cost: typing.Optional[float] = pydantic_v1.Field(
24        alias="calculatedInputCost", default=None
25    )
26    calculated_output_cost: typing.Optional[float] = pydantic_v1.Field(
27        alias="calculatedOutputCost", default=None
28    )
29    calculated_total_cost: typing.Optional[float] = pydantic_v1.Field(
30        alias="calculatedTotalCost", default=None
31    )
32    latency: typing.Optional[float] = None
33    time_to_first_token: typing.Optional[float] = pydantic_v1.Field(
34        alias="timeToFirstToken", default=None
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: typing.Any = {
47            "by_alias": True,
48            "exclude_unset": True,
49            **kwargs,
50        }
51        return super().dict(**kwargs_with_defaults)
52
53    class Config:
54        frozen = True
55        smart_union = True
56        allow_population_by_field_name = True
57        populate_by_name = True
58        extra = pydantic_v1.Extra.allow
59        json_encoders = {dt.datetime: serialize_datetime}
model_id: Optional[str]
input_price: Optional[float]
output_price: Optional[float]
total_price: Optional[float]
calculated_input_cost: Optional[float]
calculated_output_cost: Optional[float]
calculated_total_cost: Optional[float]
latency: Optional[float]
time_to_first_token: Optional[float]
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: typing.Any = {
47            "by_alias": True,
48            "exclude_unset": True,
49            **kwargs,
50        }
51        return super().dict(**kwargs_with_defaults)

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:
53    class Config:
54        frozen = True
55        smart_union = True
56        allow_population_by_field_name = True
57        populate_by_name = True
58        extra = pydantic_v1.Extra.allow
59        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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(
17        alias="promptTokens", default=None
18    )
19    completion_tokens: typing.Optional[int] = pydantic_v1.Field(
20        alias="completionTokens", default=None
21    )
22    total_tokens: typing.Optional[int] = pydantic_v1.Field(
23        alias="totalTokens", default=None
24    )
25
26    def json(self, **kwargs: typing.Any) -> str:
27        kwargs_with_defaults: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
32        return super().json(**kwargs_with_defaults)
33
34    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().dict(**kwargs_with_defaults)
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}

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:
26    def json(self, **kwargs: typing.Any) -> str:
27        kwargs_with_defaults: typing.Any = {
28            "by_alias": True,
29            "exclude_unset": True,
30            **kwargs,
31        }
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: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().dict(**kwargs_with_defaults)

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:
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 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(
16        alias="startTime", default=None
17    )
18    metadata: typing.Optional[typing.Any] = None
19    input: typing.Optional[typing.Any] = None
20    output: typing.Optional[typing.Any] = None
21    level: typing.Optional[ObservationLevel] = None
22    status_message: typing.Optional[str] = pydantic_v1.Field(
23        alias="statusMessage", default=None
24    )
25    parent_observation_id: typing.Optional[str] = pydantic_v1.Field(
26        alias="parentObservationId", default=None
27    )
28    version: typing.Optional[str] = None
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        return super().json(**kwargs_with_defaults)
37
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)
45
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        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]:
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)

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:
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        extra = pydantic_v1.Extra.allow
35        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
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        json_encoders = {dt.datetime: serialize_datetime}
name: str
versions: List[int]
labels: List[str]
tags: List[str]
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 Prompt_Chat(langfuse.api.ChatPrompt):
12class Prompt_Chat(ChatPrompt):
13    type: typing.Literal["chat"] = "chat"
14
15    class Config:
16        frozen = True
17        smart_union = True
18        allow_population_by_field_name = True
19        populate_by_name = True
type: Literal['chat']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
ChatPrompt
prompt
json
dict
BasePrompt
name
version
config
labels
tags
class Prompt_Chat.Config:
15    class Config:
16        frozen = True
17        smart_union = True
18        allow_population_by_field_name = True
19        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class Prompt_Text(langfuse.api.TextPrompt):
22class Prompt_Text(TextPrompt):
23    type: typing.Literal["text"] = "text"
24
25    class Config:
26        frozen = True
27        smart_union = True
28        allow_population_by_field_name = True
29        populate_by_name = True
type: Literal['text']
Inherited Members
pydantic.v1.main.BaseModel
BaseModel
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
TextPrompt
prompt
json
dict
BasePrompt
name
version
config
labels
tags
class Prompt_Text.Config:
25    class Config:
26        frozen = True
27        smart_union = True
28        allow_population_by_field_name = True
29        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class ScoreBody(pydantic.v1.main.BaseModel):
13class ScoreBody(pydantic_v1.BaseModel):
14    """
15    from finto import ScoreBody
16
17    ScoreBody(
18        name="novelty",
19        value=0.9,
20        trace_id="cdef-1234-5678-90ab",
21    )
22    """
23
24    id: typing.Optional[str] = None
25    trace_id: str = pydantic_v1.Field(alias="traceId")
26    name: str
27    value: CreateScoreValue = pydantic_v1.Field()
28    """
29    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)
30    """
31
32    observation_id: typing.Optional[str] = pydantic_v1.Field(
33        alias="observationId", default=None
34    )
35    comment: typing.Optional[str] = None
36    data_type: typing.Optional[ScoreDataType] = pydantic_v1.Field(
37        alias="dataType", default=None
38    )
39    """
40    When set, must match the score value's type. If not set, will be inferred from the score value or config
41    """
42
43    config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
44    """
45    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
46    """
47
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
54        return super().json(**kwargs_with_defaults)
55
56    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
57        kwargs_with_defaults: typing.Any = {
58            "by_alias": True,
59            "exclude_unset": True,
60            **kwargs,
61        }
62        return super().dict(**kwargs_with_defaults)
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}

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:
48    def json(self, **kwargs: typing.Any) -> str:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
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: typing.Any = {
58            "by_alias": True,
59            "exclude_unset": True,
60            **kwargs,
61        }
62        return super().dict(**kwargs_with_defaults)

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:
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 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(
30        alias="minValue", default=None
31    )
32    """
33    Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞
34    """
35
36    max_value: typing.Optional[float] = pydantic_v1.Field(
37        alias="maxValue", default=None
38    )
39    """
40    Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞
41    """
42
43    categories: typing.Optional[typing.List[ConfigCategory]] = pydantic_v1.Field(
44        default=None
45    )
46    """
47    Configures custom categories for categorical scores
48    """
49
50    description: typing.Optional[str] = None
51
52    def json(self, **kwargs: typing.Any) -> str:
53        kwargs_with_defaults: typing.Any = {
54            "by_alias": True,
55            "exclude_unset": True,
56            **kwargs,
57        }
58        return super().json(**kwargs_with_defaults)
59
60    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
61        kwargs_with_defaults: typing.Any = {
62            "by_alias": True,
63            "exclude_unset": True,
64            **kwargs,
65        }
66        return super().dict(**kwargs_with_defaults)
67
68    class Config:
69        frozen = True
70        smart_union = True
71        allow_population_by_field_name = True
72        populate_by_name = True
73        extra = pydantic_v1.Extra.allow
74        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:
52    def json(self, **kwargs: typing.Any) -> str:
53        kwargs_with_defaults: typing.Any = {
54            "by_alias": True,
55            "exclude_unset": True,
56            **kwargs,
57        }
58        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]:
60    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
61        kwargs_with_defaults: typing.Any = {
62            "by_alias": True,
63            "exclude_unset": True,
64            **kwargs,
65        }
66        return super().dict(**kwargs_with_defaults)

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:
68    class Config:
69        frozen = True
70        smart_union = True
71        allow_population_by_field_name = True
72        populate_by_name = True
73        extra = pydantic_v1.Extra.allow
74        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
body: ScoreBody
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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(langfuse.api.BooleanScore):
38class Score_Boolean(BooleanScore):
39    data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field(
40        alias="dataType", default="BOOLEAN"
41    )
42
43    class Config:
44        frozen = True
45        smart_union = True
46        allow_population_by_field_name = True
47        populate_by_name = True
data_type: Literal['BOOLEAN']
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
json
dict
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
class Score_Boolean.Config:
43    class Config:
44        frozen = True
45        smart_union = True
46        allow_population_by_field_name = True
47        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class Score_Categorical(langfuse.api.CategoricalScore):
26class Score_Categorical(CategoricalScore):
27    data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field(
28        alias="dataType", default="CATEGORICAL"
29    )
30
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
data_type: Literal['CATEGORICAL']
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
json
dict
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
class Score_Categorical.Config:
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class Score_Numeric(langfuse.api.NumericScore):
14class Score_Numeric(NumericScore):
15    data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field(
16        alias="dataType", default="NUMERIC"
17    )
18
19    class Config:
20        frozen = True
21        smart_union = True
22        allow_population_by_field_name = True
23        populate_by_name = True
data_type: Literal['NUMERIC']
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
json
dict
BaseScore
id
trace_id
name
source
observation_id
timestamp
created_at
updated_at
author_user_id
comment
config_id
class Score_Numeric.Config:
19    class Config:
20        frozen = True
21        smart_union = True
22        allow_population_by_field_name = True
23        populate_by_name = True
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
class Scores(pydantic.v1.main.BaseModel):
13class Scores(pydantic_v1.BaseModel):
14    data: typing.List[Score]
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
32
33    class Config:
34        frozen = True
35        smart_union = True
36        extra = pydantic_v1.Extra.allow
37        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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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 Scores.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 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 = {
16            "by_alias": True,
17            "exclude_unset": True,
18            **kwargs,
19        }
20        return super().json(**kwargs_with_defaults)
21
22    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23        kwargs_with_defaults: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().dict(**kwargs_with_defaults)
29
30    class Config:
31        frozen = True
32        smart_union = True
33        extra = pydantic_v1.Extra.allow
34        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 = {
16            "by_alias": True,
17            "exclude_unset": True,
18            **kwargs,
19        }
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: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().dict(**kwargs_with_defaults)

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:
30    class Config:
31        frozen = True
32        smart_union = True
33        extra = pydantic_v1.Extra.allow
34        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
body: SdkLogBody
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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
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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
traces: List[Trace]
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
16            "by_alias": True,
17            "exclude_unset": True,
18            **kwargs,
19        }
20        return super().json(**kwargs_with_defaults)
21
22    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23        kwargs_with_defaults: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().dict(**kwargs_with_defaults)
29
30    class Config:
31        frozen = True
32        smart_union = True
33        extra = pydantic_v1.Extra.allow
34        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 = {
16            "by_alias": True,
17            "exclude_unset": True,
18            **kwargs,
19        }
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: typing.Any = {
24            "by_alias": True,
25            "exclude_unset": True,
26            **kwargs,
27        }
28        return super().dict(**kwargs_with_defaults)

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:
30    class Config:
31        frozen = True
32        smart_union = True
33        extra = pydantic_v1.Extra.allow
34        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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
18    name: typing.Optional[str] = None
19    input: typing.Optional[typing.Any] = None
20    output: typing.Optional[typing.Any] = None
21    session_id: typing.Optional[str] = pydantic_v1.Field(
22        alias="sessionId", default=None
23    )
24    release: typing.Optional[str] = None
25    version: typing.Optional[str] = None
26    user_id: typing.Optional[str] = pydantic_v1.Field(alias="userId", default=None)
27    metadata: typing.Optional[typing.Any] = None
28    tags: typing.Optional[typing.List[str]] = None
29    public: typing.Optional[bool] = pydantic_v1.Field(default=None)
30    """
31    Public traces are accessible via url without login
32    """
33
34    def json(self, **kwargs: typing.Any) -> str:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
40        return super().json(**kwargs_with_defaults)
41
42    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
43        kwargs_with_defaults: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().dict(**kwargs_with_defaults)
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}
id: str

The unique identifier of a trace

timestamp: datetime.datetime
name: Optional[str]
input: Optional[Any]
output: Optional[Any]
session_id: Optional[str]
release: Optional[str]
version: Optional[str]
user_id: Optional[str]
metadata: Optional[Any]
tags: Optional[List[str]]
public: Optional[bool]

Public traces are accessible via url without login

def json(self, **kwargs: Any) -> str:
34    def json(self, **kwargs: typing.Any) -> str:
35        kwargs_with_defaults: typing.Any = {
36            "by_alias": True,
37            "exclude_unset": True,
38            **kwargs,
39        }
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: typing.Any = {
44            "by_alias": True,
45            "exclude_unset": True,
46            **kwargs,
47        }
48        return super().dict(**kwargs_with_defaults)

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:
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 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(
19        alias="sessionId", default=None
20    )
21    release: typing.Optional[str] = None
22    version: typing.Optional[str] = None
23    metadata: typing.Optional[typing.Any] = None
24    tags: typing.Optional[typing.List[str]] = None
25    public: typing.Optional[bool] = pydantic_v1.Field(default=None)
26    """
27    Make trace publicly accessible via url
28    """
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        return super().json(**kwargs_with_defaults)
37
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)
45
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        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]:
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)

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:
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
body: TraceBody
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        return super().dict(**kwargs_with_defaults)
53
54    class Config:
55        frozen = True
56        smart_union = True
57        allow_population_by_field_name = True
58        populate_by_name = True
59        extra = pydantic_v1.Extra.allow
60        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 = {
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: typing.Any = {
48            "by_alias": True,
49            "exclude_unset": True,
50            **kwargs,
51        }
52        return super().dict(**kwargs_with_defaults)

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:
54    class Config:
55        frozen = True
56        smart_union = True
57        allow_population_by_field_name = True
58        populate_by_name = True
59        extra = pydantic_v1.Extra.allow
60        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 = {
42            "by_alias": True,
43            "exclude_unset": True,
44            **kwargs,
45        }
46        return super().json(**kwargs_with_defaults)
47
48    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
54        return super().dict(**kwargs_with_defaults)
55
56    class Config:
57        frozen = True
58        smart_union = True
59        allow_population_by_field_name = True
60        populate_by_name = True
61        extra = pydantic_v1.Extra.allow
62        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 = {
42            "by_alias": True,
43            "exclude_unset": True,
44            **kwargs,
45        }
46        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]:
48    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
49        kwargs_with_defaults: typing.Any = {
50            "by_alias": True,
51            "exclude_unset": True,
52            **kwargs,
53        }
54        return super().dict(**kwargs_with_defaults)

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:
56    class Config:
57        frozen = True
58        smart_union = True
59        allow_population_by_field_name = True
60        populate_by_name = True
61        extra = pydantic_v1.Extra.allow
62        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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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[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 = {
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        return super().json(**kwargs_with_defaults)
22
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)
30
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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 = {
17            "by_alias": True,
18            "exclude_unset": True,
19            **kwargs,
20        }
21        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]:
23    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24        kwargs_with_defaults: typing.Any = {
25            "by_alias": True,
26            "exclude_unset": True,
27            **kwargs,
28        }
29        return super().dict(**kwargs_with_defaults)

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:
31    class Config:
32        frozen = True
33        smart_union = True
34        allow_population_by_field_name = True
35        populate_by_name = True
36        extra = pydantic_v1.Extra.allow
37        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(
16        alias="completionStartTime", default=None
17    )
18    model: typing.Optional[str] = None
19    model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field(
20        alias="modelParameters", default=None
21    )
22    usage: typing.Optional[IngestionUsage] = None
23    prompt_name: typing.Optional[str] = pydantic_v1.Field(
24        alias="promptName", default=None
25    )
26    prompt_version: typing.Optional[int] = pydantic_v1.Field(
27        alias="promptVersion", default=None
28    )
29
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        return super().json(**kwargs_with_defaults)
37
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)
45
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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:
30    def json(self, **kwargs: typing.Any) -> str:
31        kwargs_with_defaults: typing.Any = {
32            "by_alias": True,
33            "exclude_unset": True,
34            **kwargs,
35        }
36        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]:
38    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
39        kwargs_with_defaults: typing.Any = {
40            "by_alias": True,
41            "exclude_unset": True,
42            **kwargs,
43        }
44        return super().dict(**kwargs_with_defaults)

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:
46    class Config:
47        frozen = True
48        smart_union = True
49        allow_population_by_field_name = True
50        populate_by_name = True
51        extra = pydantic_v1.Extra.allow
52        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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 UpdateSpanBody(langfuse.api.UpdateEventBody):
12class UpdateSpanBody(UpdateEventBody):
13    end_time: typing.Optional[dt.datetime] = pydantic_v1.Field(
14        alias="endTime", default=None
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)
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}
end_time: Optional[datetime.datetime]
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: typing.Any = {
27            "by_alias": True,
28            "exclude_unset": True,
29            **kwargs,
30        }
31        return super().dict(**kwargs_with_defaults)

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:
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 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 = {
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)
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}
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: typing.Any = {
26            "by_alias": True,
27            "exclude_unset": True,
28            **kwargs,
29        }
30        return super().dict(**kwargs_with_defaults)

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:
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 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(
34        alias="inputCost", default=None
35    )
36    """
37    USD input cost
38    """
39
40    output_cost: typing.Optional[float] = pydantic_v1.Field(
41        alias="outputCost", default=None
42    )
43    """
44    USD output cost
45    """
46
47    total_cost: typing.Optional[float] = pydantic_v1.Field(
48        alias="totalCost", default=None
49    )
50    """
51    USD total cost, defaults to input+output
52    """
53
54    def json(self, **kwargs: typing.Any) -> str:
55        kwargs_with_defaults: typing.Any = {
56            "by_alias": True,
57            "exclude_unset": True,
58            **kwargs,
59        }
60        return super().json(**kwargs_with_defaults)
61
62    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
63        kwargs_with_defaults: typing.Any = {
64            "by_alias": True,
65            "exclude_unset": True,
66            **kwargs,
67        }
68        return super().dict(**kwargs_with_defaults)
69
70    class Config:
71        frozen = True
72        smart_union = True
73        allow_population_by_field_name = True
74        populate_by_name = True
75        extra = pydantic_v1.Extra.allow
76        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:
54    def json(self, **kwargs: typing.Any) -> str:
55        kwargs_with_defaults: typing.Any = {
56            "by_alias": True,
57            "exclude_unset": True,
58            **kwargs,
59        }
60        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]:
62    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
63        kwargs_with_defaults: typing.Any = {
64            "by_alias": True,
65            "exclude_unset": True,
66            **kwargs,
67        }
68        return super().dict(**kwargs_with_defaults)

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:
70    class Config:
71        frozen = True
72        smart_union = True
73        allow_population_by_field_name = True
74        populate_by_name = True
75        extra = pydantic_v1.Extra.allow
76        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 = {
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: typing.Any = {
49            "by_alias": True,
50            "exclude_unset": True,
51            **kwargs,
52        }
53        return super().dict(**kwargs_with_defaults)
54
55    class Config:
56        frozen = True
57        smart_union = True
58        allow_population_by_field_name = True
59        populate_by_name = True
60        extra = pydantic_v1.Extra.allow
61        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 = {
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: typing.Any = {
49            "by_alias": True,
50            "exclude_unset": True,
51            **kwargs,
52        }
53        return super().dict(**kwargs_with_defaults)

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:
55    class Config:
56        frozen = True
57        smart_union = True
58        allow_population_by_field_name = True
59        populate_by_name = True
60        extra = pydantic_v1.Extra.allow
61        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>}