Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ScoreConfig {
createdAt: string;
updatedAt: string;
projectId: string;
dataType: LangfuseAPI.ScoreDataType;
dataType: LangfuseAPI.ScoreConfigDataType;
/** Whether the score config is archived. Defaults to false */
isArchived: boolean;
/** Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞ */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type ScoreConfigDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL";
export const ScoreConfigDataType = {
Numeric: "NUMERIC",
Boolean: "BOOLEAN",
Categorical: "CATEGORICAL",
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
* This file was auto-generated by Fern from our API Definition.
*/

export type ScoreDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL";
export type ScoreDataType =
| "NUMERIC"
| "BOOLEAN"
| "CATEGORICAL"
| "CORRECTION";
export const ScoreDataType = {
Numeric: "NUMERIC",
Boolean: "BOOLEAN",
Categorical: "CATEGORICAL",
Correction: "CORRECTION",
} as const;
1 change: 1 addition & 0 deletions packages/core/src/api/api/resources/commons/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export * from "./MapValue.js";
export * from "./CommentObjectType.js";
export * from "./DatasetStatus.js";
export * from "./ScoreSource.js";
export * from "./ScoreConfigDataType.js";
export * from "./ScoreDataType.js";
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface ScoreBody {
sessionId?: string;
observationId?: string;
datasetRunId?: string;
/** The name of the score. Always overrides "output" for correction scores. */
name: string;
environment?: string;
/** The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. */
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/api/api/resources/metrics/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export class Metrics {
/**
* Get metrics from the Langfuse project using a query object.
*
* Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance.
*
* For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
*
* @param {LangfuseAPI.GetMetricsRequest} request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export class Observations {
}

/**
* Get a list of observations
* Get a list of observations.
*
* Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection.
*
* @param {LangfuseAPI.GetObservationsRequest} request
* @param {Observations.RequestOptions} requestOptions - Request-specific configuration.
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/api/api/resources/projects/types/Organization.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface Organization {
/** The unique identifier of the organization */
id: string;
/** The name of the organization */
name: string;
}
4 changes: 4 additions & 0 deletions packages/core/src/api/api/resources/projects/types/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as LangfuseAPI from "../../../index.js";

export interface Project {
id: string;
name: string;
/** The organization this project belongs to */
organization: LangfuseAPI.Organization;
/** Metadata for the project */
metadata: Record<string, unknown>;
/** Number of days to retain data. Null or 0 means no retention. Omitted if no retention is configured. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./Projects.js";
export * from "./Organization.js";
export * from "./Project.js";
export * from "./ProjectDeletionResponse.js";
export * from "./ApiKeyList.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as LangfuseAPI from "../../../index.js";

export interface CreateScoreConfigRequest {
name: string;
dataType: LangfuseAPI.ScoreDataType;
dataType: LangfuseAPI.ScoreConfigDataType;
/** Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed */
categories?: LangfuseAPI.ConfigCategory[];
/** Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞ */
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/api/api/resources/scoreV2/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class ScoreV2 {
queueId,
dataType,
traceTags,
fields,
} = request;
const _queryParams: Record<
string,
Expand Down Expand Up @@ -192,6 +193,10 @@ export class ScoreV2 {
}
}

if (fields != null) {
_queryParams["fields"] = fields;
}

let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ export interface GetScoresRequest {
dataType?: LangfuseAPI.ScoreDataType;
/** Only scores linked to traces that include all of these tags will be returned. */
traceTags?: string | string[];
/** Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. */
fields?: string;
}
Loading