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    ChatMessage,
  8    ChatPrompt,
  9    CreateChatPromptRequest,
 10    CreateDatasetItemRequest,
 11    CreateDatasetRequest,
 12    CreateDatasetRunItemRequest,
 13    CreateEventBody,
 14    CreateEventEvent,
 15    CreateGenerationBody,
 16    CreateGenerationEvent,
 17    CreateObservationEvent,
 18    CreatePromptRequest,
 19    CreatePromptRequest_Chat,
 20    CreatePromptRequest_Text,
 21    CreateScoreRequest,
 22    CreateSpanBody,
 23    CreateSpanEvent,
 24    CreateTextPromptRequest,
 25    DailyMetrics,
 26    DailyMetricsDetails,
 27    Dataset,
 28    DatasetCore,
 29    DatasetItem,
 30    DatasetRun,
 31    DatasetRunItem,
 32    DatasetStatus,
 33    DatasetWithReferences,
 34    Error,
 35    HealthResponse,
 36    IngestionError,
 37    IngestionEvent,
 38    IngestionEvent_EventCreate,
 39    IngestionEvent_GenerationCreate,
 40    IngestionEvent_GenerationUpdate,
 41    IngestionEvent_ObservationCreate,
 42    IngestionEvent_ObservationUpdate,
 43    IngestionEvent_ScoreCreate,
 44    IngestionEvent_SdkLog,
 45    IngestionEvent_SpanCreate,
 46    IngestionEvent_SpanUpdate,
 47    IngestionEvent_TraceCreate,
 48    IngestionResponse,
 49    IngestionSuccess,
 50    IngestionUsage,
 51    MapValue,
 52    MethodNotAllowedError,
 53    ModelUsageUnit,
 54    NotFoundError,
 55    Observation,
 56    ObservationBody,
 57    ObservationLevel,
 58    ObservationType,
 59    Observations,
 60    ObservationsView,
 61    ObservationsViews,
 62    OpenAiUsage,
 63    OptionalObservationBody,
 64    PaginatedDatasets,
 65    Project,
 66    Projects,
 67    Prompt,
 68    PromptMeta,
 69    PromptMetaListResponse,
 70    Prompt_Chat,
 71    Prompt_Text,
 72    Score,
 73    ScoreBody,
 74    ScoreEvent,
 75    ScoreSource,
 76    Scores,
 77    SdkLogBody,
 78    SdkLogEvent,
 79    ServiceUnavailableError,
 80    Session,
 81    SessionWithTraces,
 82    Sort,
 83    TextPrompt,
 84    Trace,
 85    TraceBody,
 86    TraceEvent,
 87    TraceWithDetails,
 88    TraceWithFullDetails,
 89    Traces,
 90    UnauthorizedError,
 91    UpdateEventBody,
 92    UpdateGenerationBody,
 93    UpdateGenerationEvent,
 94    UpdateObservationEvent,
 95    UpdateSpanBody,
 96    UpdateSpanEvent,
 97    Usage,
 98    UsageByModel,
 99    commons,
