@langfuse/core 4.4.10-alpha.2 → 4.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -3556,6 +3556,20 @@ interface ListPromptsMetaRequest {
3556
3556
  toUpdatedAt?: string;
3557
3557
  }
3558
3558
 
3559
+ /**
3560
+ * This file was auto-generated by Fern from our API Definition.
3561
+ */
3562
+ /**
3563
+ * @example
3564
+ * {}
3565
+ */
3566
+ interface DeletePromptRequest {
3567
+ /** Optional label to filter deletion. If specified, deletes all prompt versions that have this label. */
3568
+ label?: string;
3569
+ /** Optional version to filter deletion. If specified, deletes only this specific version of the prompt. */
3570
+ version?: number;
3571
+ }
3572
+
3559
3573
  type index$9_BasePrompt = BasePrompt;
3560
3574
  type index$9_ChatMessage = ChatMessage;
3561
3575
  declare const index$9_ChatMessageWithPlaceholders: typeof ChatMessageWithPlaceholders;
@@ -3563,6 +3577,7 @@ type index$9_ChatPrompt = ChatPrompt;
3563
3577
  type index$9_CreateChatPromptRequest = CreateChatPromptRequest;
3564
3578
  declare const index$9_CreatePromptRequest: typeof CreatePromptRequest;
3565
3579
  type index$9_CreateTextPromptRequest = CreateTextPromptRequest;
3580
+ type index$9_DeletePromptRequest = DeletePromptRequest;
3566
3581
  type index$9_GetPromptRequest = GetPromptRequest;
3567
3582
  type index$9_ListPromptsMetaRequest = ListPromptsMetaRequest;
3568
3583
  type index$9_PlaceholderMessage = PlaceholderMessage;
@@ -3572,7 +3587,7 @@ type index$9_PromptMetaListResponse = PromptMetaListResponse;
3572
3587
  declare const index$9_PromptType: typeof PromptType;
3573
3588
  type index$9_TextPrompt = TextPrompt;
3574
3589
  declare namespace index$9 {
3575
- export { type index$9_BasePrompt as BasePrompt, type index$9_ChatMessage as ChatMessage, index$9_ChatMessageWithPlaceholders as ChatMessageWithPlaceholders, type index$9_ChatPrompt as ChatPrompt, type index$9_CreateChatPromptRequest as CreateChatPromptRequest, index$9_CreatePromptRequest as CreatePromptRequest, type index$9_CreateTextPromptRequest as CreateTextPromptRequest, type index$9_GetPromptRequest as GetPromptRequest, type index$9_ListPromptsMetaRequest as ListPromptsMetaRequest, type index$9_PlaceholderMessage as PlaceholderMessage, index$9_Prompt as Prompt, type index$9_PromptMeta as PromptMeta, type index$9_PromptMetaListResponse as PromptMetaListResponse, index$9_PromptType as PromptType, type index$9_TextPrompt as TextPrompt };
3590
+ export { type index$9_BasePrompt as BasePrompt, type index$9_ChatMessage as ChatMessage, index$9_ChatMessageWithPlaceholders as ChatMessageWithPlaceholders, type index$9_ChatPrompt as ChatPrompt, type index$9_CreateChatPromptRequest as CreateChatPromptRequest, index$9_CreatePromptRequest as CreatePromptRequest, type index$9_CreateTextPromptRequest as CreateTextPromptRequest, type index$9_DeletePromptRequest as DeletePromptRequest, type index$9_GetPromptRequest as GetPromptRequest, type index$9_ListPromptsMetaRequest as ListPromptsMetaRequest, type index$9_PlaceholderMessage as PlaceholderMessage, index$9_Prompt as Prompt, type index$9_PromptMeta as PromptMeta, type index$9_PromptMetaListResponse as PromptMetaListResponse, index$9_PromptType as PromptType, type index$9_TextPrompt as TextPrompt };
3576
3591
  }
3577
3592
 
3578
3593
  /**
@@ -6186,7 +6201,7 @@ declare class Projects {
6186
6201
  protected readonly _options: Projects.Options;
6187
6202
  constructor(_options: Projects.Options);
6188
6203
  /**
6189
- * Get Project associated with API key
6204
+ * Get Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key.
6190
6205
  *
6191
6206
  * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
6192
6207
  *
@@ -6499,6 +6514,24 @@ declare class Prompts {
6499
6514
  */
6500
6515
  create(request: CreatePromptRequest, requestOptions?: Prompts.RequestOptions): HttpResponsePromise<Prompt>;
6501
6516
  private __create;
