Skip to content

Commit 5f405bd

Browse files
authored
Merge branch 'main' into codex/fix-langchain-stream-events-ttft
2 parents e2bdd31 + baaeffb commit 5f405bd

173 files changed

Lines changed: 4505 additions & 200 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/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
55+
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
5656
with:
5757
languages: ${{ matrix.language }}
5858
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -70,7 +70,7 @@ jobs:
7070
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
7171
# If this step fails, then you should remove it and run the build manually (see below)
7272
- name: Autobuild
73-
uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
73+
uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
7474

7575
# ℹ️ Command-line programs to run using the OS shell.
7676
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -83,6 +83,6 @@ jobs:
8383
# ./location_of_script_within_repo/buildscript.sh
8484

8585
- name: Perform CodeQL Analysis
86-
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
86+
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
8787
with:
8888
category: "/language:${{matrix.language}}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "langfuse-js",
3-
"version": "5.10.1",
3+
"version": "5.11.0",
44
"description": "Langfuse JavaScript / TypeScript SDK",
55
"author": "Langfuse",
66
"license": "MIT",

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@langfuse/browser",
3-
"version": "5.10.1",
3+
"version": "5.11.0",
44
"description": "Langfuse browser SDK for public-key score ingestion",
55
"type": "module",
66
"sideEffects": false,

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@langfuse/client",
3-
"version": "5.10.1",
3+
"version": "5.11.0",
44
"description": "Langfuse API client for universal JavaScript environments",
55
"type": "module",
66
"sideEffects": false,

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@langfuse/core",
3-
"version": "5.10.1",
3+
"version": "5.11.0",
44
"description": "Core functions and utilities for Langfuse packages",
55
"type": "module",
66
"sideEffects": false,

packages/core/src/api/Client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { Comments } from "./api/resources/comments/client/Client.js";
1010
import { DatasetItems } from "./api/resources/datasetItems/client/Client.js";
1111
import { DatasetRunItems } from "./api/resources/datasetRunItems/client/Client.js";
1212
import { Datasets } from "./api/resources/datasets/client/Client.js";
13+
import { EvaluationRules } from "./api/resources/evaluationRules/client/Client.js";
14+
import { Evaluators } from "./api/resources/evaluators/client/Client.js";
1315
import { Experiments } from "./api/resources/experiments/client/Client.js";
1416
import { Feedback } from "./api/resources/feedback/client/Client.js";
1517
import { Health } from "./api/resources/health/client/Client.js";
@@ -84,6 +86,8 @@ export class LangfuseAPIClient {
8486
protected _datasetItems: DatasetItems | undefined;
8587
protected _datasetRunItems: DatasetRunItems | undefined;
8688
protected _datasets: Datasets | undefined;
89+
protected _evaluationRules: EvaluationRules | undefined;
90+
protected _evaluators: Evaluators | undefined;
8791
protected _experiments: Experiments | undefined;
8892
protected _feedback: Feedback | undefined;
8993
protected _health: Health | undefined;
@@ -147,6 +151,14 @@ export class LangfuseAPIClient {
147151
return (this._datasets ??= new Datasets(this._options));
148152
}
149153

154+
public get evaluationRules(): EvaluationRules {
155+
return (this._evaluationRules ??= new EvaluationRules(this._options));
156+
}
157+
158+
public get evaluators(): Evaluators {
159+
return (this._evaluators ??= new Evaluators(this._options));
160+
}
161+
150162
public get experiments(): Experiments {
151163
return (this._experiments ??= new Experiments(this._options));
152164
}

packages/core/src/api/api/resources/commons/types/Model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as LangfuseAPI from "../../../index.js";
99
*
1010
* Models can have either simple flat pricing or tiered pricing:
1111
* - Flat pricing: Single price per usage type (legacy, but still supported)
12-
* - Tiered pricing: Multiple pricing tiers with conditional matching based on usage patterns
12+
* - Tiered pricing: Multiple pricing tiers with conditional matching based on usage patterns or observation attributes
1313
*
1414
* The pricing tiers approach is recommended for models with usage-based pricing variations.
1515
* When using tiered pricing, the flat price fields (inputPrice, outputPrice, prices) are populated
@@ -46,10 +46,10 @@ export interface Model {
4646
*/
4747
prices: Record<string, LangfuseAPI.ModelPrice>;
4848
/**
49-
* Array of pricing tiers with conditional pricing based on usage thresholds.
49+
* Array of pricing tiers with conditional pricing based on usage thresholds or observation attributes.
5050
*
5151
* Pricing tiers enable accurate cost tracking for models that charge different rates based on usage patterns
52-
* (e.g., different rates for high-volume usage, large context windows, or cached tokens).
52+
* or request attributes (e.g., high-volume usage, large context windows, cached tokens, or service tiers).
5353
*
5454
* Each model must have exactly one default tier (isDefault=true, priority=0) that serves as a fallback.
5555
* Additional conditional tiers can be defined with specific matching criteria.

packages/core/src/api/api/resources/commons/types/PricingTier.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import * as LangfuseAPI from "../../../index.js";
66

77
/**
8-
* Pricing tier definition with conditional pricing based on usage thresholds.
8+
* Pricing tier definition with conditional pricing based on usage thresholds or observation attributes.
99
*
10-
* Pricing tiers enable accurate cost tracking for LLM providers that charge different rates based on usage patterns.
11-
* For example, some providers charge higher rates when context size exceeds certain thresholds.
10+
* Pricing tiers enable accurate cost tracking for LLM providers that charge different rates based on usage patterns or request attributes.
11+
* For example, some providers charge higher rates when context size exceeds certain thresholds or when an accelerated service tier is selected.
1212
*
1313
* How tier matching works:
1414
* 1. Tiers are evaluated in ascending priority order (priority 1 before priority 2, etc.)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as LangfuseAPI from "../../../index.js";
6+
7+
/**
8+
* Condition that matches any configured value for a top-level observation attribute.
9+
*/
10+
export interface PricingTierAttributeCondition {
11+
/** Observation attribute object evaluated by this condition. */
12+
source: LangfuseAPI.PricingTierAttributeSource;
13+
/** Exact top-level attribute key. */
14+
key: string;
15+
/** Membership operator. */
16+
operator: "in";
17+
/** Accepted string attribute values. At least one value is required. */
18+
values: string[];
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
export type PricingTierAttributeSource = "model_parameters" | "metadata";
6+
export const PricingTierAttributeSource = {
7+
ModelParameters: "model_parameters",
8+
Metadata: "metadata",
9+
} as const;

0 commit comments

Comments
 (0)