Skip to content

Commit aaebde4

Browse files
authored
Merge branch 'main' into main
2 parents 1c2b8ab + 96b2bf8 commit aaebde4

89 files changed

Lines changed: 10736 additions & 2169 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Python
3131
uses: actions/setup-python@v4
3232
with:
33-
python-version: "3.12"
33+
python-version: "3.13"
3434
- name: Install poetry
3535
uses: abatilo/actions-poetry@v2
3636
- name: Setup a local virtual environment
@@ -58,7 +58,7 @@ jobs:
5858
runs-on: ubuntu-latest
5959
timeout-minutes: 30
6060
env:
61-
LANGFUSE_HOST: "http://localhost:3000"
61+
LANGFUSE_BASE_URL: "http://localhost:3000"
6262
LANGFUSE_PUBLIC_KEY: "pk-lf-1234567890"
6363
LANGFUSE_SECRET_KEY: "sk-lf-1234567890"
6464
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -69,9 +69,10 @@ jobs:
6969
fail-fast: false
7070
matrix:
7171
python-version:
72-
- "3.9"
7372
- "3.10"
7473
- "3.11"
74+
- "3.12"
75+
- "3.13"
7576

7677
name: Test on Python version ${{ matrix.python-version }}
7778
steps:
@@ -87,7 +88,7 @@ jobs:
8788
- name: Setup node (for langfuse server)
8889
uses: actions/setup-node@v3
8990
with:
90-
node-version: 20
91+
node-version: 24
9192

9293
- name: Cache langfuse server dependencies
9394
uses: actions/cache@v3

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.3.2
3+
rev: v0.14.4
44
hooks:
55
# Run the linter and fix
66
- id: ruff
@@ -10,9 +10,10 @@ repos:
1010
# Run the formatter.
1111
- id: ruff-format
1212
types_or: [python, pyi, jupyter]
13+
args: [--config=ci.ruff.toml]
1314

1415
- repo: https://github.com/pre-commit/mirrors-mypy
15-
rev: v1.8.0
16+
rev: v1.18.2
1617
hooks:
1718
- id: mypy
1819
additional_dependencies:

langfuse/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
""".. include:: ../README.md"""
22

3+
from langfuse.batch_evaluation import (
4+
BatchEvaluationResult,
5+
BatchEvaluationResumeToken,
6+
CompositeEvaluatorFunction,
7+
EvaluatorInputs,
8+
EvaluatorStats,
9+
MapperFunction,
10+
)
311
from langfuse.experiment import Evaluation
412

513
from ._client import client as _client_module
614
from ._client.attributes import LangfuseOtelSpanAttributes
715
from ._client.constants import ObservationTypeLiteral
816
from ._client.get_client import get_client
917
from ._client.observe import observe
18+
from ._client.propagation import propagate_attributes
1019
from ._client.span import (
1120
LangfuseAgent,
1221
LangfuseChain,
@@ -26,6 +35,7 @@
2635
"Langfuse",
2736
"get_client",
2837
"observe",
38+
"propagate_attributes",
2939
"ObservationTypeLiteral",
3040
"LangfuseSpan",
3141
"LangfuseGeneration",
@@ -39,6 +49,12 @@
3949
"LangfuseRetriever",
4050
"LangfuseGuardrail",
4151
"Evaluation",
52+
"EvaluatorInputs",
53+
"MapperFunction",
54+
"CompositeEvaluatorFunction",
55+
"EvaluatorStats",
56+
"BatchEvaluationResumeToken",
57+
"BatchEvaluationResult",
4258
"experiment",
4359
"api",
4460
]

langfuse/_client/attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
ObservationTypeGenerationLike,
1919
ObservationTypeSpanLike,
2020
)
21-
2221
from langfuse._utils.serializer import EventSerializer
2322
from langfuse.model import PromptClient
2423
from langfuse.types import MapValue, SpanLevel
@@ -60,6 +59,17 @@ class LangfuseOtelSpanAttributes:
6059
# Internal
6160
AS_ROOT = "langfuse.internal.as_root"
6261

62+
# Experiments
63+
EXPERIMENT_ID = "langfuse.experiment.id"
64+
EXPERIMENT_NAME = "langfuse.experiment.name"
65+
EXPERIMENT_DESCRIPTION = "langfuse.experiment.description"
66+
EXPERIMENT_METADATA = "langfuse.experiment.metadata"
67+
EXPERIMENT_DATASET_ID = "langfuse.experiment.dataset.id"
68+
EXPERIMENT_ITEM_ID = "langfuse.experiment.item.id"
69+
EXPERIMENT_ITEM_EXPECTED_OUTPUT = "langfuse.experiment.item.expected_output"
70+
EXPERIMENT_ITEM_METADATA = "langfuse.experiment.item.metadata"
71+
EXPERIMENT_ITEM_ROOT_OBSERVATION_ID = "langfuse.experiment.item.root_observation_id"
72+
6373

6474
def create_trace_attributes(
6575
*,

0 commit comments

Comments
 (0)