Skip to content

Commit a6b29d6

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse 79d11de (#924)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com>
1 parent 776955f commit a6b29d6

126 files changed

Lines changed: 4020 additions & 76 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.

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
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./types/index.js";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as LangfuseAPI from "../../../index.js";
6+
7+
export interface ArrayOptionsEvaluationRuleFilter {
8+
/** Column to filter on. */
9+
column: string;
10+
operator: LangfuseAPI.EvaluationRuleArrayOptionsFilterOperator;
11+
/** One or more array elements to match. */
12+
value: string[];
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as LangfuseAPI from "../../../index.js";
6+
7+
export interface BooleanEvaluationRuleFilter {
8+
/** Column to filter on. */
9+
column: string;
10+
operator: LangfuseAPI.EvaluationRuleBooleanFilterOperator;
11+
value: boolean;
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as LangfuseAPI from "../../../index.js";
6+
7+
export interface CategoryOptionsEvaluationRuleFilter {
8+
/** Object-valued column to filter on. */
9+
column: string;
10+
/** Key inside the object-valued column to filter on. */
11+
key: string;
12+
operator: LangfuseAPI.EvaluationRuleOptionsFilterOperator;
13+
value: string[];
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
/**
6+
* Code evaluator runtime language.
7+
*/
8+
export type CodeEvaluatorSourceCodeLanguage = "PYTHON" | "TYPESCRIPT";
9+
export const CodeEvaluatorSourceCodeLanguage = {
10+
Python: "PYTHON",
11+
Typescript: "TYPESCRIPT",
12+
} as const;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as LangfuseAPI from "../../../index.js";
6+
7+
export interface DateTimeEvaluationRuleFilter {
8+
/** Column to filter on. */
9+
column: string;
10+
/** Comparison operator for datetime values. */
11+
operator: LangfuseAPI.EvaluationRuleNumberFilterOperator;
12+
/** Datetime value to compare against. */
13+
value: string;
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
export type EvaluationRuleArrayOptionsFilterOperator =
6+
| "any of"
7+
| "none of"
8+
| "all of";
9+
export const EvaluationRuleArrayOptionsFilterOperator = {
10+
AnyOf: "any of",
11+
NoneOf: "none of",
12+
AllOf: "all of",
13+
} as const;
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 EvaluationRuleBooleanFilterOperator = "=" | "<>";
6+
export const EvaluationRuleBooleanFilterOperator = {
7+
Equals: "=",
8+
NotEquals: "<>",
9+
} as const;
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
* One filter condition used to decide whether a live-ingested observation should be evaluated.
9+
*
10+
* All filters must be satisfied for the rule to run. Experiment scope is expressed with filters rather than a separate target field:
11+
* - `isExperimentItemRootSpan = true` limits execution to experiment item roots.
12+
* - `datasetId` limits execution to experiments for the selected datasets. Use dataset IDs from `GET /api/public/v2/datasets`.
13+
*
14+
* Pick the filter `type` first, as it determines the required fields and value shape. Use `key` only for object filters such as `metadata`.
15+
*
16+
* Operator quick reference by filter `type`:
17+
* - `string`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`
18+
* - `number`: `"="`, `">"`, `"<"`, `">="`, `"<="`
19+
* - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
20+
* - `stringOptions`: `any of`, `none of`
21+
* - `arrayOptions`: `any of`, `none of`, `all of`
22+
* - `stringObject`: same operators as `string`
23+
* - `boolean`: `"="`, `"<>"`
24+
* - `null`: `is null`, `is not null`
25+
*
26+
* Supported columns. Each column accepts exactly one filter `type`; sending a column with a different `type` is rejected with `400`.
27+
* - `type`: `stringOptions`, values `SPAN`, `EVENT`, `GENERATION`, `AGENT`, `TOOL`, `CHAIN`, `RETRIEVER`, `EVALUATOR`, `EMBEDDING`, `GUARDRAIL`
28+
* - `name`: `stringOptions`
29+
* - `environment`: `stringOptions`
30+
* - `level`: `stringOptions`, values `DEBUG`, `DEFAULT`, `WARNING`, `ERROR`
31+
* - `version`: `string`
32+
* - `traceName`: `stringOptions`
33+
* - `userId`: `string`
34+
* - `sessionId`: `string`
35+
* - `tags`: `arrayOptions`
36+
* - `metadata`: `stringObject`, requires `key`
37+
* - `isRootObservation`: `boolean`; true when the observation has no parent or is explicitly marked as an application root
38+
* - `parentObservationId`: `null`
39+
* - `experimentId`: `stringOptions`
40+
* - `isExperimentItemRootSpan`: `boolean`
41+
* - `calledToolNames`: `arrayOptions`
42+
* - `toolCalls`: `number`, the number of tool calls on the observation
43+
* - `datasetId`: `stringOptions`. Use dataset `id` values from `GET /api/public/v2/datasets`, not dataset names.
44+
*
45+
* @example
46+
* {
47+
* type: "stringOptions",
48+
* column: "type",
49+
* operator: LangfuseAPI.EvaluationRuleOptionsFilterOperator.AnyOf,
50+
* value: ["GENERATION"]
51+
* }
52+
*
53+
* @example
54+
* {
55+
* type: "stringObject",
56+
* column: "metadata",
57+
* key: "customerTier",
58+
* operator: LangfuseAPI.EvaluationRuleStringFilterOperator.Equals,
59+
* value: "enterprise"
60+
* }
61+
*
62+
* @example
63+
* {
64+
* type: "null",
65+
* column: "parentObservationId",
66+
* operator: LangfuseAPI.EvaluationRuleNullFilterOperator.IsNull,
67+
* value: ""
68+
* }
69+
*
70+
* @example
71+
* {
72+
* type: "boolean",
73+
* column: "isRootObservation",
74+
* operator: LangfuseAPI.EvaluationRuleBooleanFilterOperator.Equals,
75+
* value: true
76+
* }
77+
*
78+
* @example
79+
* {
80+
* type: "arrayOptions",
81+
* column: "tags",
82+
* operator: LangfuseAPI.EvaluationRuleArrayOptionsFilterOperator.AnyOf,
83+
* value: ["production"]
84+
* }
85+
*
86+
* @example
87+
* {
88+
* type: "stringOptions",
89+
* column: "datasetId",
90+
* operator: LangfuseAPI.EvaluationRuleOptionsFilterOperator.AnyOf,
91+
* value: ["550e8400-e29b-41d4-a716-446655440000"]
92+
* }
93+
*/
94+
export type EvaluationRuleFilter =
95+
| LangfuseAPI.EvaluationRuleFilter.Datetime
96+
| LangfuseAPI.EvaluationRuleFilter.String
97+
| LangfuseAPI.EvaluationRuleFilter.Number
98+
| LangfuseAPI.EvaluationRuleFilter.StringOptions
99+
| LangfuseAPI.EvaluationRuleFilter.CategoryOptions
100+
| LangfuseAPI.EvaluationRuleFilter.ArrayOptions
101+
| LangfuseAPI.EvaluationRuleFilter.StringObject
102+
| LangfuseAPI.EvaluationRuleFilter.NumberObject
103+
| LangfuseAPI.EvaluationRuleFilter.Boolean
104+
| LangfuseAPI.EvaluationRuleFilter.Null;
105+
106+
export namespace EvaluationRuleFilter {
107+
export interface Datetime extends LangfuseAPI.DateTimeEvaluationRuleFilter {
108+
type: "datetime";
109+
}
110+
111+
export interface String extends LangfuseAPI.StringEvaluationRuleFilter {
112+
type: "string";
113+
}
114+
115+
export interface Number extends LangfuseAPI.NumberEvaluationRuleFilter {
116+
type: "number";
117+
}
118+
119+
export interface StringOptions
120+
extends LangfuseAPI.StringOptionsEvaluationRuleFilter {
121+
type: "stringOptions";
122+
}
123+
124+
export interface CategoryOptions
125+
extends LangfuseAPI.CategoryOptionsEvaluationRuleFilter {
126+
type: "categoryOptions";
127+
}
128+
129+
export interface ArrayOptions
130+
extends LangfuseAPI.ArrayOptionsEvaluationRuleFilter {
131+
type: "arrayOptions";
132+
}
133+
134+
export interface StringObject
135+
extends LangfuseAPI.StringObjectEvaluationRuleFilter {
136+
type: "stringObject";
137+
}
138+
139+
export interface NumberObject
140+
extends LangfuseAPI.NumberObjectEvaluationRuleFilter {
141+
type: "numberObject";
142+
}
143+
144+
export interface Boolean extends LangfuseAPI.BooleanEvaluationRuleFilter {
145+
type: "boolean";
146+
}
147+
148+
export interface Null extends LangfuseAPI.NullEvaluationRuleFilter {
149+
type: "null";
150+
}
151+
}

0 commit comments

Comments
 (0)