6517
+ /**
6518
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
6519
+ *
6520
+ * @param {string} promptName - The name of the prompt
6521
+ * @param {LangfuseAPI.DeletePromptRequest} request
6522
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
6523
+ *
6524
+ * @throws {@link LangfuseAPI.Error}
6525
+ * @throws {@link LangfuseAPI.UnauthorizedError}
6526
+ * @throws {@link LangfuseAPI.AccessDeniedError}
6527
+ * @throws {@link LangfuseAPI.MethodNotAllowedError}
6528
+ * @throws {@link LangfuseAPI.NotFoundError}
6529
+ *
6530
+ * @example
6531
+ * await client.prompts.delete("promptName")
6532
+ */
6533
+ delete(promptName: string, request?: DeletePromptRequest, requestOptions?: Prompts.RequestOptions): HttpResponsePromise<void>;
6534
+ private __delete;
6502
6535
  protected _getAuthorizationHeader(): Promise<string | undefined>;
6503
6536
  }
6504
6537
 
@@ -7619,4 +7652,4 @@ interface PropagateAttributesParams {
7619
7652
  declare function propagateAttributes<A extends unknown[], F extends (...args: A) => ReturnType<F>>(params: PropagateAttributesParams, fn: F): ReturnType<F>;
7620
7653
  declare function getPropagatedAttributesFromContext(context: Context): Record<string, string | string[]>;
7621
7654
 
7622
- export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetModelsRequest, type GetObservationsRequest, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$q as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$p as blobStorageIntegrations, bytesToBase64, index$o as comments, index$n as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$m as datasetItems, index$l as datasetRunItems, index$k as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$j as health, index$i as ingestion, index$h as llmConnections, LoggerSingleton as logger, index$g as media, index$f as metrics, index$e as models, index$d as observations, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };
7655
+ export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeletePromptRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetModelsRequest, type GetObservationsRequest, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$q as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$p as blobStorageIntegrations, bytesToBase64, index$o as comments, index$n as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$m as datasetItems, index$l as datasetRunItems, index$k as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$j as health, index$i as ingestion, index$h as llmConnections, LoggerSingleton as logger, index$g as media, index$f as metrics, index$e as models, index$d as observations, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };
package/dist/index.d.ts CHANGED
@@ -3556,6 +3556,20 @@ interface ListPromptsMetaRequest {
3556
3556
  toUpdatedAt?: string;
3557
3557
  }
3558
3558
 
3559
+ /**
3560
+ * This file was auto-generated by Fern from our API Definition.
3561
+ */
3562
+ /**
3563
+ * @example
3564
+ * {}
3565
+ */
3566
+ interface DeletePromptRequest {
3567
+ /** Optional label to filter deletion. If specified, deletes all prompt versions that have this label. */
3568
+ label?: string;
3569
+ /** Optional version to filter deletion. If specified, deletes only this specific version of the prompt. */
3570
+ version?: number;
3571
+ }
3572
+
3559
3573
  type index$9_BasePrompt = BasePrompt;
3560
3574
  type index$9_ChatMessage = ChatMessage;
3561
3575
  declare const index$9_ChatMessageWithPlaceholders: typeof ChatMessageWithPlaceholders;
@@ -3563,6 +3577,7 @@ type index$9_ChatPrompt = ChatPrompt;
3563
3577
  type index$9_CreateChatPromptRequest = CreateChatPromptRequest;
3564
3578
  declare const index$9_CreatePromptRequest: typeof CreatePromptRequest;
3565
3579
  type index$9_CreateTextPromptRequest = CreateTextPromptRequest;
3580
+ type index$9_DeletePromptRequest = DeletePromptRequest;
3566
3581
  type index$9_GetPromptRequest = GetPromptRequest;
3567
3582
  type index$9_ListPromptsMetaRequest = ListPromptsMetaRequest;
3568
3583
  type index$9_PlaceholderMessage = PlaceholderMessage;
@@ -3572,7 +3587,7 @@ type index$9_PromptMetaListResponse = PromptMetaListResponse;
3572
3587
  declare const index$9_PromptType: typeof PromptType;
3573
3588
  type index$9_TextPrompt = TextPrompt;
