langfuse
Version:
1 lines • 166 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../src/storage.ts","../src/publicApi.ts","../src/langfuse.ts","../src/openai/LangfuseSingleton.ts","../src/openai/parseOpenAI.ts","../src/openai/utils.ts","../src/openai/traceMethod.ts","../src/openai/observeOpenAI.ts"],"sourcesContent":["import { type LangfuseOptions } from \"./types\";\n\nexport type LangfuseStorage = {\n getItem: (key: string) => string | null | undefined;\n setItem: (key: string, value: string) => void;\n removeItem: (key: string) => void;\n clear: () => void;\n getAllKeys: () => readonly string[];\n};\n\n// Methods partially borrowed from quirksmode.org/js/cookies.html\nexport const cookieStore: LangfuseStorage = {\n getItem(key) {\n try {\n const nameEQ = key + \"=\";\n const ca = document.cookie.split(\";\");\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == \" \") {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n }\n } catch (err) {}\n return null;\n },\n\n setItem(key: string, value: string) {\n try {\n const cdomain = \"\",\n expires = \"\",\n secure = \"\";\n\n const new_cookie_val = key + \"=\" + encodeURIComponent(value) + expires + \"; path=/\" + cdomain + secure;\n document.cookie = new_cookie_val;\n } catch (err) {\n return;\n }\n },\n\n removeItem(name) {\n try {\n cookieStore.setItem(name, \"\");\n } catch (err) {\n return;\n }\n },\n clear() {\n document.cookie = \"\";\n },\n getAllKeys() {\n const ca = document.cookie.split(\";\");\n const keys = [];\n\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == \" \") {\n c = c.substring(1, c.length);\n }\n keys.push(c.split(\"=\")[0]);\n }\n\n return keys;\n },\n};\n\nconst createStorageLike = (store: any): LangfuseStorage => {\n return {\n getItem(key) {\n return store.getItem(key);\n },\n\n setItem(key, value) {\n store.setItem(key, value);\n },\n\n removeItem(key) {\n store.removeItem(key);\n },\n clear() {\n store.clear();\n },\n getAllKeys() {\n const keys = [];\n for (const key in localStorage) {\n keys.push(key);\n }\n return keys;\n },\n };\n};\n\nconst checkStoreIsSupported = (storage: LangfuseStorage, key = \"__mplssupport__\"): boolean => {\n if (!window) {\n return false;\n }\n try {\n const val = \"xyz\";\n storage.setItem(key, val);\n if (storage.getItem(key) !== val) {\n return false;\n }\n storage.removeItem(key);\n return true;\n } catch (err) {\n return false;\n }\n};\n\nlet localStore: LangfuseStorage | undefined = undefined;\nlet sessionStore: LangfuseStorage | undefined = undefined;\n\nconst createMemoryStorage = (): LangfuseStorage => {\n const _cache: { [key: string]: any | undefined } = {};\n\n const store: LangfuseStorage = {\n getItem(key) {\n return _cache[key];\n },\n\n setItem(key, value) {\n _cache[key] = value !== null ? value : undefined;\n },\n\n removeItem(key) {\n delete _cache[key];\n },\n clear() {\n for (const key in _cache) {\n delete _cache[key];\n }\n },\n getAllKeys() {\n const keys = [];\n for (const key in _cache) {\n keys.push(key);\n }\n return keys;\n },\n };\n return store;\n};\n\nexport const getStorage = (type: LangfuseOptions[\"persistence\"], window: Window | undefined): LangfuseStorage => {\n if (typeof window !== undefined && window) {\n if (!localStorage) {\n const _localStore = createStorageLike(window.localStorage);\n localStore = checkStoreIsSupported(_localStore) ? _localStore : undefined;\n }\n\n if (!sessionStore) {\n const _sessionStore = createStorageLike(window.sessionStorage);\n sessionStore = checkStoreIsSupported(_sessionStore) ? _sessionStore : undefined;\n }\n }\n\n switch (type) {\n case \"cookie\":\n return cookieStore || localStore || sessionStore || createMemoryStorage();\n case \"localStorage\":\n return localStore || sessionStore || createMemoryStorage();\n case \"sessionStorage\":\n return sessionStore || createMemoryStorage();\n case \"memory\":\n return createMemoryStorage();\n default:\n return createMemoryStorage();\n }\n};\n","/* eslint-disable */\n/* tslint:disable */\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\n/** AnnotationQueueStatus */\nexport type ApiAnnotationQueueStatus = \"PENDING\" | \"COMPLETED\";\n\n/** AnnotationQueueObjectType */\nexport type ApiAnnotationQueueObjectType = \"TRACE\" | \"OBSERVATION\";\n\n/** AnnotationQueue */\nexport interface ApiAnnotationQueue {\n id: string;\n name: string;\n description?: string | null;\n scoreConfigIds: string[];\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n}\n\n/** AnnotationQueueItem */\nexport interface ApiAnnotationQueueItem {\n id: string;\n queueId: string;\n objectId: string;\n objectType: ApiAnnotationQueueObjectType;\n status: ApiAnnotationQueueStatus;\n /** @format date-time */\n completedAt?: string | null;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n}\n\n/** PaginatedAnnotationQueues */\nexport interface ApiPaginatedAnnotationQueues {\n data: ApiAnnotationQueue[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** PaginatedAnnotationQueueItems */\nexport interface ApiPaginatedAnnotationQueueItems {\n data: ApiAnnotationQueueItem[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** CreateAnnotationQueueItemRequest */\nexport interface ApiCreateAnnotationQueueItemRequest {\n objectId: string;\n objectType: ApiAnnotationQueueObjectType;\n /** Defaults to PENDING for new queue items */\n status?: ApiAnnotationQueueStatus | null;\n}\n\n/** UpdateAnnotationQueueItemRequest */\nexport interface ApiUpdateAnnotationQueueItemRequest {\n status?: ApiAnnotationQueueStatus | null;\n}\n\n/** DeleteAnnotationQueueItemResponse */\nexport interface ApiDeleteAnnotationQueueItemResponse {\n success: boolean;\n message: string;\n}\n\n/** CreateCommentRequest */\nexport interface ApiCreateCommentRequest {\n /** The id of the project to attach the comment to. */\n projectId: string;\n /** The type of the object to attach the comment to (trace, observation, session, prompt). */\n objectType: string;\n /** The id of the object to attach the comment to. If this does not reference a valid existing object, an error will be thrown. */\n objectId: string;\n /** The content of the comment. May include markdown. Currently limited to 3000 characters. */\n content: string;\n /** The id of the user who created the comment. */\n authorUserId?: string | null;\n}\n\n/** CreateCommentResponse */\nexport interface ApiCreateCommentResponse {\n /** The id of the created object in Langfuse */\n id: string;\n}\n\n/** GetCommentsResponse */\nexport interface ApiGetCommentsResponse {\n data: ApiComment[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** Trace */\nexport interface ApiTrace {\n /** The unique identifier of a trace */\n id: string;\n /**\n * The timestamp when the trace was created\n * @format date-time\n */\n timestamp: string;\n /** The name of the trace */\n name?: string | null;\n /** The input data of the trace. Can be any JSON. */\n input?: any;\n /** The output data of the trace. Can be any JSON. */\n output?: any;\n /** The session identifier associated with the trace */\n sessionId?: string | null;\n /** The release version of the application when the trace was created */\n release?: string | null;\n /** The version of the trace */\n version?: string | null;\n /** The user identifier associated with the trace */\n userId?: string | null;\n /** The metadata associated with the trace. Can be any JSON. */\n metadata?: any;\n /** The tags associated with the trace. Can be an array of strings or null. */\n tags?: string[] | null;\n /** Public traces are accessible via url without login */\n public?: boolean | null;\n /** The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */\n environment?: string | null;\n}\n\n/** TraceWithDetails */\nexport type ApiTraceWithDetails = ApiTrace & {\n /** Path of trace in Langfuse UI */\n htmlPath: string;\n /**\n * Latency of trace in seconds\n * @format double\n */\n latency: number;\n /**\n * Cost of trace in USD\n * @format double\n */\n totalCost: number;\n /** List of observation ids */\n observations: string[];\n /** List of score ids */\n scores: string[];\n};\n\n/** TraceWithFullDetails */\nexport type ApiTraceWithFullDetails = ApiTrace & {\n /** Path of trace in Langfuse UI */\n htmlPath: string;\n /**\n * Latency of trace in seconds\n * @format double\n */\n latency: number;\n /**\n * Cost of trace in USD\n * @format double\n */\n totalCost: number;\n /** List of observations */\n observations: ApiObservationsView[];\n /** List of scores */\n scores: ApiScore[];\n};\n\n/** Session */\nexport interface ApiSession {\n id: string;\n /** @format date-time */\n createdAt: string;\n projectId: string;\n /** The environment from which this session originated. */\n environment?: string | null;\n}\n\n/** SessionWithTraces */\nexport type ApiSessionWithTraces = ApiSession & {\n traces: ApiTrace[];\n};\n\n/** Observation */\nexport interface ApiObservation {\n /** The unique identifier of the observation */\n id: string;\n /** The trace ID associated with the observation */\n traceId?: string | null;\n /** The type of the observation */\n type: string;\n /** The name of the observation */\n name?: string | null;\n /**\n * The start time of the observation\n * @format date-time\n */\n startTime: string;\n /**\n * The end time of the observation.\n * @format date-time\n */\n endTime?: string | null;\n /**\n * The completion start time of the observation\n * @format date-time\n */\n completionStartTime?: string | null;\n /** The model used for the observation */\n model?: string | null;\n /** The parameters of the model used for the observation */\n modelParameters?: Record<string, ApiMapValue>;\n /** The input data of the observation */\n input?: any;\n /** The version of the observation */\n version?: string | null;\n /** Additional metadata of the observation */\n metadata?: any;\n /** The output data of the observation */\n output?: any;\n /** (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation */\n usage?: ApiUsage | null;\n /** The level of the observation */\n level: ApiObservationLevel;\n /** The status message of the observation */\n statusMessage?: string | null;\n /** The parent observation ID */\n parentObservationId?: string | null;\n /** The prompt ID associated with the observation */\n promptId?: string | null;\n /** The usage details of the observation. Key is the name of the usage metric, value is the number of units consumed. The total key is the sum of all (non-total) usage metrics or the total value ingested. */\n usageDetails?: Record<string, number>;\n /** The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested. */\n costDetails?: Record<string, number>;\n /** The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */\n environment?: string | null;\n}\n\n/** ObservationsView */\nexport type ApiObservationsView = ApiObservation & {\n /** The name of the prompt associated with the observation */\n promptName?: string | null;\n /** The version of the prompt associated with the observation */\n promptVersion?: number | null;\n /** The unique identifier of the model */\n modelId?: string | null;\n /**\n * The price of the input in USD\n * @format double\n */\n inputPrice?: number | null;\n /**\n * The price of the output in USD.\n * @format double\n */\n outputPrice?: number | null;\n /**\n * The total price in USD.\n * @format double\n */\n totalPrice?: number | null;\n /**\n * (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the input in USD\n * @format double\n */\n calculatedInputCost?: number | null;\n /**\n * (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the output in USD\n * @format double\n */\n calculatedOutputCost?: number | null;\n /**\n * (Deprecated. Use usageDetails and costDetails instead.) The calculated total cost in USD\n * @format double\n */\n calculatedTotalCost?: number | null;\n /**\n * The latency in seconds.\n * @format double\n */\n latency?: number | null;\n /**\n * The time to the first token in seconds\n * @format double\n */\n timeToFirstToken?: number | null;\n};\n\n/**\n * Usage\n * (Deprecated. Use usageDetails and costDetails instead.) Standard interface for usage and cost\n */\nexport interface ApiUsage {\n /** Number of input units (e.g. tokens) */\n input?: number | null;\n /** Number of output units (e.g. tokens) */\n output?: number | null;\n /** Defaults to input+output if not set */\n total?: number | null;\n /** Unit of usage in Langfuse */\n unit?: ApiModelUsageUnit | null;\n /**\n * USD input cost\n * @format double\n */\n inputCost?: number | null;\n /**\n * USD output cost\n * @format double\n */\n outputCost?: number | null;\n /**\n * USD total cost, defaults to input+output\n * @format double\n */\n totalCost?: number | null;\n}\n\n/**\n * ScoreConfig\n * Configuration for a score\n */\nexport interface ApiScoreConfig {\n id: string;\n name: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n projectId: string;\n dataType: ApiScoreDataType;\n /** Whether the score config is archived. Defaults to false */\n isArchived: boolean;\n /**\n * Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞\n * @format double\n */\n minValue?: number | null;\n /**\n * Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞\n * @format double\n */\n maxValue?: number | null;\n /** Configures custom categories for categorical scores */\n categories?: ApiConfigCategory[] | null;\n description?: string | null;\n}\n\n/** ConfigCategory */\nexport interface ApiConfigCategory {\n /** @format double */\n value: number;\n label: string;\n}\n\n/** BaseScore */\nexport interface ApiBaseScore {\n id: string;\n traceId: string;\n name: string;\n source: ApiScoreSource;\n observationId?: string | null;\n /** @format date-time */\n timestamp: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n authorUserId?: string | null;\n comment?: string | null;\n /** Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range */\n configId?: string | null;\n /** Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue. */\n queueId?: string | null;\n /** The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */\n environment?: string | null;\n}\n\n/** NumericScore */\nexport type ApiNumericScore = ApiBaseScore & {\n /**\n * The numeric value of the score\n * @format double\n */\n value: number;\n};\n\n/** BooleanScore */\nexport type ApiBooleanScore = ApiBaseScore & {\n /**\n * The numeric value of the score. Equals 1 for \"True\" and 0 for \"False\"\n * @format double\n */\n value: number;\n /** The string representation of the score value. Is inferred from the numeric value and equals \"True\" or \"False\" */\n stringValue: string;\n};\n\n/** CategoricalScore */\nexport type ApiCategoricalScore = ApiBaseScore & {\n /**\n * Only defined if a config is linked. Represents the numeric category mapping of the stringValue\n * @format double\n */\n value?: number | null;\n /** The string representation of the score value. If no config is linked, can be any string. Otherwise, must map to a config category */\n stringValue: string;\n};\n\n/** Score */\nexport type ApiScore =\n | ({\n dataType: \"NUMERIC\";\n } & ApiNumericScore)\n | ({\n dataType: \"CATEGORICAL\";\n } & ApiCategoricalScore)\n | ({\n dataType: \"BOOLEAN\";\n } & ApiBooleanScore);\n\n/**\n * CreateScoreValue\n * The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores\n */\nexport type ApiCreateScoreValue = number | string;\n\n/** Comment */\nexport interface ApiComment {\n id: string;\n projectId: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n objectType: ApiCommentObjectType;\n objectId: string;\n content: string;\n authorUserId?: string | null;\n}\n\n/** Dataset */\nexport interface ApiDataset {\n id: string;\n name: string;\n description?: string | null;\n metadata?: any;\n projectId: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n}\n\n/** DatasetItem */\nexport interface ApiDatasetItem {\n id: string;\n status: ApiDatasetStatus;\n input?: any;\n expectedOutput?: any;\n metadata?: any;\n sourceTraceId?: string | null;\n sourceObservationId?: string | null;\n datasetId: string;\n datasetName: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n}\n\n/** DatasetRunItem */\nexport interface ApiDatasetRunItem {\n id: string;\n datasetRunId: string;\n datasetRunName: string;\n datasetItemId: string;\n traceId: string;\n observationId?: string | null;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt: string;\n}\n\n/** DatasetRun */\nexport interface ApiDatasetRun {\n /** Unique identifier of the dataset run */\n id: string;\n /** Name of the dataset run */\n name: string;\n /** Description of the run */\n description?: string | null;\n /** Metadata of the dataset run */\n metadata?: any;\n /** Id of the associated dataset */\n datasetId: string;\n /** Name of the associated dataset */\n datasetName: string;\n /**\n * The date and time when the dataset run was created\n * @format date-time\n */\n createdAt: string;\n /**\n * The date and time when the dataset run was last updated\n * @format date-time\n */\n updatedAt: string;\n}\n\n/** DatasetRunWithItems */\nexport type ApiDatasetRunWithItems = ApiDatasetRun & {\n datasetRunItems: ApiDatasetRunItem[];\n};\n\n/**\n * Model\n * Model definition used for transforming usage into USD cost and/or tokenization.\n */\nexport interface ApiModel {\n id: string;\n /** Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime */\n modelName: string;\n /** Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$` */\n matchPattern: string;\n /**\n * Apply only to generations which are newer than this ISO date.\n * @format date-time\n */\n startDate?: string | null;\n /** Unit used by this model. */\n unit?: ApiModelUsageUnit | null;\n /**\n * Price (USD) per input unit\n * @format double\n */\n inputPrice?: number | null;\n /**\n * Price (USD) per output unit\n * @format double\n */\n outputPrice?: number | null;\n /**\n * Price (USD) per total unit. Cannot be set if input or output price is set.\n * @format double\n */\n totalPrice?: number | null;\n /** Optional. Tokenizer to be applied to observations which match to this model. See docs for more details. */\n tokenizerId?: string | null;\n /** Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details. */\n tokenizerConfig?: any;\n isLangfuseManaged: boolean;\n}\n\n/**\n * ModelUsageUnit\n * Unit of usage in Langfuse\n */\nexport type ApiModelUsageUnit = \"CHARACTERS\" | \"TOKENS\" | \"MILLISECONDS\" | \"SECONDS\" | \"IMAGES\" | \"REQUESTS\";\n\n/** ObservationLevel */\nexport type ApiObservationLevel = \"DEBUG\" | \"DEFAULT\" | \"WARNING\" | \"ERROR\";\n\n/** MapValue */\nexport type ApiMapValue = string | null | number | null | boolean | null | string[] | null;\n\n/** CommentObjectType */\nexport type ApiCommentObjectType = \"TRACE\" | \"OBSERVATION\" | \"SESSION\" | \"PROMPT\";\n\n/** DatasetStatus */\nexport type ApiDatasetStatus = \"ACTIVE\" | \"ARCHIVED\";\n\n/** ScoreSource */\nexport type ApiScoreSource = \"ANNOTATION\" | \"API\" | \"EVAL\";\n\n/** ScoreDataType */\nexport type ApiScoreDataType = \"NUMERIC\" | \"BOOLEAN\" | \"CATEGORICAL\";\n\n/** DeleteDatasetItemResponse */\nexport interface ApiDeleteDatasetItemResponse {\n /** Success message after deletion */\n message: string;\n}\n\n/** CreateDatasetItemRequest */\nexport interface ApiCreateDatasetItemRequest {\n datasetName: string;\n input?: any;\n expectedOutput?: any;\n metadata?: any;\n sourceTraceId?: string | null;\n sourceObservationId?: string | null;\n /** Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets. */\n id?: string | null;\n /** Defaults to ACTIVE for newly created items */\n status?: ApiDatasetStatus | null;\n}\n\n/** PaginatedDatasetItems */\nexport interface ApiPaginatedDatasetItems {\n data: ApiDatasetItem[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** CreateDatasetRunItemRequest */\nexport interface ApiCreateDatasetRunItemRequest {\n runName: string;\n /** Description of the run. If run exists, description will be updated. */\n runDescription?: string | null;\n /** Metadata of the dataset run, updates run if run already exists */\n metadata?: any;\n datasetItemId: string;\n observationId?: string | null;\n /** traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId. */\n traceId?: string | null;\n}\n\n/** PaginatedDatasets */\nexport interface ApiPaginatedDatasets {\n data: ApiDataset[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** CreateDatasetRequest */\nexport interface ApiCreateDatasetRequest {\n name: string;\n description?: string | null;\n metadata?: any;\n}\n\n/** PaginatedDatasetRuns */\nexport interface ApiPaginatedDatasetRuns {\n data: ApiDatasetRun[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** DeleteDatasetRunResponse */\nexport interface ApiDeleteDatasetRunResponse {\n message: string;\n}\n\n/** HealthResponse */\nexport interface ApiHealthResponse {\n /**\n * Langfuse server version\n * @example \"1.25.0\"\n */\n version: string;\n /** @example \"OK\" */\n status: string;\n}\n\n/** IngestionEvent */\nexport type ApiIngestionEvent =\n | ({\n type: \"trace-create\";\n } & ApiTraceEvent)\n | ({\n type: \"score-create\";\n } & ApiScoreEvent)\n | ({\n type: \"span-create\";\n } & ApiCreateSpanEvent)\n | ({\n type: \"span-update\";\n } & ApiUpdateSpanEvent)\n | ({\n type: \"generation-create\";\n } & ApiCreateGenerationEvent)\n | ({\n type: \"generation-update\";\n } & ApiUpdateGenerationEvent)\n | ({\n type: \"event-create\";\n } & ApiCreateEventEvent)\n | ({\n type: \"sdk-log\";\n } & ApiSDKLogEvent)\n | ({\n type: \"observation-create\";\n } & ApiCreateObservationEvent)\n | ({\n type: \"observation-update\";\n } & ApiUpdateObservationEvent);\n\n/** ObservationType */\nexport type ApiObservationType = \"SPAN\" | \"GENERATION\" | \"EVENT\";\n\n/** IngestionUsage */\nexport type ApiIngestionUsage = ApiUsage | ApiOpenAIUsage;\n\n/**\n * OpenAIUsage\n * Usage interface of OpenAI for improved compatibility.\n */\nexport interface ApiOpenAIUsage {\n promptTokens?: number | null;\n completionTokens?: number | null;\n totalTokens?: number | null;\n}\n\n/** OptionalObservationBody */\nexport interface ApiOptionalObservationBody {\n traceId?: string | null;\n name?: string | null;\n /** @format date-time */\n startTime?: string | null;\n metadata?: any;\n input?: any;\n output?: any;\n level?: ApiObservationLevel | null;\n statusMessage?: string | null;\n parentObservationId?: string | null;\n version?: string | null;\n environment?: string | null;\n}\n\n/** CreateEventBody */\nexport type ApiCreateEventBody = ApiOptionalObservationBody & {\n id?: string | null;\n};\n\n/** UpdateEventBody */\nexport type ApiUpdateEventBody = ApiOptionalObservationBody & {\n id: string;\n};\n\n/** CreateSpanBody */\nexport type ApiCreateSpanBody = ApiCreateEventBody & {\n /** @format date-time */\n endTime?: string | null;\n};\n\n/** UpdateSpanBody */\nexport type ApiUpdateSpanBody = ApiUpdateEventBody & {\n /** @format date-time */\n endTime?: string | null;\n};\n\n/** CreateGenerationBody */\nexport type ApiCreateGenerationBody = ApiCreateSpanBody & {\n /** @format date-time */\n completionStartTime?: string | null;\n model?: string | null;\n modelParameters?: Record<string, ApiMapValue>;\n usage?: ApiIngestionUsage | null;\n usageDetails?: ApiUsageDetails | null;\n costDetails?: Record<string, number>;\n promptName?: string | null;\n promptVersion?: number | null;\n};\n\n/** UpdateGenerationBody */\nexport type ApiUpdateGenerationBody = ApiUpdateSpanBody & {\n /** @format date-time */\n completionStartTime?: string | null;\n model?: string | null;\n modelParameters?: Record<string, ApiMapValue>;\n usage?: ApiIngestionUsage | null;\n promptName?: string | null;\n usageDetails?: ApiUsageDetails | null;\n costDetails?: Record<string, number>;\n promptVersion?: number | null;\n};\n\n/** ObservationBody */\nexport interface ApiObservationBody {\n id?: string | null;\n traceId?: string | null;\n type: ApiObservationType;\n name?: string | null;\n /** @format date-time */\n startTime?: string | null;\n /** @format date-time */\n endTime?: string | null;\n /** @format date-time */\n completionStartTime?: string | null;\n model?: string | null;\n modelParameters?: Record<string, ApiMapValue>;\n input?: any;\n version?: string | null;\n metadata?: any;\n output?: any;\n /** (Deprecated. Use usageDetails and costDetails instead.) Standard interface for usage and cost */\n usage?: ApiUsage | null;\n level?: ApiObservationLevel | null;\n statusMessage?: string | null;\n parentObservationId?: string | null;\n environment?: string | null;\n}\n\n/** TraceBody */\nexport interface ApiTraceBody {\n id?: string | null;\n /** @format date-time */\n timestamp?: string | null;\n name?: string | null;\n userId?: string | null;\n input?: any;\n output?: any;\n sessionId?: string | null;\n release?: string | null;\n version?: string | null;\n metadata?: any;\n tags?: string[] | null;\n environment?: string | null;\n /** Make trace publicly accessible via url */\n public?: boolean | null;\n}\n\n/** SDKLogBody */\nexport interface ApiSDKLogBody {\n log: any;\n}\n\n/** ScoreBody */\nexport interface ApiScoreBody {\n id?: string | null;\n /** @example \"cdef-1234-5678-90ab\" */\n traceId: string;\n /** @example \"novelty\" */\n name: string;\n environment?: string | null;\n /** The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false) */\n value: ApiCreateScoreValue;\n observationId?: string | null;\n comment?: string | null;\n /** When set, must match the score value's type. If not set, will be inferred from the score value or config */\n dataType?: ApiScoreDataType | null;\n /** Reference a score config on a score. When set, the score name must equal the config name and scores must comply with the config's range and data type. For categorical scores, the value must map to a config category. Numeric scores might be constrained by the score config's max and min values */\n configId?: string | null;\n}\n\n/** BaseEvent */\nexport interface ApiBaseEvent {\n /** UUID v4 that identifies the event */\n id: string;\n /** Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal). */\n timestamp: string;\n /** Optional. Metadata field used by the Langfuse SDKs for debugging. */\n metadata?: any;\n}\n\n/** TraceEvent */\nexport type ApiTraceEvent = ApiBaseEvent & {\n body: ApiTraceBody;\n};\n\n/** CreateObservationEvent */\nexport type ApiCreateObservationEvent = ApiBaseEvent & {\n body: ApiObservationBody;\n};\n\n/** UpdateObservationEvent */\nexport type ApiUpdateObservationEvent = ApiBaseEvent & {\n body: ApiObservationBody;\n};\n\n/** ScoreEvent */\nexport type ApiScoreEvent = ApiBaseEvent & {\n body: ApiScoreBody;\n};\n\n/** SDKLogEvent */\nexport type ApiSDKLogEvent = ApiBaseEvent & {\n body: ApiSDKLogBody;\n};\n\n/** CreateGenerationEvent */\nexport type ApiCreateGenerationEvent = ApiBaseEvent & {\n body: ApiCreateGenerationBody;\n};\n\n/** UpdateGenerationEvent */\nexport type ApiUpdateGenerationEvent = ApiBaseEvent & {\n body: ApiUpdateGenerationBody;\n};\n\n/** CreateSpanEvent */\nexport type ApiCreateSpanEvent = ApiBaseEvent & {\n body: ApiCreateSpanBody;\n};\n\n/** UpdateSpanEvent */\nexport type ApiUpdateSpanEvent = ApiBaseEvent & {\n body: ApiUpdateSpanBody;\n};\n\n/** CreateEventEvent */\nexport type ApiCreateEventEvent = ApiBaseEvent & {\n body: ApiCreateEventBody;\n};\n\n/** IngestionSuccess */\nexport interface ApiIngestionSuccess {\n id: string;\n status: number;\n}\n\n/** IngestionError */\nexport interface ApiIngestionError {\n id: string;\n status: number;\n message?: string | null;\n error?: any;\n}\n\n/** IngestionResponse */\nexport interface ApiIngestionResponse {\n successes: ApiIngestionSuccess[];\n errors: ApiIngestionError[];\n}\n\n/**\n * OpenAICompletionUsageSchema\n * OpenAI Usage schema from (Chat-)Completion APIs\n */\nexport interface ApiOpenAICompletionUsageSchema {\n prompt_tokens: number;\n completion_tokens: number;\n total_tokens: number;\n prompt_tokens_details?: Record<string, number | null>;\n completion_tokens_details?: Record<string, number | null>;\n}\n\n/**\n * OpenAIResponseUsageSchema\n * OpenAI Usage schema from Response API\n */\nexport interface ApiOpenAIResponseUsageSchema {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n input_tokens_details?: Record<string, number | null>;\n output_tokens_details?: Record<string, number | null>;\n}\n\n/** UsageDetails */\nexport type ApiUsageDetails = Record<string, number> | ApiOpenAICompletionUsageSchema | ApiOpenAIResponseUsageSchema;\n\n/** GetMediaResponse */\nexport interface ApiGetMediaResponse {\n /** The unique langfuse identifier of a media record */\n mediaId: string;\n /** The MIME type of the media record */\n contentType: string;\n /** The size of the media record in bytes */\n contentLength: number;\n /**\n * The date and time when the media record was uploaded\n * @format date-time\n */\n uploadedAt: string;\n /** The download URL of the media record */\n url: string;\n /** The expiry date and time of the media record download URL */\n urlExpiry: string;\n}\n\n/** PatchMediaBody */\nexport interface ApiPatchMediaBody {\n /**\n * The date and time when the media record was uploaded\n * @format date-time\n */\n uploadedAt: string;\n /** The HTTP status code of the upload */\n uploadHttpStatus: number;\n /** The HTTP error message of the upload */\n uploadHttpError?: string | null;\n /** The time in milliseconds it took to upload the media record */\n uploadTimeMs?: number | null;\n}\n\n/** GetMediaUploadUrlRequest */\nexport interface ApiGetMediaUploadUrlRequest {\n /** The trace ID associated with the media record */\n traceId: string;\n /** The observation ID associated with the media record. If the media record is associated directly with a trace, this will be null. */\n observationId?: string | null;\n /** The MIME type of the media record */\n contentType: ApiMediaContentType;\n /** The size of the media record in bytes */\n contentLength: number;\n /** The SHA-256 hash of the media record */\n sha256Hash: string;\n /** The trace / observation field the media record is associated with. This can be one of `input`, `output`, `metadata` */\n field: string;\n}\n\n/** GetMediaUploadUrlResponse */\nexport interface ApiGetMediaUploadUrlResponse {\n /** The presigned upload URL. If the asset is already uploaded, this will be null */\n uploadUrl?: string | null;\n /** The unique langfuse identifier of a media record */\n mediaId: string;\n}\n\n/**\n * MediaContentType\n * The MIME type of the media record\n */\nexport type ApiMediaContentType =\n | \"image/png\"\n | \"image/jpeg\"\n | \"image/jpg\"\n | \"image/webp\"\n | \"image/gif\"\n | \"image/svg+xml\"\n | \"image/tiff\"\n | \"image/bmp\"\n | \"audio/mpeg\"\n | \"audio/mp3\"\n | \"audio/wav\"\n | \"audio/ogg\"\n | \"audio/oga\"\n | \"audio/aac\"\n | \"audio/mp4\"\n | \"audio/flac\"\n | \"video/mp4\"\n | \"video/webm\"\n | \"text/plain\"\n | \"text/html\"\n | \"text/css\"\n | \"text/csv\"\n | \"application/pdf\"\n | \"application/msword\"\n | \"application/vnd.ms-excel\"\n | \"application/zip\"\n | \"application/json\"\n | \"application/xml\"\n | \"application/octet-stream\";\n\n/** DailyMetrics */\nexport interface ApiDailyMetrics {\n /** A list of daily metrics, only days with ingested data are included. */\n data: ApiDailyMetricsDetails[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** DailyMetricsDetails */\nexport interface ApiDailyMetricsDetails {\n /** @format date */\n date: string;\n countTraces: number;\n countObservations: number;\n /**\n * Total model cost in USD\n * @format double\n */\n totalCost: number;\n usage: ApiUsageByModel[];\n}\n\n/**\n * UsageByModel\n * Daily usage of a given model. Usage corresponds to the unit set for the specific model (e.g. tokens).\n */\nexport interface ApiUsageByModel {\n model?: string | null;\n /** Total number of generation input units (e.g. tokens) */\n inputUsage: number;\n /** Total number of generation output units (e.g. tokens) */\n outputUsage: number;\n /** Total number of generation total units (e.g. tokens) */\n totalUsage: number;\n countTraces: number;\n countObservations: number;\n /**\n * Total model cost in USD\n * @format double\n */\n totalCost: number;\n}\n\n/** PaginatedModels */\nexport interface ApiPaginatedModels {\n data: ApiModel[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** CreateModelRequest */\nexport interface ApiCreateModelRequest {\n /** Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime */\n modelName: string;\n /** Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$` */\n matchPattern: string;\n /**\n * Apply only to generations which are newer than this ISO date.\n * @format date-time\n */\n startDate?: string | null;\n /** Unit used by this model. */\n unit?: ApiModelUsageUnit | null;\n /**\n * Price (USD) per input unit\n * @format double\n */\n inputPrice?: number | null;\n /**\n * Price (USD) per output unit\n * @format double\n */\n outputPrice?: number | null;\n /**\n * Price (USD) per total units. Cannot be set if input or output price is set.\n * @format double\n */\n totalPrice?: number | null;\n /** Optional. Tokenizer to be applied to observations which match to this model. See docs for more details. */\n tokenizerId?: string | null;\n /** Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details. */\n tokenizerConfig?: any;\n}\n\n/** Observations */\nexport interface ApiObservations {\n data: ApiObservation[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** ObservationsViews */\nexport interface ApiObservationsViews {\n data: ApiObservationsView[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** Projects */\nexport interface ApiProjects {\n data: ApiProject[];\n}\n\n/** Project */\nexport interface ApiProject {\n id: string;\n name: string;\n}\n\n/** PromptMetaListResponse */\nexport interface ApiPromptMetaListResponse {\n data: ApiPromptMeta[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** PromptMeta */\nexport interface ApiPromptMeta {\n name: string;\n versions: number[];\n labels: string[];\n tags: string[];\n /** @format date-time */\n lastUpdatedAt: string;\n /** Config object of the most recent prompt version that matches the filters (if any are provided) */\n lastConfig: any;\n}\n\n/** CreatePromptRequest */\nexport type ApiCreatePromptRequest =\n | ({\n type: \"chat\";\n } & ApiCreateChatPromptRequest)\n | ({\n type: \"text\";\n } & ApiCreateTextPromptRequest);\n\n/** CreateChatPromptRequest */\nexport interface ApiCreateChatPromptRequest {\n name: string;\n prompt: ApiChatMessage[];\n config?: any;\n /** List of deployment labels of this prompt version. */\n labels?: string[] | null;\n /** List of tags to apply to all versions of this prompt. */\n tags?: string[] | null;\n /** Commit message for this prompt version. */\n commitMessage?: string | null;\n}\n\n/** CreateTextPromptRequest */\nexport interface ApiCreateTextPromptRequest {\n name: string;\n prompt: string;\n config?: any;\n /** List of deployment labels of this prompt version. */\n labels?: string[] | null;\n /** List of tags to apply to all versions of this prompt. */\n tags?: string[] | null;\n /** Commit message for this prompt version. */\n commitMessage?: string | null;\n}\n\n/** Prompt */\nexport type ApiPrompt =\n | ({\n type: \"chat\";\n } & ApiChatPrompt)\n | ({\n type: \"text\";\n } & ApiTextPrompt);\n\n/** BasePrompt */\nexport interface ApiBasePrompt {\n name: string;\n version: number;\n config: any;\n /** List of deployment labels of this prompt version. */\n labels: string[];\n /** List of tags. Used to filter via UI and API. The same across versions of a prompt. */\n tags: string[];\n /** Commit message for this prompt version. */\n commitMessage?: string | null;\n /** The dependency resolution graph for the current prompt. Null if prompt has no dependencies. */\n resolutionGraph?: Record<string, any>;\n}\n\n/** ChatMessage */\nexport interface ApiChatMessage {\n role: string;\n content: string;\n}\n\n/** TextPrompt */\nexport type ApiTextPrompt = ApiBasePrompt & {\n prompt: string;\n};\n\n/** ChatPrompt */\nexport type ApiChatPrompt = ApiBasePrompt & {\n prompt: ApiChatMessage[];\n};\n\n/** ScoreConfigs */\nexport interface ApiScoreConfigs {\n data: ApiScoreConfig[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** CreateScoreConfigRequest */\nexport interface ApiCreateScoreConfigRequest {\n name: string;\n dataType: ApiScoreDataType;\n /** 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 */\n categories?: ApiConfigCategory[] | null;\n /**\n * Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞\n * @format double\n */\n minValue?: number | null;\n /**\n * Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞\n * @format double\n */\n maxValue?: number | null;\n /** Description is shown across the Langfuse UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage */\n description?: string | null;\n}\n\n/** CreateScoreRequest */\nexport interface ApiCreateScoreRequest {\n id?: string | null;\n /** @example \"cdef-1234-5678-90ab\" */\n traceId: string;\n /** @example \"novelty\" */\n name: string;\n /** The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false) */\n value: ApiCreateScoreValue;\n observationId?: string | null;\n comment?: string | null;\n /** The environment of the score. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */\n environment?: string | null;\n /** The data type of the score. When passing a configId this field is inferred. Otherwise, this field must be passed or will default to numeric. */\n dataType?: ApiScoreDataType | null;\n /** Reference a score config on a score. The unique langfuse identifier of a score config. When passing this field, the dataType and stringValue fields are automatically populated. */\n configId?: string | null;\n}\n\n/** CreateScoreResponse */\nexport interface ApiCreateScoreResponse {\n /** The id of the created object in Langfuse */\n id: string;\n}\n\n/** GetScoresResponseTraceData */\nexport interface ApiGetScoresResponseTraceData {\n /** The user ID associated with the trace referenced by score */\n userId?: string | null;\n /** A list of tags associated with the trace referenced by score */\n tags?: string[] | null;\n /** The environment of the trace referenced by score */\n environment?: string | null;\n}\n\n/** GetScoresResponseDataNumeric */\nexport type ApiGetScoresResponseDataNumeric = ApiNumericScore & {\n trace: ApiGetScoresResponseTraceData;\n};\n\n/** GetScoresResponseDataCategorical */\nexport type ApiGetScoresResponseDataCategorical = ApiCategoricalScore & {\n trace: ApiGetScoresResponseTraceData;\n};\n\n/** GetScoresResponseDataBoolean */\nexport type ApiGetScoresResponseDataBoolean = ApiBooleanScore & {\n trace: ApiGetScoresResponseTraceData;\n};\n\n/** GetScoresResponseData */\nexport type ApiGetScoresResponseData =\n | ({\n dataType: \"NUMERIC\";\n } & ApiGetScoresResponseDataNumeric)\n | ({\n dataType: \"CATEGORICAL\";\n } & ApiGetScoresResponseDataCategorical)\n | ({\n dataType: \"BOOLEAN\";\n } & ApiGetScoresResponseDataBoolean);\n\n/** GetScoresResponse */\nexport interface ApiGetScoresResponse {\n data: ApiGetScoresResponseData[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** PaginatedSessions */\nexport interface ApiPaginatedSessions {\n data: ApiSession[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** Traces */\nexport interface ApiTraces {\n data: ApiTraceWithDetails[];\n meta: ApiUtilsMetaResponse;\n}\n\n/** DeleteTraceResponse */\nexport interface ApiDeleteTraceResponse {\n message: string;\n}\n\n/** Sort */\nexport interface ApiSort {\n id: string;\n}\n\n/** utilsMetaResponse */\nexport interface ApiUtilsMetaResponse {\n /** current page number */\n page: number;\n /** number of items per page */\n limit: number;\n /** number of total items given the current filters/selection (if any) */\n totalItems: number;\n /** number of total pages given the current limit */\n totalPages: number;\n}\n\nexport interface ApiAnnotationQueuesListQueuesParams {\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n}\n\nexport interface ApiAnnotationQueuesListQueueItemsParams {\n /** Filter by status */\n status?: ApiAnnotationQueueStatus | null;\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n /** The unique identifier of the annotation queue */\n queueId: string;\n}\n\nexport interface ApiCommentsGetParams {\n /** Page number, starts at 1. */\n page?: number | null;\n /** Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit */\n limit?: number | null;\n /** Filter comments by object type (trace, observation, session, prompt). */\n objectType?: string | null;\n /** Filter comments by object id. If objectType is not provided, an error will be thrown. */\n objectId?: string | null;\n /** Filter comments by author user id. */\n authorUserId?: string | null;\n}\n\nexport interface ApiDatasetItemsListParams {\n datasetName?: string | null;\n sourceTraceId?: string | null;\n sourceObservationId?: string | null;\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n}\n\nexport interface ApiDatasetsListParams {\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n}\n\nexport interface ApiDatasetsGetRunsParams {\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n datasetName: string;\n}\n\nexport interface ApiIngestionBatchPayload {\n /** Batch of tracing events to be ingested. Discriminated by attribute `type`. */\n batch: ApiIngestionEvent[];\n /** Optional. Metadata field used by the Langfuse SDKs for debugging. */\n metadata?: any;\n}\n\nexport interface ApiMetricsDailyParams {\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n /** Optional filter by the name of the trace */\n traceName?: string | null;\n /** Optional filter by the userId associated with the trace */\n userId?: string | null;\n /** Optional filter for metrics where traces include all of these tags */\n tags?: (string | null)[];\n /** Optional filter for metrics where events include any of these environments */\n environment?: (string | null)[];\n /**\n * Optional filter to only include traces and observations on or after a certain datetime (ISO 8601)\n * @format date-time\n */\n fromTimestamp?: string | null;\n /**\n * Optional filter to only include traces and observations before a certain datetime (ISO 8601)\n * @format date-time\n */\n toTimestamp?: string | null;\n}\n\nexport interface ApiModelsListParams {\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n}\n\nexport interface ApiObservationsGetManyParams {\n /** Page number, starts at 1. */\n page?: number | null;\n /** Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit. */\n limit?: number | null;\n name?: string | null;\n userId?: string | null;\n type?: string | null;\n traceId?: string | null;\n parentObservationId?: string | null;\n /** Optional filter for observations where the environment is one of the provided values. */\n environment?: (string | null)[];\n /**\n * Retrieve only observations with a start_time or or after this datetime (ISO 8601).\n * @format date-time\n */\n fromStartTime?: string | null;\n /**\n * Retrieve only observations with a start_time before this datetime (ISO 8601).\n * @format date-time\n */\n toStartTime?: string | null;\n /** Optional filter to only include observations with a certain version. */\n version?: string | null;\n}\n\nexport interface ApiPromptVersionUpdatePayload {\n /** New labels for the prompt version. Labels are unique across versions. The \"latest\" label is reserved and managed by Langfuse. */\n newLabels: string[];\n}\n\nexport interface ApiPromptsGetParams {\n /** Version of the prompt to be retrieved. */\n version?: number | null;\n /** Label of the prompt to be retrieved. Defaults to \"production\" if no label or version is set. */\n label?: string | null;\n /** The name of the prompt */\n promptName: string;\n}\n\nexport interface ApiPromptsListParams {\n name?: string | null;\n label?: string | null;\n tag?: string | null;\n /** page number, starts at 1 */\n page?: number | null;\n /** limit of items per page */\n limit?: number | null;\n /**\n * Optional filter to only include prompt versions created/updated on or after a certain datetime (ISO 8601)\n * @format date-time\n */\n fromUpdatedAt?: string | null;\n /**\n * Optional filter to only include prompt versions created/updated before a certain datetime (ISO 8601)\n * @format date-time\n */\n toUpdatedAt?: string | null;\n}\n\nexport interface ApiScoreConfigsGetParams {\n /** Page number, starts at 1. */\n page?: number | null;\n /** Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit */\n limit?: number | null;\n}\n\nexport interface ApiScoreGetParams {\n /** Page number, star