100    dataset_items,
101    dataset_run_items,
102    datasets,
103    health,
104    ingestion,
105    metrics,
106    observations,
107    projects,
108    prompts,
109    score,
110    sessions,
111    trace,
112    utils,
113)
114
115__all__ = [
116    "AccessDeniedError",
117    "BaseEvent",
118    "BasePrompt",
119    "ChatMessage",
120    "ChatPrompt",
121    "CreateChatPromptRequest",
122    "CreateDatasetItemRequest",
123    "CreateDatasetRequest",
124    "CreateDatasetRunItemRequest",
125    "CreateEventBody",
126    "CreateEventEvent",
127    "CreateGenerationBody",
128    "CreateGenerationEvent",
129    "CreateObservationEvent",
130    "CreatePromptRequest",
131    "CreatePromptRequest_Chat",
132    "CreatePromptRequest_Text",
133    "CreateScoreRequest",
134    "CreateSpanBody",
135    "CreateSpanEvent",
136    "CreateTextPromptRequest",
137    "DailyMetrics",
138    "DailyMetricsDetails",
139    "Dataset",
140    "DatasetCore",
141    "DatasetItem",
142    "DatasetRun",
143    "DatasetRunItem",
144    "DatasetStatus",
145    "DatasetWithReferences",
146    "Error",
147    "HealthResponse",
148    "IngestionError",
149    "IngestionEvent",
150    "IngestionEvent_EventCreate",
151    "IngestionEvent_GenerationCreate",
152    "IngestionEvent_GenerationUpdate",
153    "IngestionEvent_ObservationCreate",
154    "IngestionEvent_ObservationUpdate",
155    "IngestionEvent_ScoreCreate",
156    "IngestionEvent_SdkLog",
157    "IngestionEvent_SpanCreate",
158    "IngestionEvent_SpanUpdate",
159    "IngestionEvent_TraceCreate",
160    "IngestionResponse",
161    "IngestionSuccess",
162    "IngestionUsage",
163    "MapValue",
164    "MethodNotAllowedError",
165    "ModelUsageUnit",
166    "NotFoundError",
167    "Observation",
168    "ObservationBody",
169    "ObservationLevel",
170    "ObservationType",
171    "Observations",
172    "ObservationsView",
173    "ObservationsViews",
174    "OpenAiUsage",
175    "OptionalObservationBody",
176    "PaginatedDatasets",
177    "Project",
178    "Projects",
179    "Prompt",
180    "PromptMeta",
181    "PromptMetaListResponse",
182    "Prompt_Chat",
183    "Prompt_Text",
184    "Score",
185    "ScoreBody",
186    "ScoreEvent",
187    "ScoreSource",
188    "Scores",
189    "SdkLogBody",
190    "SdkLogEvent",
191    "ServiceUnavailableError",
192    "Session",
193    "SessionWithTraces",
194    "Sort",
195    "TextPrompt",
196    "Trace",
197    "TraceBody",
198    "TraceEvent",
199    "TraceWithDetails",
200    "TraceWithFullDetails",
201    "Traces",
202    "UnauthorizedError",
203    "UpdateEventBody",
204    "UpdateGenerationBody",
205    "UpdateGenerationEvent",
206    "UpdateObservationEvent",
207    "UpdateSpanBody",
208    "UpdateSpanEvent",
209    "Usage",
210    "UsageByModel",
211    "commons",
212    "dataset_items",
213    "dataset_run_items",
214    "datasets",
215    "health",
216    "ingestion",
217    "metrics",
218    "observations",
219    "projects",
220    "prompts",
221    "score",
222    "sessions",
223    "trace",
224    "utils",
225]
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
13    timestamp: str
14    metadata: typing.Any
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}
id: str
timestamp: str
metadata: 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 BaseEvent.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 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 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 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
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

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 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 CreateScoreRequest(pydantic.v1.main.BaseModel):
11class CreateScoreRequest(pydantic_v1.BaseModel):
12    id: typing.Optional[str] = None
13    trace_id: str = pydantic_v1.Field(alias="traceId")
14    name: str
15    value: float
16    observation_id: typing.Optional[str] = pydantic_v1.Field(
17        alias="observationId", default=None
18    )
19    comment: typing.Optional[str] = None
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: Optional[str]
trace_id: str
name: str
value: float
observation_id: Optional[str]
comment: Optional[str]
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 CreateScoreRequest.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 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(langfuse.api.DatasetCore):
13class Dataset(DatasetCore):
14    """
15    Dataset including all items
16    """
17
18    items: typing.List[DatasetItem]
19    runs: typing.List[str]
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}

Dataset including all items

items: List[DatasetItem]
runs: List[str]
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
DatasetCore
id
name
description
metadata
project_id
created_at
updated_at
class Dataset.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 DatasetCore(pydantic.v1.main.BaseModel):
11class DatasetCore(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 DatasetCore.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):
12class DatasetRun(pydantic_v1.BaseModel):
13    id: str
14    name: str
15    description: typing.Optional[str] = None
16    metadata: typing.Optional[typing.Any] = None
17    dataset_id: str = pydantic_v1.Field(alias="datasetId")
18    dataset_name: str = pydantic_v1.Field(alias="datasetName")
19    created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
20    updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
21    dataset_run_items: typing.List[DatasetRunItem] = pydantic_v1.Field(
22        alias="datasetRunItems"
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        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        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
dataset_run_items: List[DatasetRunItem]
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 DatasetRun.Config:
41    class Config:
42        frozen = True
43        smart_union = True
44        allow_population_by_field_name = True
45        populate_by_name = True
46        extra = pydantic_v1.Extra.allow
47        json_encoders = {dt.datetime: serialize_datetime}
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = <Extra.allow: 'allow'>
json_encoders = {<class 'datetime.datetime'>: <function serialize_datetime>}
class 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 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 DatasetWithReferences(langfuse.api.DatasetCore):
12class DatasetWithReferences(DatasetCore):
13    items: typing.List[str] = pydantic_v1.Field()
14    """
15    list of dataset item ids
16    """
17
18    runs: typing.List[str] = pydantic_v1.Field()
19    """
20    list of dataset run names
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}
items: List[str]

list of dataset item ids

runs: List[str]

list of dataset run names

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
DatasetCore
id
name
description
metadata
project_id
created_at
updated_at
class DatasetWithReferences.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 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):
40class IngestionEvent_EventCreate(CreateEventEvent):
41    type: typing.Literal["event-create"] = "event-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['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:
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_GenerationCreate(langfuse.api.CreateGenerationEvent):
50class IngestionEvent_GenerationCreate(CreateGenerationEvent):
51    type: typing.Literal["generation-create"] = "generation-create"
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['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:
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_GenerationUpdate(langfuse.api.UpdateGenerationEvent):
60class IngestionEvent_GenerationUpdate(UpdateGenerationEvent):
61    type: typing.Literal["generation-update"] = "generation-update"
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-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:
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_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):
70class IngestionEvent_SpanCreate(CreateSpanEvent):
71    type: typing.Literal["span-create"] = "span-create"
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['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:
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_SpanUpdate(langfuse.api.UpdateSpanEvent):
80class IngestionEvent_SpanUpdate(UpdateSpanEvent):
81    type: typing.Literal["span-update"] = "span-update"
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['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:
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_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