3574
3589
  declare namespace index$9 {
3575
- export { type index$9_BasePrompt as BasePrompt, type index$9_ChatMessage as ChatMessage, index$9_ChatMessageWithPlaceholders as ChatMessageWithPlaceholders, type index$9_ChatPrompt as ChatPrompt, type index$9_CreateChatPromptRequest as CreateChatPromptRequest, index$9_CreatePromptRequest as CreatePromptRequest, type index$9_CreateTextPromptRequest as CreateTextPromptRequest, type index$9_GetPromptRequest as GetPromptRequest, type index$9_ListPromptsMetaRequest as ListPromptsMetaRequest, type index$9_PlaceholderMessage as PlaceholderMessage, index$9_Prompt as Prompt, type index$9_PromptMeta as PromptMeta, type index$9_PromptMetaListResponse as PromptMetaListResponse, index$9_PromptType as PromptType, type index$9_TextPrompt as TextPrompt };
3590
+ export { type index$9_BasePrompt as BasePrompt, type index$9_ChatMessage as ChatMessage, index$9_ChatMessageWithPlaceholders as ChatMessageWithPlaceholders, type index$9_ChatPrompt as ChatPrompt, type index$9_CreateChatPromptRequest as CreateChatPromptRequest, index$9_CreatePromptRequest as CreatePromptRequest, type index$9_CreateTextPromptRequest as CreateTextPromptRequest, type index$9_DeletePromptRequest as DeletePromptRequest, type index$9_GetPromptRequest as GetPromptRequest, type index$9_ListPromptsMetaRequest as ListPromptsMetaRequest, type index$9_PlaceholderMessage as PlaceholderMessage, index$9_Prompt as Prompt, type index$9_PromptMeta as PromptMeta, type index$9_PromptMetaListResponse as PromptMetaListResponse, index$9_PromptType as PromptType, type index$9_TextPrompt as TextPrompt };
3576
3591
  }
3577
3592
 
3578
3593
  /**
@@ -6186,7 +6201,7 @@ declare class Projects {
6186
6201
  protected readonly _options: Projects.Options;
6187
6202
  constructor(_options: Projects.Options);
6188
6203
  /**
6189
- * Get Project associated with API key
6204
+ * Get Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key.
6190
6205
  *
6191
6206
  * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
6192
6207
  *
@@ -6499,6 +6514,24 @@ declare class Prompts {
6499
6514
  */
6500
6515
  create(request: CreatePromptRequest, requestOptions?: Prompts.RequestOptions): HttpResponsePromise<Prompt>;
6501
6516
  private __create;
6517
+ /**
6518
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
6519
+ *
6520
+ * @param {string} promptName - The name of the prompt
6521
+ * @param {LangfuseAPI.DeletePromptRequest} request
6522
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
6523
+ *
6524
+ * @throws {@link LangfuseAPI.Error}
6525
+ * @throws {@link LangfuseAPI.UnauthorizedError}
6526
+ * @throws {@link LangfuseAPI.AccessDeniedError}
6527
+ * @throws {@link LangfuseAPI.MethodNotAllowedError}
6528
+ * @throws {@link LangfuseAPI.NotFoundError}
6529
+ *
6530
+ * @example
6531
+ * await client.prompts.delete("promptName")
6532
+ */
6533
+ delete(promptName: string, request?: DeletePromptRequest, requestOptions?: Prompts.RequestOptions): HttpResponsePromise<void>;
6534
+ private __delete;
6502
6535
  protected _getAuthorizationHeader(): Promise<string | undefined>;
6503
6536
  }
6504
6537
 
