@elasticdash/core 0.0.2 → 0.0.4
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.cjs +38 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +34 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -178,10 +178,11 @@ declare const configureGlobalLogger: (config: LoggerConfig) => void;
|
|
|
178
178
|
*/
|
|
179
179
|
declare const resetGlobalLogger: () => void;
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
declare const
|
|
183
|
-
declare const
|
|
184
|
-
declare const
|
|
181
|
+
type ElasticDashEnvVar = "ELASTICDASH_PUBLIC_KEY" | "ELASTICDASH_SECRET_KEY" | "ELASTICDASH_BASE_URL" | "ELASTICDASH_BASEURL" | "ELASTICDASH_TIMEOUT" | "ELASTICDASH_FLUSH_AT" | "ELASTICDASH_FLUSH_INTERVAL" | "ELASTICDASH_TRACING_ENVIRONMENT";
|
|
182
|
+
declare const ELASTICDASH_TRACER_NAME = "langfuse-sdk";
|
|
183
|
+
declare const ELASTICDASH_SDK_VERSION: string;
|
|
184
|
+
declare const ELASTICDASH_SDK_NAME = "javascript";
|
|
185
|
+
declare const ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT = "sdk-experiment";
|
|
185
186
|
declare enum LangfuseOtelSpanAttributes {
|
|
186
187
|
TRACE_NAME = "langfuse.trace.name",
|
|
187
188
|
TRACE_USER_ID = "user.id",
|
|
@@ -7865,7 +7866,7 @@ declare class LangfuseAPIClient {
|
|
|
7865
7866
|
get trace(): Trace;
|
|
7866
7867
|
}
|
|
7867
7868
|
|
|
7868
|
-
type LangfuseEnvVar = "
|
|
7869
|
+
type LangfuseEnvVar = "ELASTICDASH_PUBLIC_KEY" | "ELASTICDASH_SECRET_KEY" | "ELASTICDASH_BASE_URL" | "ELASTICDASH_BASEURL" | "ELASTICDASH_TIMEOUT" | "ELASTICDASH_FLUSH_AT" | "ELASTICDASH_FLUSH_INTERVAL" | "ELASTICDASH_LOG_LEVEL" | "ELASTICDASH_RELEASE" | "ELASTICDASH_TRACING_ENVIRONMENT";
|
|
7869
7870
|
declare function getEnv(key: LangfuseEnvVar): string | undefined;
|
|
7870
7871
|
declare function generateUUID(globalThis?: any): string;
|
|
7871
7872
|
declare function safeSetTimeout(fn: () => void, timeout: number): any;
|
|
@@ -8232,4 +8233,4 @@ interface PropagateAttributesParams {
|
|
|
8232
8233
|
declare function propagateAttributes<A extends unknown[], F extends (...args: A) => ReturnType<F>>(params: PropagateAttributesParams, fn: F): ReturnType<F>;
|
|
8233
8234
|
declare function getPropagatedAttributesFromContext(context: Context): Record<string, string | string[]>;
|
|
8234
8235
|
|
|
8235
|
-
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 GetMetricsV2Request, type GetModelsRequest, type GetObservationsRequest, type GetObservationsV2Request, 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,
|
|
8236
|
+
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, ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT, ELASTICDASH_SDK_NAME, ELASTICDASH_SDK_VERSION, ELASTICDASH_TRACER_NAME, type ElasticDashEnvVar, 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 GetMetricsV2Request, type GetModelsRequest, type GetObservationsRequest, type GetObservationsV2Request, 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, 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 MetricsV2Response, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsV2Meta, type ObservationsV2Response, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type Organization, 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, ScoreConfigDataType, 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$s as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$r as blobStorageIntegrations, bytesToBase64, index$q as comments, index$p as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$o as datasetItems, index$n as datasetRunItems, index$m as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$l as health, index$k as ingestion, index$j as llmConnections, LoggerSingleton as logger, index$i as media, index$g as metrics, index$h as metricsV2, index$f as models, index$d as observations, index$e as observationsV2, 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
|
@@ -178,10 +178,11 @@ declare const configureGlobalLogger: (config: LoggerConfig) => void;
|
|
|
178
178
|
*/
|
|
179
179
|
declare const resetGlobalLogger: () => void;
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
declare const
|
|
183
|
-
declare const
|
|
184
|
-
declare const
|
|
181
|
+
type ElasticDashEnvVar = "ELASTICDASH_PUBLIC_KEY" | "ELASTICDASH_SECRET_KEY" | "ELASTICDASH_BASE_URL" | "ELASTICDASH_BASEURL" | "ELASTICDASH_TIMEOUT" | "ELASTICDASH_FLUSH_AT" | "ELASTICDASH_FLUSH_INTERVAL" | "ELASTICDASH_TRACING_ENVIRONMENT";
|
|
182
|
+
declare const ELASTICDASH_TRACER_NAME = "langfuse-sdk";
|
|
183
|
+
declare const ELASTICDASH_SDK_VERSION: string;
|
|
184
|
+
declare const ELASTICDASH_SDK_NAME = "javascript";
|
|
185
|
+
declare const ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT = "sdk-experiment";
|
|
185
186
|
declare enum LangfuseOtelSpanAttributes {
|
|
186
187
|
TRACE_NAME = "langfuse.trace.name",
|
|
187
188
|
TRACE_USER_ID = "user.id",
|
|
@@ -7865,7 +7866,7 @@ declare class LangfuseAPIClient {
|
|
|
7865
7866
|
get trace(): Trace;
|
|
7866
7867
|
}
|
|
7867
7868
|
|
|
7868
|
-
type LangfuseEnvVar = "
|
|
7869
|
+
type LangfuseEnvVar = "ELASTICDASH_PUBLIC_KEY" | "ELASTICDASH_SECRET_KEY" | "ELASTICDASH_BASE_URL" | "ELASTICDASH_BASEURL" | "ELASTICDASH_TIMEOUT" | "ELASTICDASH_FLUSH_AT" | "ELASTICDASH_FLUSH_INTERVAL" | "ELASTICDASH_LOG_LEVEL" | "ELASTICDASH_RELEASE" | "ELASTICDASH_TRACING_ENVIRONMENT";
|
|
7869
7870
|
declare function getEnv(key: LangfuseEnvVar): string | undefined;
|
|
7870
7871
|
declare function generateUUID(globalThis?: any): string;
|
|
7871
7872
|
declare function safeSetTimeout(fn: () => void, timeout: number): any;
|
|
@@ -8232,4 +8233,4 @@ interface PropagateAttributesParams {
|
|
|
8232
8233
|
declare function propagateAttributes<A extends unknown[], F extends (...args: A) => ReturnType<F>>(params: PropagateAttributesParams, fn: F): ReturnType<F>;
|
|
8233
8234
|
declare function getPropagatedAttributesFromContext(context: Context): Record<string, string | string[]>;
|
|
8234
8235
|
|
|
8235
|
-
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 GetMetricsV2Request, type GetModelsRequest, type GetObservationsRequest, type GetObservationsV2Request, 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,
|
|
8236
|
+
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, ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT, ELASTICDASH_SDK_NAME, ELASTICDASH_SDK_VERSION, ELASTICDASH_TRACER_NAME, type ElasticDashEnvVar, 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 GetMetricsV2Request, type GetModelsRequest, type GetObservationsRequest, type GetObservationsV2Request, 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, 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 MetricsV2Response, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsV2Meta, type ObservationsV2Response, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type Organization, 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, ScoreConfigDataType, 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$s as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$r as blobStorageIntegrations, bytesToBase64, index$q as comments, index$p as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$o as datasetItems, index$n as datasetRunItems, index$m as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$l as health, index$k as ingestion, index$j as llmConnections, LoggerSingleton as logger, index$i as media, index$g as metrics, index$h as metricsV2, index$f as models, index$d as observations, index$e as observationsV2, 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
|
@@ -88,7 +88,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
88
88
|
})(LogLevel || {});
|
|
89
89
|
function parseLogLevelFromEnv() {
|
|
90
90
|
if (typeof process === "object" && "env" in process) {
|
|
91
|
-
const envValue = getEnv("
|
|
91
|
+
const envValue = getEnv("ELASTICDASH_LOG_LEVEL");
|
|
92
92
|
const value = (envValue != null ? envValue : "").toUpperCase();
|
|
93
93
|
switch (value) {
|
|
94
94
|
case "ERROR":
|
|
@@ -253,8 +253,8 @@ var resetGlobalLogger = () => {
|
|
|
253
253
|
// package.json
|
|
254
254
|
var package_default = {
|
|
255
255
|
name: "@elasticdash/core",
|
|
256
|
-
version: "0.0.
|
|
257
|
-
description: "Core functions and utilities for
|
|
256
|
+
version: "0.0.4",
|
|
257
|
+
description: "Core functions and utilities for ElasticDash packages",
|
|
258
258
|
type: "module",
|
|
259
259
|
sideEffects: false,
|
|
260
260
|
main: "./dist/index.cjs",
|
|
@@ -275,11 +275,11 @@ var package_default = {
|
|
|
275
275
|
"format:check": 'prettier --check "src/**/*.ts"',
|
|
276
276
|
clean: "rm -rf dist"
|
|
277
277
|
},
|
|
278
|
-
author: "
|
|
278
|
+
author: "ElasticDash",
|
|
279
279
|
license: "MIT",
|
|
280
280
|
repository: {
|
|
281
281
|
type: "git",
|
|
282
|
-
url: "https://github.com/
|
|
282
|
+
url: "https://github.com/terryjiang2020/elasticdash-js.git",
|
|
283
283
|
directory: "packages/core"
|
|
284
284
|
},
|
|
285
285
|
files: [
|
|
@@ -294,10 +294,10 @@ var package_default = {
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// src/constants.ts
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
var
|
|
297
|
+
var ELASTICDASH_TRACER_NAME = "langfuse-sdk";
|
|
298
|
+
var ELASTICDASH_SDK_VERSION = package_default.version;
|
|
299
|
+
var ELASTICDASH_SDK_NAME = "javascript";
|
|
300
|
+
var ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT = "sdk-experiment";
|
|
301
301
|
var LangfuseOtelSpanAttributes = /* @__PURE__ */ ((LangfuseOtelSpanAttributes2) => {
|
|
302
302
|
LangfuseOtelSpanAttributes2["TRACE_NAME"] = "langfuse.trace.name";
|
|
303
303
|
LangfuseOtelSpanAttributes2["TRACE_USER_ID"] = "user.id";
|
|
@@ -12154,8 +12154,8 @@ var LangfuseOtelContextKeys = {
|
|
|
12154
12154
|
"langfuse_experiment_item_root_observation_id"
|
|
12155
12155
|
)
|
|
12156
12156
|
};
|
|
12157
|
-
var
|
|
12158
|
-
var
|
|
12157
|
+
var ELASTICDASH_BAGGAGE_PREFIX = "langfuse_";
|
|
12158
|
+
var ELASTICDASH_BAGGAGE_TAGS_SEPARATOR = ",";
|
|
12159
12159
|
function propagateAttributes(params, fn) {
|
|
12160
12160
|
var _a2;
|
|
12161
12161
|
let context = otelContextApi.active();
|
|
@@ -12280,11 +12280,11 @@ function getPropagatedAttributesFromContext(context) {
|
|
|
12280
12280
|
const baggage = propagation.getBaggage(context);
|
|
12281
12281
|
if (baggage) {
|
|
12282
12282
|
baggage.getAllEntries().forEach(([baggageKey, baggageEntry]) => {
|
|
12283
|
-
if (baggageKey.startsWith(
|
|
12283
|
+
if (baggageKey.startsWith(ELASTICDASH_BAGGAGE_PREFIX)) {
|
|
12284
12284
|
const spanKey = getSpanKeyFromBaggageKey(baggageKey);
|
|
12285
12285
|
if (spanKey) {
|
|
12286
12286
|
const isMergedTags = baggageKey == getBaggageKeyForPropagatedKey("tags");
|
|
12287
|
-
propagatedAttributes[spanKey] = isMergedTags ? baggageEntry.value.split(
|
|
12287
|
+
propagatedAttributes[spanKey] = isMergedTags ? baggageEntry.value.split(ELASTICDASH_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value;
|
|
12288
12288
|
}
|
|
12289
12289
|
}
|
|
12290
12290
|
});
|
|
@@ -12330,7 +12330,7 @@ function getPropagatedAttributesFromContext(context) {
|
|
|
12330
12330
|
}
|
|
12331
12331
|
}
|
|
12332
12332
|
if (propagatedAttributes[getSpanKeyForPropagatedKey("experimentItemRootObservationId")]) {
|
|
12333
|
-
propagatedAttributes["langfuse.environment" /* ENVIRONMENT */] =
|
|
12333
|
+
propagatedAttributes["langfuse.environment" /* ENVIRONMENT */] = ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT;
|
|
12334
12334
|
}
|
|
12335
12335
|
return propagatedAttributes;
|
|
12336
12336
|
}
|
|
@@ -12372,7 +12372,7 @@ function setPropagatedAttribute(params) {
|
|
|
12372
12372
|
}
|
|
12373
12373
|
} else if (key === "tags") {
|
|
12374
12374
|
baggage = baggage.setEntry(baggageKey, {
|
|
12375
|
-
value: mergedTags.join(
|
|
12375
|
+
value: mergedTags.join(ELASTICDASH_BAGGAGE_TAGS_SEPARATOR)
|
|
12376
12376
|
});
|
|
12377
12377
|
} else {
|
|
12378
12378
|
baggage = baggage.setEntry(baggageKey, { value });
|
|
@@ -12456,31 +12456,31 @@ function getSpanKeyForPropagatedKey(key) {
|
|
|
12456
12456
|
function getBaggageKeyForPropagatedKey(key) {
|
|
12457
12457
|
switch (key) {
|
|
12458
12458
|
case "userId":
|
|
12459
|
-
return `${
|
|
12459
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}user_id`;
|
|
12460
12460
|
case "sessionId":
|
|
12461
|
-
return `${
|
|
12461
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}session_id`;
|
|
12462
12462
|
case "version":
|
|
12463
|
-
return `${
|
|
12463
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}version`;
|
|
12464
12464
|
case "traceName":
|
|
12465
|
-
return `${
|
|
12465
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}trace_name`;
|
|
12466
12466
|
case "metadata":
|
|
12467
|
-
return `${
|
|
12467
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}metadata`;
|
|
12468
12468
|
case "tags":
|
|
12469
|
-
return `${
|
|
12469
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}tags`;
|
|
12470
12470
|
case "experimentId":
|
|
12471
|
-
return `${
|
|
12471
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_id`;
|
|
12472
12472
|
case "experimentName":
|
|
12473
|
-
return `${
|
|
12473
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_name`;
|
|
12474
12474
|
case "experimentMetadata":
|
|
12475
|
-
return `${
|
|
12475
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_metadata`;
|
|
12476
12476
|
case "experimentDatasetId":
|
|
12477
|
-
return `${
|
|
12477
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_dataset_id`;
|
|
12478
12478
|
case "experimentItemId":
|
|
12479
|
-
return `${
|
|
12479
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_item_id`;
|
|
12480
12480
|
case "experimentItemMetadata":
|
|
12481
|
-
return `${
|
|
12481
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_item_metadata`;
|
|
12482
12482
|
case "experimentItemRootObservationId":
|
|
12483
|
-
return `${
|
|
12483
|
+
return `${ELASTICDASH_BAGGAGE_PREFIX}experiment_item_root_observation_id`;
|
|
12484
12484
|
default: {
|
|
12485
12485
|
const fallback = key;
|
|
12486
12486
|
throw Error("Unhandled propagated key", fallback);
|
|
@@ -12488,8 +12488,8 @@ function getBaggageKeyForPropagatedKey(key) {
|
|
|
12488
12488
|
}
|
|
12489
12489
|
}
|
|
12490
12490
|
function getSpanKeyFromBaggageKey(baggageKey) {
|
|
12491
|
-
if (!baggageKey.startsWith(
|
|
12492
|
-
const suffix = baggageKey.slice(
|
|
12491
|
+
if (!baggageKey.startsWith(ELASTICDASH_BAGGAGE_PREFIX)) return;
|
|
12492
|
+
const suffix = baggageKey.slice(ELASTICDASH_BAGGAGE_PREFIX.length);
|
|
12493
12493
|
if (suffix.startsWith("metadata_")) {
|
|
12494
12494
|
const metadataKey = suffix.slice("metadata_".length);
|
|
12495
12495
|
return `${"langfuse.trace.metadata" /* TRACE_METADATA */}.${metadataKey}`;
|
|
@@ -12531,11 +12531,11 @@ export {
|
|
|
12531
12531
|
BlobStorageIntegrationType,
|
|
12532
12532
|
CommentObjectType,
|
|
12533
12533
|
DatasetStatus,
|
|
12534
|
+
ELASTICDASH_SDK_EXPERIMENT_ENVIRONMENT,
|
|
12535
|
+
ELASTICDASH_SDK_NAME,
|
|
12536
|
+
ELASTICDASH_SDK_VERSION,
|
|
12537
|
+
ELASTICDASH_TRACER_NAME,
|
|
12534
12538
|
Error2 as Error,
|
|
12535
|
-
LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT,
|
|
12536
|
-
LANGFUSE_SDK_NAME,
|
|
12537
|
-
LANGFUSE_SDK_VERSION,
|
|
12538
|
-
LANGFUSE_TRACER_NAME,
|
|
12539
12539
|
LangfuseAPIClient,
|
|
12540
12540
|
LangfuseAPIError,
|
|
12541
12541
|
LangfuseAPITimeoutError,
|