From ddf04813cbc907e6558bfd2a61e1772ff33797a4 Mon Sep 17 00:00:00 2001 From: langfuse-bot Date: Fri, 14 Nov 2025 12:30:16 +0000 Subject: [PATCH] feat(api): update API spec from langfuse/langfuse e1f390d --- langfuse/api/README.md | 12 +++ langfuse/api/reference.md | 16 +++ .../media/types/media_content_type.py | 98 +++++++++++++++++++ langfuse/api/resources/score_v_2/client.py | 20 ++++ 4 files changed, 146 insertions(+) diff --git a/langfuse/api/README.md b/langfuse/api/README.md index 9e8fef6d4..47de89ea3 100644 --- a/langfuse/api/README.md +++ b/langfuse/api/README.md @@ -5,6 +5,18 @@ The Langfuse Python library provides convenient access to the Langfuse APIs from Python. +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) +- [Async Client](#async-client) +- [Exception Handling](#exception-handling) +- [Advanced](#advanced) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Custom Client](#custom-client) +- [Contributing](#contributing) + ## Installation ```sh diff --git a/langfuse/api/reference.md b/langfuse/api/reference.md index 79be952da..352193f10 100644 --- a/langfuse/api/reference.md +++ b/langfuse/api/reference.md @@ -6486,6 +6486,22 @@ client.score_v_2.get()
+**dataset_run_id:** `typing.Optional[str]` — Retrieve only scores with a specific datasetRunId. + +
+
+ +
+
+ +**trace_id:** `typing.Optional[str]` — Retrieve only scores with a specific traceId. + +
+
+ +
+
+ **queue_id:** `typing.Optional[str]` — Retrieve only scores with a specific annotation queueId.
diff --git a/langfuse/api/resources/media/types/media_content_type.py b/langfuse/api/resources/media/types/media_content_type.py index e8fdeefa2..6942482bb 100644 --- a/langfuse/api/resources/media/types/media_content_type.py +++ b/langfuse/api/resources/media/types/media_content_type.py @@ -19,6 +19,8 @@ class MediaContentType(str, enum.Enum): IMAGE_SVG_XML = "image/svg+xml" IMAGE_TIFF = "image/tiff" IMAGE_BMP = "image/bmp" + IMAGE_AVIF = "image/avif" + IMAGE_HEIC = "image/heic" AUDIO_MPEG = "audio/mpeg" AUDIO_MP_3 = "audio/mp3" AUDIO_WAV = "audio/wav" @@ -27,19 +29,46 @@ class MediaContentType(str, enum.Enum): AUDIO_AAC = "audio/aac" AUDIO_MP_4 = "audio/mp4" AUDIO_FLAC = "audio/flac" + AUDIO_OPUS = "audio/opus" + AUDIO_WEBM = "audio/webm" VIDEO_MP_4 = "video/mp4" VIDEO_WEBM = "video/webm" + VIDEO_OGG = "video/ogg" + VIDEO_MPEG = "video/mpeg" + VIDEO_QUICKTIME = "video/quicktime" + VIDEO_X_MSVIDEO = "video/x-msvideo" + VIDEO_X_MATROSKA = "video/x-matroska" TEXT_PLAIN = "text/plain" TEXT_HTML = "text/html" TEXT_CSS = "text/css" TEXT_CSV = "text/csv" + TEXT_MARKDOWN = "text/markdown" + TEXT_X_PYTHON = "text/x-python" + APPLICATION_JAVASCRIPT = "application/javascript" + TEXT_X_TYPESCRIPT = "text/x-typescript" + APPLICATION_X_YAML = "application/x-yaml" APPLICATION_PDF = "application/pdf" APPLICATION_MSWORD = "application/msword" APPLICATION_MS_EXCEL = "application/vnd.ms-excel" + APPLICATION_OPENXML_SPREADSHEET = ( + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ) APPLICATION_ZIP = "application/zip" APPLICATION_JSON = "application/json" APPLICATION_XML = "application/xml" APPLICATION_OCTET_STREAM = "application/octet-stream" + APPLICATION_OPENXML_WORD = ( + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + ) + APPLICATION_OPENXML_PRESENTATION = ( + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + ) + APPLICATION_RTF = "application/rtf" + APPLICATION_X_NDJSON = "application/x-ndjson" + APPLICATION_PARQUET = "application/vnd.apache.parquet" + APPLICATION_GZIP = "application/gzip" + APPLICATION_X_TAR = "application/x-tar" + APPLICATION_X_7_Z_COMPRESSED = "application/x-7z-compressed" def visit( self, @@ -51,6 +80,8 @@ def visit( image_svg_xml: typing.Callable[[], T_Result], image_tiff: typing.Callable[[], T_Result], image_bmp: typing.Callable[[], T_Result], + image_avif: typing.Callable[[], T_Result], + image_heic: typing.Callable[[], T_Result], audio_mpeg: typing.Callable[[], T_Result], audio_mp_3: typing.Callable[[], T_Result], audio_wav: typing.Callable[[], T_Result], @@ -59,19 +90,40 @@ def visit( audio_aac: typing.Callable[[], T_Result], audio_mp_4: typing.Callable[[], T_Result], audio_flac: typing.Callable[[], T_Result], + audio_opus: typing.Callable[[], T_Result], + audio_webm: typing.Callable[[], T_Result], video_mp_4: typing.Callable[[], T_Result], video_webm: typing.Callable[[], T_Result], + video_ogg: typing.Callable[[], T_Result], + video_mpeg: typing.Callable[[], T_Result], + video_quicktime: typing.Callable[[], T_Result], + video_x_msvideo: typing.Callable[[], T_Result], + video_x_matroska: typing.Callable[[], T_Result], text_plain: typing.Callable[[], T_Result], text_html: typing.Callable[[], T_Result], text_css: typing.Callable[[], T_Result], text_csv: typing.Callable[[], T_Result], + text_markdown: typing.Callable[[], T_Result], + text_x_python: typing.Callable[[], T_Result], + application_javascript: typing.Callable[[], T_Result], + text_x_typescript: typing.Callable[[], T_Result], + application_x_yaml: typing.Callable[[], T_Result], application_pdf: typing.Callable[[], T_Result], application_msword: typing.Callable[[], T_Result], application_ms_excel: typing.Callable[[], T_Result], + application_openxml_spreadsheet: typing.Callable[[], T_Result], application_zip: typing.Callable[[], T_Result], application_json: typing.Callable[[], T_Result], application_xml: typing.Callable[[], T_Result], application_octet_stream: typing.Callable[[], T_Result], + application_openxml_word: typing.Callable[[], T_Result], + application_openxml_presentation: typing.Callable[[], T_Result], + application_rtf: typing.Callable[[], T_Result], + application_x_ndjson: typing.Callable[[], T_Result], + application_parquet: typing.Callable[[], T_Result], + application_gzip: typing.Callable[[], T_Result], + application_x_tar: typing.Callable[[], T_Result], + application_x_7_z_compressed: typing.Callable[[], T_Result], ) -> T_Result: if self is MediaContentType.IMAGE_PNG: return image_png() @@ -89,6 +141,10 @@ def visit( return image_tiff() if self is MediaContentType.IMAGE_BMP: return image_bmp() + if self is MediaContentType.IMAGE_AVIF: + return image_avif() + if self is MediaContentType.IMAGE_HEIC: + return image_heic() if self is MediaContentType.AUDIO_MPEG: return audio_mpeg() if self is MediaContentType.AUDIO_MP_3: @@ -105,10 +161,24 @@ def visit( return audio_mp_4() if self is MediaContentType.AUDIO_FLAC: return audio_flac() + if self is MediaContentType.AUDIO_OPUS: + return audio_opus() + if self is MediaContentType.AUDIO_WEBM: + return audio_webm() if self is MediaContentType.VIDEO_MP_4: return video_mp_4() if self is MediaContentType.VIDEO_WEBM: return video_webm() + if self is MediaContentType.VIDEO_OGG: + return video_ogg() + if self is MediaContentType.VIDEO_MPEG: + return video_mpeg() + if self is MediaContentType.VIDEO_QUICKTIME: + return video_quicktime() + if self is MediaContentType.VIDEO_X_MSVIDEO: + return video_x_msvideo() + if self is MediaContentType.VIDEO_X_MATROSKA: + return video_x_matroska() if self is MediaContentType.TEXT_PLAIN: return text_plain() if self is MediaContentType.TEXT_HTML: @@ -117,12 +187,24 @@ def visit( return text_css() if self is MediaContentType.TEXT_CSV: return text_csv() + if self is MediaContentType.TEXT_MARKDOWN: + return text_markdown() + if self is MediaContentType.TEXT_X_PYTHON: + return text_x_python() + if self is MediaContentType.APPLICATION_JAVASCRIPT: + return application_javascript() + if self is MediaContentType.TEXT_X_TYPESCRIPT: + return text_x_typescript() + if self is MediaContentType.APPLICATION_X_YAML: + return application_x_yaml() if self is MediaContentType.APPLICATION_PDF: return application_pdf() if self is MediaContentType.APPLICATION_MSWORD: return application_msword() if self is MediaContentType.APPLICATION_MS_EXCEL: return application_ms_excel() + if self is MediaContentType.APPLICATION_OPENXML_SPREADSHEET: + return application_openxml_spreadsheet() if self is MediaContentType.APPLICATION_ZIP: return application_zip() if self is MediaContentType.APPLICATION_JSON: @@ -131,3 +213,19 @@ def visit( return application_xml() if self is MediaContentType.APPLICATION_OCTET_STREAM: return application_octet_stream() + if self is MediaContentType.APPLICATION_OPENXML_WORD: + return application_openxml_word() + if self is MediaContentType.APPLICATION_OPENXML_PRESENTATION: + return application_openxml_presentation() + if self is MediaContentType.APPLICATION_RTF: + return application_rtf() + if self is MediaContentType.APPLICATION_X_NDJSON: + return application_x_ndjson() + if self is MediaContentType.APPLICATION_PARQUET: + return application_parquet() + if self is MediaContentType.APPLICATION_GZIP: + return application_gzip() + if self is MediaContentType.APPLICATION_X_TAR: + return application_x_tar() + if self is MediaContentType.APPLICATION_X_7_Z_COMPRESSED: + return application_x_7_z_compressed() diff --git a/langfuse/api/resources/score_v_2/client.py b/langfuse/api/resources/score_v_2/client.py index e927b6c2b..04569dc3a 100644 --- a/langfuse/api/resources/score_v_2/client.py +++ b/langfuse/api/resources/score_v_2/client.py @@ -41,6 +41,8 @@ def get( score_ids: typing.Optional[str] = None, config_id: typing.Optional[str] = None, session_id: typing.Optional[str] = None, + dataset_run_id: typing.Optional[str] = None, + trace_id: typing.Optional[str] = None, queue_id: typing.Optional[str] = None, data_type: typing.Optional[ScoreDataType] = None, trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, @@ -90,6 +92,12 @@ def get( session_id : typing.Optional[str] Retrieve only scores with a specific sessionId. + dataset_run_id : typing.Optional[str] + Retrieve only scores with a specific datasetRunId. + + trace_id : typing.Optional[str] + Retrieve only scores with a specific traceId. + queue_id : typing.Optional[str] Retrieve only scores with a specific annotation queueId. @@ -141,6 +149,8 @@ def get( "scoreIds": score_ids, "configId": config_id, "sessionId": session_id, + "datasetRunId": dataset_run_id, + "traceId": trace_id, "queueId": queue_id, "dataType": data_type, "traceTags": trace_tags, @@ -259,6 +269,8 @@ async def get( score_ids: typing.Optional[str] = None, config_id: typing.Optional[str] = None, session_id: typing.Optional[str] = None, + dataset_run_id: typing.Optional[str] = None, + trace_id: typing.Optional[str] = None, queue_id: typing.Optional[str] = None, data_type: typing.Optional[ScoreDataType] = None, trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, @@ -308,6 +320,12 @@ async def get( session_id : typing.Optional[str] Retrieve only scores with a specific sessionId. + dataset_run_id : typing.Optional[str] + Retrieve only scores with a specific datasetRunId. + + trace_id : typing.Optional[str] + Retrieve only scores with a specific traceId. + queue_id : typing.Optional[str] Retrieve only scores with a specific annotation queueId. @@ -367,6 +385,8 @@ async def main() -> None: "scoreIds": score_ids, "configId": config_id, "sessionId": session_id, + "datasetRunId": dataset_run_id, + "traceId": trace_id, "queueId": queue_id, "dataType": data_type, "traceTags": trace_tags,