@@ -7619,4 +7652,4 @@ interface PropagateAttributesParams {
7619
7652
  declare function propagateAttributes<A extends unknown[], F extends (...args: A) => ReturnType<F>>(params: PropagateAttributesParams, fn: F): ReturnType<F>;
7620
7653
  declare function getPropagatedAttributesFromContext(context: Context): Record<string, string | string[]>;
7621
7654
 
7622
- export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetModelsRequest, type GetObservationsRequest, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$q as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$p as blobStorageIntegrations, bytesToBase64, index$o as comments, index$n as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$m as datasetItems, index$l as datasetRunItems, index$k as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$j as health, index$i as ingestion, index$h as llmConnections, LoggerSingleton as logger, index$g as media, index$f as metrics, index$e as models, index$d as observations, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };
7655
+ export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeletePromptRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetModelsRequest, type GetObservationsRequest, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$q as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$p as blobStorageIntegrations, bytesToBase64, index$o as comments, index$n as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$m as datasetItems, index$l as datasetRunItems, index$k as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$j as health, index$i as ingestion, index$h as llmConnections, LoggerSingleton as logger, index$g as media, index$f as metrics, index$e as models, index$d as observations, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };
package/dist/index.mjs CHANGED
@@ -253,7 +253,7 @@ var resetGlobalLogger = () => {
253
253
  // package.json
254
254
  var package_default = {
255
255
  name: "@langfuse/core",
256
- version: "4.4.10-alpha.1",
256
+ version: "4.4.10-alpha.3",
257
257
  description: "Core functions and utilities for Langfuse packages",
258
258
  type: "module",
259
259
  sideEffects: false,
@@ -7491,7 +7491,7 @@ var Projects = class {
7491
7491
  this._options = _options;
7492
7492
  }
7493
7493
  /**
7494
- * Get Project associated with API key
7494
+ * Get Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key.
7495
7495
  *
7496
7496
  * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
7497
7497
  *
@@ -8740,6 +8740,115 @@ var Prompts = class {
8740
8740
  });
8741
8741
  }
8742
8742
  }
8743
+ /**
8744
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
8745
+ *
8746
+ * @param {string} promptName - The name of the prompt
8747
+ * @param {LangfuseAPI.DeletePromptRequest} request
8748
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
8749
+ *
8750
+ * @throws {@link LangfuseAPI.Error}
8751
+ * @throws {@link LangfuseAPI.UnauthorizedError}
8752
+ * @throws {@link LangfuseAPI.AccessDeniedError}
8753
+ * @throws {@link LangfuseAPI.MethodNotAllowedError}
8754
+ * @throws {@link LangfuseAPI.NotFoundError}
8755
+ *
8756
+ * @example
8757
+ * await client.prompts.delete("promptName")
8758
+ */
8759
+ delete(promptName, request = {}, requestOptions) {
8760
+ return HttpResponsePromise.fromPromise(
8761
+ this.__delete(promptName, request, requestOptions)
8762
+ );
8763
+ }
8764
+ async __delete(promptName, request = {}, requestOptions) {
8765
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
8766
+ const { label, version } = request;
8767
+ const _queryParams = {};
8768
+ if (label != null) {
8769
+ _queryParams["label"] = label;
8770
+ }
8771
+ if (version != null) {
8772
+ _queryParams["version"] = version.toString();
8773
+ }
8774
+ let _headers = mergeHeaders(
8775
+ (_a2 = this._options) == null ? void 0 : _a2.headers,
8776
+ mergeOnlyDefinedHeaders({
8777
+ Authorization: await this._getAuthorizationHeader(),
8778
+ "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName,
8779
+ "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion,
8780
+ "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey
8781
+ }),
8782
+ requestOptions == null ? void 0 : requestOptions.headers
8783
+ );
8784
+ const _response = await fetcher({
8785
+ url: url_exports.join(
8786
+ (_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment),
8787
+ `/api/public/v2/prompts/${encodeURIComponent(promptName)}`
8788
+ ),
8789
+ method: "DELETE",
8790
+ headers: _headers,
8791
+ queryParameters: { ..._queryParams, ...requestOptions == null ? void 0 : requestOptions.queryParams },
8792
+ timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4,
8793
+ maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
8794
+ abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
8795
+ });
8796
+ if (_response.ok) {
8797
+ return { data: void 0, rawResponse: _response.rawResponse };
8798
+ }
8799
+ if (_response.error.reason === "status-code") {
8800
+ switch (_response.error.statusCode) {
8801
+ case 400:
8802
+ throw new Error2(
8803
+ _response.error.body,
8804
+ _response.rawResponse
8805
+ );
8806
+ case 401:
8807
+ throw new UnauthorizedError(
8808
+ _response.error.body,
8809
+ _response.rawResponse
8810
+ );
8811
+ case 403:
8812
+ throw new AccessDeniedError(
8813
+ _response.error.body,
8814
+ _response.rawResponse
8815
+ );
8816
+ case 405:
8817
+ throw new MethodNotAllowedError(
8818
+ _response.error.body,
8819
+ _response.rawResponse
8820
+ );
8821
+ case 404:
8822
+ throw new NotFoundError(
8823
+ _response.error.body,
8824
+ _response.rawResponse
8825
+ );
8826
+ default:
8827
+ throw new LangfuseAPIError({
8828
+ statusCode: _response.error.statusCode,
8829
+ body: _response.error.body,
8830
+ rawResponse: _response.rawResponse
8831
+ });
8832
+ }
8833
+ }
8834
+ switch (_response.error.reason) {
8835
+ case "non-json":
8836
+ throw new LangfuseAPIError({
8837
+ statusCode: _response.error.statusCode,
8838
+ body: _response.error.rawBody,
8839
+ rawResponse: _response.rawResponse
8840
+ });
8841
+ case "timeout":
8842
+ throw new LangfuseAPITimeoutError(
8843
+ "Timeout exceeded when calling DELETE /api/public/v2/prompts/{promptName}."
8844
+ );
8845
+ case "unknown":
8846
+ throw new LangfuseAPIError({
8847
+ message: _response.error.errorMessage,
8848
+ rawResponse: _response.rawResponse
8849
+ });
8850
+ }
8851
+ }
8743
8852
  async _getAuthorizationHeader() {
8744
8853
  const username = await Supplier.get(this._options.username);
8745
8854
  const password = await Supplier.get(this._options.password);