Skip to content

Commit df63577

Browse files
authored
feat!: prepare v4 release (#1486)
1 parent cfd3ac1 commit df63577

File tree

634 files changed

+45317
-37176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

634 files changed

+45317
-37176
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
- "3.11"
7272
- "3.12"
7373
- "3.13"
74+
- "3.14"
7475

7576
name: Test on Python version ${{ matrix.python-version }}
7677
steps:

langfuse/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
LangfuseSpan,
2929
LangfuseTool,
3030
)
31+
from .span_filter import (
32+
KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES,
33+
is_default_export_span,
34+
is_genai_span,
35+
is_known_llm_instrumentor,
36+
is_langfuse_span,
37+
)
3138

3239
Langfuse = _client_module.Langfuse
3340

@@ -55,6 +62,11 @@
5562
"EvaluatorStats",
5663
"BatchEvaluationResumeToken",
5764
"BatchEvaluationResult",
65+
"is_default_export_span",
66+
"is_langfuse_span",
67+
"is_genai_span",
68+
"is_known_llm_instrumentor",
69+
"KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES",
5870
"experiment",
5971
"api",
6072
]

langfuse/_client/attributes.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212

1313
import json
1414
from datetime import datetime
15-
from typing import Any, Dict, List, Literal, Optional, Union
15+
from typing import Any, Dict, Literal, Optional, Union
1616

1717
from langfuse._client.constants import (
1818
ObservationTypeGenerationLike,
1919
ObservationTypeSpanLike,
2020
)
2121
from langfuse._utils.serializer import EventSerializer
22+
from langfuse.api import MapValue
2223
from langfuse.model import PromptClient
23-
from langfuse.types import MapValue, SpanLevel
24+
from langfuse.types import SpanLevel
2425

2526

2627
class LangfuseOtelSpanAttributes:
@@ -73,28 +74,14 @@ class LangfuseOtelSpanAttributes:
7374

7475
def create_trace_attributes(
7576
*,
76-
name: Optional[str] = None,
77-
user_id: Optional[str] = None,
78-
session_id: Optional[str] = None,
79-
version: Optional[str] = None,
80-
release: Optional[str] = None,
8177
input: Optional[Any] = None,
8278
output: Optional[Any] = None,
83-
metadata: Optional[Any] = None,
84-
tags: Optional[List[str]] = None,
8579
public: Optional[bool] = None,
8680
) -> dict:
8781
attributes = {
88-
LangfuseOtelSpanAttributes.TRACE_NAME: name,
89-
LangfuseOtelSpanAttributes.TRACE_USER_ID: user_id,
90-
LangfuseOtelSpanAttributes.TRACE_SESSION_ID: session_id,
91-
LangfuseOtelSpanAttributes.VERSION: version,
92-
LangfuseOtelSpanAttributes.RELEASE: release,
9382
LangfuseOtelSpanAttributes.TRACE_INPUT: _serialize(input),
9483
LangfuseOtelSpanAttributes.TRACE_OUTPUT: _serialize(output),
95-
LangfuseOtelSpanAttributes.TRACE_TAGS: tags,
9684
LangfuseOtelSpanAttributes.TRACE_PUBLIC: public,
97-
**_flatten_and_serialize_metadata(metadata, "trace"),
9885
}
9986

10087
return {k: v for k, v in attributes.items() if v is not None}

0 commit comments

Comments
 (0)