Skip to content

Commit c91f5ae

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse e1f390d (#1439)
Co-authored-by: langfuse-bot <[email protected]>
1 parent 03bb0d1 commit c91f5ae

File tree

4 files changed

+146
-0
lines changed

4 files changed

+146
-0
lines changed

langfuse/api/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55

66
The Langfuse Python library provides convenient access to the Langfuse APIs from Python.
77

8+
## Table of Contents
9+
10+
- [Installation](#installation)
11+
- [Usage](#usage)
12+
- [Async Client](#async-client)
13+
- [Exception Handling](#exception-handling)
14+
- [Advanced](#advanced)
15+
- [Retries](#retries)
16+
- [Timeouts](#timeouts)
17+
- [Custom Client](#custom-client)
18+
- [Contributing](#contributing)
19+
820
## Installation
921

1022
```sh

langfuse/api/reference.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6486,6 +6486,22 @@ client.score_v_2.get()
64866486
<dl>
64876487
<dd>
64886488

6489+
**dataset_run_id:** `typing.Optional[str]` — Retrieve only scores with a specific datasetRunId.
6490+
6491+
</dd>
6492+
</dl>
6493+
6494+
<dl>
6495+
<dd>
6496+
6497+
**trace_id:** `typing.Optional[str]` — Retrieve only scores with a specific traceId.
6498+
6499+
</dd>
6500+
</dl>
6501+
6502+
<dl>
6503+
<dd>
6504+
64896505
**queue_id:** `typing.Optional[str]` — Retrieve only scores with a specific annotation queueId.
64906506

64916507
</dd>

langfuse/api/resources/media/types/media_content_type.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class MediaContentType(str, enum.Enum):
1919
IMAGE_SVG_XML = "image/svg+xml"
2020
IMAGE_TIFF = "image/tiff"
2121
IMAGE_BMP = "image/bmp"
22+
IMAGE_AVIF = "image/avif"
23+
IMAGE_HEIC = "image/heic"
2224
AUDIO_MPEG = "audio/mpeg"
2325
AUDIO_MP_3 = "audio/mp3"
2426
AUDIO_WAV = "audio/wav"
@@ -27,19 +29,46 @@ class MediaContentType(str, enum.Enum):
2729
AUDIO_AAC = "audio/aac"
2830
AUDIO_MP_4 = "audio/mp4"
2931
AUDIO_FLAC = "audio/flac"
32+
AUDIO_OPUS = "audio/opus"
33+
AUDIO_WEBM = "audio/webm"
3034
VIDEO_MP_4 = "video/mp4"
3135
VIDEO_WEBM = "video/webm"
36+
VIDEO_OGG = "video/ogg"
37+
VIDEO_MPEG = "video/mpeg"
38+
VIDEO_QUICKTIME = "video/quicktime"
39+
VIDEO_X_MSVIDEO = "video/x-msvideo"
40+
VIDEO_X_MATROSKA = "video/x-matroska"
3241
TEXT_PLAIN = "text/plain"
3342
TEXT_HTML = "text/html"
3443
TEXT_CSS = "text/css"
3544
TEXT_CSV = "text/csv"
45+
TEXT_MARKDOWN = "text/markdown"
46+
TEXT_X_PYTHON = "text/x-python"
47+
APPLICATION_JAVASCRIPT = "application/javascript"
48+
TEXT_X_TYPESCRIPT = "text/x-typescript"
49+
APPLICATION_X_YAML = "application/x-yaml"
3650
APPLICATION_PDF = "application/pdf"
3751
APPLICATION_MSWORD = "application/msword"
3852
APPLICATION_MS_EXCEL = "application/vnd.ms-excel"
53+
APPLICATION_OPENXML_SPREADSHEET = (
54+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
55+
)
3956
APPLICATION_ZIP = "application/zip"
4057
APPLICATION_JSON = "application/json"
4158
APPLICATION_XML = "application/xml"
4259
APPLICATION_OCTET_STREAM = "application/octet-stream"
60+
APPLICATION_OPENXML_WORD = (
61+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
62+
)
63+
APPLICATION_OPENXML_PRESENTATION = (
64+
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
65+
)
66+
APPLICATION_RTF = "application/rtf"
67+
APPLICATION_X_NDJSON = "application/x-ndjson"
68+
APPLICATION_PARQUET = "application/vnd.apache.parquet"
69+
APPLICATION_GZIP = "application/gzip"
70+
APPLICATION_X_TAR = "application/x-tar"
71+
APPLICATION_X_7_Z_COMPRESSED = "application/x-7z-compressed"
4372

4473
def visit(
4574
self,
@@ -51,6 +80,8 @@ def visit(
5180
image_svg_xml: typing.Callable[[], T_Result],
5281
image_tiff: typing.Callable[[], T_Result],
5382
image_bmp: typing.Callable[[], T_Result],
83+
image_avif: typing.Callable[[], T_Result],
84+
image_heic: typing.Callable[[], T_Result],
5485
audio_mpeg: typing.Callable[[], T_Result],
5586
audio_mp_3: typing.Callable[[], T_Result],
5687
audio_wav: typing.Callable[[], T_Result],
@@ -59,19 +90,40 @@ def visit(
5990
audio_aac: typing.Callable[[], T_Result],
6091
audio_mp_4: typing.Callable[[], T_Result],
6192
audio_flac: typing.Callable[[], T_Result],
93+
audio_opus: typing.Callable[[], T_Result],
94+
audio_webm: typing.Callable[[], T_Result],
6295
video_mp_4: typing.Callable[[], T_Result],
6396
video_webm: typing.Callable[[], T_Result],
97+
video_ogg: typing.Callable[[], T_Result],
98+
video_mpeg: typing.Callable[[], T_Result],
99+
video_quicktime: typing.Callable[[], T_Result],
100+
video_x_msvideo: typing.Callable[[], T_Result],
101+
video_x_matroska: typing.Callable[[], T_Result],
64102
text_plain: typing.Callable[[], T_Result],
65103
text_html: typing.Callable[[], T_Result],
66104
text_css: typing.Callable[[], T_Result],
67105
text_csv: typing.Callable[[], T_Result],
106+
text_markdown: typing.Callable[[], T_Result],
107+
text_x_python: typing.Callable[[], T_Result],
108+
application_javascript: typing.Callable[[], T_Result],
109+
text_x_typescript: typing.Callable[[], T_Result],
110+
application_x_yaml: typing.Callable[[], T_Result],
68111
application_pdf: typing.Callable[[], T_Result],
69112
application_msword: typing.Callable[[], T_Result],
70113
application_ms_excel: typing.Callable[[], T_Result],
114+
application_openxml_spreadsheet: typing.Callable[[], T_Result],
71115
application_zip: typing.Callable[[], T_Result],
72116
application_json: typing.Callable[[], T_Result],
73117
application_xml: typing.Callable[[], T_Result],
74118
application_octet_stream: typing.Callable[[], T_Result],
119+
application_openxml_word: typing.Callable[[], T_Result],
120+
application_openxml_presentation: typing.Callable[[], T_Result],
121+
application_rtf: typing.Callable[[], T_Result],
122+
application_x_ndjson: typing.Callable[[], T_Result],
123+
application_parquet: typing.Callable[[], T_Result],
124+
application_gzip: typing.Callable[[], T_Result],
125+
application_x_tar: typing.Callable[[], T_Result],
126+
application_x_7_z_compressed: typing.Callable[[], T_Result],
75127
) -> T_Result:
76128
if self is MediaContentType.IMAGE_PNG:
77129
return image_png()
@@ -89,6 +141,10 @@ def visit(
89141
return image_tiff()
90142
if self is MediaContentType.IMAGE_BMP:
91143
return image_bmp()
144+
if self is MediaContentType.IMAGE_AVIF:
145+
return image_avif()
146+
if self is MediaContentType.IMAGE_HEIC:
147+
return image_heic()
92148
if self is MediaContentType.AUDIO_MPEG:
93149
return audio_mpeg()
94150
if self is MediaContentType.AUDIO_MP_3:
@@ -105,10 +161,24 @@ def visit(
105161
return audio_mp_4()
106162
if self is MediaContentType.AUDIO_FLAC:
107163
return audio_flac()
164+
if self is MediaContentType.AUDIO_OPUS:
165+
return audio_opus()
166+
if self is MediaContentType.AUDIO_WEBM:
167+
return audio_webm()
108168
if self is MediaContentType.VIDEO_MP_4:
109169
return video_mp_4()
110170
if self is MediaContentType.VIDEO_WEBM:
111171
return video_webm()
172+
if self is MediaContentType.VIDEO_OGG:
173+
return video_ogg()
174+
if self is MediaContentType.VIDEO_MPEG:
175+
return video_mpeg()
176+
if self is MediaContentType.VIDEO_QUICKTIME:
177+
return video_quicktime()
178+
if self is MediaContentType.VIDEO_X_MSVIDEO:
179+
return video_x_msvideo()
180+
if self is MediaContentType.VIDEO_X_MATROSKA:
181+
return video_x_matroska()
112182
if self is MediaContentType.TEXT_PLAIN:
113183
return text_plain()
114184
if self is MediaContentType.TEXT_HTML:
@@ -117,12 +187,24 @@ def visit(
117187
return text_css()
118188
if self is MediaContentType.TEXT_CSV:
119189
return text_csv()
190+
if self is MediaContentType.TEXT_MARKDOWN:
191+
return text_markdown()
192+
if self is MediaContentType.TEXT_X_PYTHON:
193+
return text_x_python()
194+
if self is MediaContentType.APPLICATION_JAVASCRIPT:
195+
return application_javascript()
196+
if self is MediaContentType.TEXT_X_TYPESCRIPT:
197+
return text_x_typescript()
198+
if self is MediaContentType.APPLICATION_X_YAML:
199+
return application_x_yaml()
120200
if self is MediaContentType.APPLICATION_PDF:
121201
return application_pdf()
122202
if self is MediaContentType.APPLICATION_MSWORD:
123203
return application_msword()
124204
if self is MediaContentType.APPLICATION_MS_EXCEL:
125205
return application_ms_excel()
206+
if self is MediaContentType.APPLICATION_OPENXML_SPREADSHEET:
207+
return application_openxml_spreadsheet()
126208
if self is MediaContentType.APPLICATION_ZIP:
127209
return application_zip()
128210
if self is MediaContentType.APPLICATION_JSON:
@@ -131,3 +213,19 @@ def visit(
131213
return application_xml()
132214
if self is MediaContentType.APPLICATION_OCTET_STREAM:
133215
return application_octet_stream()
216+
if self is MediaContentType.APPLICATION_OPENXML_WORD:
217+
return application_openxml_word()
218+
if self is MediaContentType.APPLICATION_OPENXML_PRESENTATION:
219+
return application_openxml_presentation()
220+
if self is MediaContentType.APPLICATION_RTF:
221+
return application_rtf()
222+
if self is MediaContentType.APPLICATION_X_NDJSON:
223+
return application_x_ndjson()
224+
if self is MediaContentType.APPLICATION_PARQUET:
225+
return application_parquet()
226+
if self is MediaContentType.APPLICATION_GZIP:
227+
return application_gzip()
228+
if self is MediaContentType.APPLICATION_X_TAR:
229+
return application_x_tar()
230+
if self is MediaContentType.APPLICATION_X_7_Z_COMPRESSED:
231+
return application_x_7_z_compressed()

langfuse/api/resources/score_v_2/client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def get(
4141
score_ids: typing.Optional[str] = None,
4242
config_id: typing.Optional[str] = None,
4343
session_id: typing.Optional[str] = None,
44+
dataset_run_id: typing.Optional[str] = None,
45+
trace_id: typing.Optional[str] = None,
4446
queue_id: typing.Optional[str] = None,
4547
data_type: typing.Optional[ScoreDataType] = None,
4648
trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
@@ -90,6 +92,12 @@ def get(
9092
session_id : typing.Optional[str]
9193
Retrieve only scores with a specific sessionId.
9294
95+
dataset_run_id : typing.Optional[str]
96+
Retrieve only scores with a specific datasetRunId.
97+
98+
trace_id : typing.Optional[str]
99+
Retrieve only scores with a specific traceId.
100+
93101
queue_id : typing.Optional[str]
94102
Retrieve only scores with a specific annotation queueId.
95103
@@ -141,6 +149,8 @@ def get(
141149
"scoreIds": score_ids,
142150
"configId": config_id,
143151
"sessionId": session_id,
152+
"datasetRunId": dataset_run_id,
153+
"traceId": trace_id,
144154
"queueId": queue_id,
145155
"dataType": data_type,
146156
"traceTags": trace_tags,
@@ -259,6 +269,8 @@ async def get(
259269
score_ids: typing.Optional[str] = None,
260270
config_id: typing.Optional[str] = None,
261271
session_id: typing.Optional[str] = None,
272+
dataset_run_id: typing.Optional[str] = None,
273+
trace_id: typing.Optional[str] = None,
262274
queue_id: typing.Optional[str] = None,
263275
data_type: typing.Optional[ScoreDataType] = None,
264276
trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
@@ -308,6 +320,12 @@ async def get(
308320
session_id : typing.Optional[str]
309321
Retrieve only scores with a specific sessionId.
310322
323+
dataset_run_id : typing.Optional[str]
324+
Retrieve only scores with a specific datasetRunId.
325+
326+
trace_id : typing.Optional[str]
327+
Retrieve only scores with a specific traceId.
328+
311329
queue_id : typing.Optional[str]
312330
Retrieve only scores with a specific annotation queueId.
313331
@@ -367,6 +385,8 @@ async def main() -> None:
367385
"scoreIds": score_ids,
368386
"configId": config_id,
369387
"sessionId": session_id,
388+
"datasetRunId": dataset_run_id,
389+
"traceId": trace_id,
370390
"queueId": queue_id,
371391
"dataType": data_type,
372392
"traceTags": trace_tags,

0 commit comments

Comments
 (0)