Skip to content

Commit 52d17d3

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse 25e6ad9 (#1428)
Co-authored-by: langfuse-bot <[email protected]>
1 parent d873cfb commit 52d17d3

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

langfuse/api/resources/commons/types/dataset.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ class Dataset(pydantic_v1.BaseModel):
1212
name: str
1313
description: typing.Optional[str] = None
1414
metadata: typing.Optional[typing.Any] = None
15+
input_schema: typing.Optional[typing.Any] = pydantic_v1.Field(
16+
alias="inputSchema", default=None
17+
)
18+
"""
19+
JSON Schema for validating dataset item inputs
20+
"""
21+
22+
expected_output_schema: typing.Optional[typing.Any] = pydantic_v1.Field(
23+
alias="expectedOutputSchema", default=None
24+
)
25+
"""
26+
JSON Schema for validating dataset item expected outputs
27+
"""
28+
1529
project_id: str = pydantic_v1.Field(alias="projectId")
1630
created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
1731
updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")

langfuse/api/resources/datasets/types/create_dataset_request.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ class CreateDatasetRequest(pydantic_v1.BaseModel):
1111
name: str
1212
description: typing.Optional[str] = None
1313
metadata: typing.Optional[typing.Any] = None
14+
input_schema: typing.Optional[typing.Any] = pydantic_v1.Field(
15+
alias="inputSchema", default=None
16+
)
17+
"""
18+
JSON Schema for validating dataset item inputs. When set, all new and existing dataset items will be validated against this schema.
19+
"""
20+
21+
expected_output_schema: typing.Optional[typing.Any] = pydantic_v1.Field(
22+
alias="expectedOutputSchema", default=None
23+
)
24+
"""
25+
JSON Schema for validating dataset item expected outputs. When set, all new and existing dataset items will be validated against this schema.
26+
"""
1427

1528
def json(self, **kwargs: typing.Any) -> str:
1629
kwargs_with_defaults: typing.Any = {
@@ -40,5 +53,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
4053
class Config:
4154
frozen = True
4255
smart_union = True
56+
allow_population_by_field_name = True
57+
populate_by_name = True
4358
extra = pydantic_v1.Extra.allow
4459
json_encoders = {dt.datetime: serialize_datetime}

langfuse/api/resources/score/types/create_score_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CreateScoreRequest(pydantic_v1.BaseModel):
4040
"""
4141

4242
comment: typing.Optional[str] = None
43-
metadata: typing.Optional[typing.Any] = None
43+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
4444
environment: typing.Optional[str] = pydantic_v1.Field(default=None)
4545
"""
4646
The environment of the score. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.

0 commit comments

Comments
 (0)