opik 0.0.1 → 0.0.2
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 +239 -127
- package/dist/index.d.cts +111 -89
- package/dist/index.d.ts +111 -89
- package/dist/index.js +239 -127
- package/package.json +12 -1
- package/examples/manual-trace.js +0 -16
- package/src/opik/client/Client.ts +0 -65
- package/src/opik/config/Config.ts +0 -35
- package/src/opik/index.ts +0 -2
- package/src/opik/rest_api/Client.ts +0 -247
- package/src/opik/rest_api/api/errors/BadRequestError.ts +0 -16
- package/src/opik/rest_api/api/errors/ConflictError.ts +0 -16
- package/src/opik/rest_api/api/errors/ForbiddenError.ts +0 -17
- package/src/opik/rest_api/api/errors/NotFoundError.ts +0 -16
- package/src/opik/rest_api/api/errors/NotImplementedError.ts +0 -16
- package/src/opik/rest_api/api/errors/UnauthorizedError.ts +0 -17
- package/src/opik/rest_api/api/errors/UnprocessableEntityError.ts +0 -16
- package/src/opik/rest_api/api/errors/index.ts +0 -7
- package/src/opik/rest_api/api/index.ts +0 -3
- package/src/opik/rest_api/api/resources/chatCompletions/client/Client.ts +0 -125
- package/src/opik/rest_api/api/resources/chatCompletions/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/chatCompletions/client/requests/ChatCompletionRequest.ts +0 -33
- package/src/opik/rest_api/api/resources/chatCompletions/client/requests/index.ts +0 -1
- package/src/opik/rest_api/api/resources/chatCompletions/index.ts +0 -1
- package/src/opik/rest_api/api/resources/check/client/Client.ts +0 -141
- package/src/opik/rest_api/api/resources/check/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/check/index.ts +0 -1
- package/src/opik/rest_api/api/resources/datasets/client/Client.ts +0 -1244
- package/src/opik/rest_api/api/resources/datasets/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetIdentifier.ts +0 -13
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetIdentifierPublic.ts +0 -13
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetItemBatchWrite.ts +0 -21
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetItemStreamRequest.ts +0 -9
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetItemsDelete.ts +0 -13
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetUpdate.ts +0 -14
- package/src/opik/rest_api/api/resources/datasets/client/requests/DatasetWrite.ts +0 -15
- package/src/opik/rest_api/api/resources/datasets/client/requests/FindDatasetItemsWithExperimentItemsRequest.ts +0 -17
- package/src/opik/rest_api/api/resources/datasets/client/requests/FindDatasetsRequest.ts +0 -16
- package/src/opik/rest_api/api/resources/datasets/client/requests/GetDatasetItemsOutputColumnsRequest.ts +0 -11
- package/src/opik/rest_api/api/resources/datasets/client/requests/GetDatasetItemsRequest.ts +0 -13
- package/src/opik/rest_api/api/resources/datasets/client/requests/index.ts +0 -11
- package/src/opik/rest_api/api/resources/datasets/index.ts +0 -1
- package/src/opik/rest_api/api/resources/experiments/client/Client.ts +0 -858
- package/src/opik/rest_api/api/resources/experiments/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/experiments/client/requests/ExperimentItemStreamRequest.ts +0 -9
- package/src/opik/rest_api/api/resources/experiments/client/requests/ExperimentItemsBatch.ts +0 -19
- package/src/opik/rest_api/api/resources/experiments/client/requests/ExperimentItemsDelete.ts +0 -13
- package/src/opik/rest_api/api/resources/experiments/client/requests/ExperimentWrite.ts +0 -19
- package/src/opik/rest_api/api/resources/experiments/client/requests/ExperimentsDelete.ts +0 -13
- package/src/opik/rest_api/api/resources/experiments/client/requests/FindExperimentsRequest.ts +0 -16
- package/src/opik/rest_api/api/resources/experiments/client/requests/FindFeedbackScoreNamesRequest.ts +0 -11
- package/src/opik/rest_api/api/resources/experiments/client/requests/IdentifierPublic.ts +0 -13
- package/src/opik/rest_api/api/resources/experiments/client/requests/index.ts +0 -8
- package/src/opik/rest_api/api/resources/experiments/index.ts +0 -1
- package/src/opik/rest_api/api/resources/feedbackDefinitions/client/Client.ts +0 -515
- package/src/opik/rest_api/api/resources/feedbackDefinitions/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/feedbackDefinitions/client/requests/FindFeedbackDefinitionsRequest.ts +0 -16
- package/src/opik/rest_api/api/resources/feedbackDefinitions/client/requests/index.ts +0 -1
- package/src/opik/rest_api/api/resources/feedbackDefinitions/index.ts +0 -2
- package/src/opik/rest_api/api/resources/feedbackDefinitions/types/FindFeedbackDefinitionsRequestType.ts +0 -10
- package/src/opik/rest_api/api/resources/feedbackDefinitions/types/index.ts +0 -1
- package/src/opik/rest_api/api/resources/index.ts +0 -23
- package/src/opik/rest_api/api/resources/llmProviderKey/client/Client.ts +0 -412
- package/src/opik/rest_api/api/resources/llmProviderKey/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/llmProviderKey/client/requests/ProviderApiKeyUpdate.ts +0 -13
- package/src/opik/rest_api/api/resources/llmProviderKey/client/requests/ProviderApiKeyWrite.ts +0 -13
- package/src/opik/rest_api/api/resources/llmProviderKey/client/requests/index.ts +0 -2
- package/src/opik/rest_api/api/resources/llmProviderKey/index.ts +0 -1
- package/src/opik/rest_api/api/resources/projects/client/Client.ts +0 -720
- package/src/opik/rest_api/api/resources/projects/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/projects/client/requests/FindProjectsRequest.ts +0 -14
- package/src/opik/rest_api/api/resources/projects/client/requests/ProjectMetricRequestPublic.ts +0 -16
- package/src/opik/rest_api/api/resources/projects/client/requests/ProjectRetrievePublic.ts +0 -13
- package/src/opik/rest_api/api/resources/projects/client/requests/ProjectUpdate.ts +0 -12
- package/src/opik/rest_api/api/resources/projects/client/requests/ProjectWrite.ts +0 -14
- package/src/opik/rest_api/api/resources/projects/client/requests/index.ts +0 -5
- package/src/opik/rest_api/api/resources/projects/index.ts +0 -2
- package/src/opik/rest_api/api/resources/projects/types/ProjectMetricRequestPublicInterval.ts +0 -11
- package/src/opik/rest_api/api/resources/projects/types/ProjectMetricRequestPublicMetricType.ts +0 -18
- package/src/opik/rest_api/api/resources/projects/types/index.ts +0 -2
- package/src/opik/rest_api/api/resources/prompts/client/Client.ts +0 -900
- package/src/opik/rest_api/api/resources/prompts/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/prompts/client/requests/CreatePromptVersionDetail.ts +0 -19
- package/src/opik/rest_api/api/resources/prompts/client/requests/GetPromptVersionsRequest.ts +0 -12
- package/src/opik/rest_api/api/resources/prompts/client/requests/GetPromptsRequest.ts +0 -13
- package/src/opik/rest_api/api/resources/prompts/client/requests/PromptUpdatable.ts +0 -14
- package/src/opik/rest_api/api/resources/prompts/client/requests/PromptVersionRetrieveDetail.ts +0 -14
- package/src/opik/rest_api/api/resources/prompts/client/requests/PromptWrite.ts +0 -16
- package/src/opik/rest_api/api/resources/prompts/client/requests/index.ts +0 -6
- package/src/opik/rest_api/api/resources/prompts/index.ts +0 -1
- package/src/opik/rest_api/api/resources/spans/client/Client.ts +0 -957
- package/src/opik/rest_api/api/resources/spans/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/spans/client/requests/FindFeedbackScoreNames1Request.ts +0 -14
- package/src/opik/rest_api/api/resources/spans/client/requests/GetSpanStatsRequest.ts +0 -17
- package/src/opik/rest_api/api/resources/spans/client/requests/GetSpansByProjectRequest.ts +0 -20
- package/src/opik/rest_api/api/resources/spans/client/requests/SpanBatchWrite.ts +0 -20
- package/src/opik/rest_api/api/resources/spans/client/requests/SpanUpdate.ts +0 -29
- package/src/opik/rest_api/api/resources/spans/client/requests/index.ts +0 -5
- package/src/opik/rest_api/api/resources/spans/index.ts +0 -2
- package/src/opik/rest_api/api/resources/spans/types/FindFeedbackScoreNames1RequestType.ts +0 -11
- package/src/opik/rest_api/api/resources/spans/types/GetSpanStatsRequestType.ts +0 -11
- package/src/opik/rest_api/api/resources/spans/types/GetSpansByProjectRequestType.ts +0 -11
- package/src/opik/rest_api/api/resources/spans/types/index.ts +0 -3
- package/src/opik/rest_api/api/resources/systemUsage/client/Client.ts +0 -347
- package/src/opik/rest_api/api/resources/systemUsage/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/systemUsage/index.ts +0 -1
- package/src/opik/rest_api/api/resources/traces/client/Client.ts +0 -990
- package/src/opik/rest_api/api/resources/traces/client/index.ts +0 -1
- package/src/opik/rest_api/api/resources/traces/client/requests/FindFeedbackScoreNames2Request.ts +0 -11
- package/src/opik/rest_api/api/resources/traces/client/requests/GetTraceStatsRequest.ts +0 -13
- package/src/opik/rest_api/api/resources/traces/client/requests/GetTracesByProjectRequest.ts +0 -16
- package/src/opik/rest_api/api/resources/traces/client/requests/TraceBatchWrite.ts +0 -18
- package/src/opik/rest_api/api/resources/traces/client/requests/TraceUpdate.ts +0 -22
- package/src/opik/rest_api/api/resources/traces/client/requests/index.ts +0 -5
- package/src/opik/rest_api/api/resources/traces/index.ts +0 -1
- package/src/opik/rest_api/api/types/AssistantMessage.ts +0 -14
- package/src/opik/rest_api/api/types/AssistantMessageRole.ts +0 -13
- package/src/opik/rest_api/api/types/AuthDetailsHolder.ts +0 -5
- package/src/opik/rest_api/api/types/AvgValueStatPublic.ts +0 -7
- package/src/opik/rest_api/api/types/BatchDelete.ts +0 -7
- package/src/opik/rest_api/api/types/BiInformation.ts +0 -9
- package/src/opik/rest_api/api/types/BiInformationResponse.ts +0 -9
- package/src/opik/rest_api/api/types/CategoricalFeedbackDefinition.ts +0 -13
- package/src/opik/rest_api/api/types/CategoricalFeedbackDefinitionCreate.ts +0 -9
- package/src/opik/rest_api/api/types/CategoricalFeedbackDefinitionPublic.ts +0 -13
- package/src/opik/rest_api/api/types/CategoricalFeedbackDefinitionUpdate.ts +0 -9
- package/src/opik/rest_api/api/types/CategoricalFeedbackDetail.ts +0 -7
- package/src/opik/rest_api/api/types/CategoricalFeedbackDetailCreate.ts +0 -7
- package/src/opik/rest_api/api/types/CategoricalFeedbackDetailPublic.ts +0 -7
- package/src/opik/rest_api/api/types/CategoricalFeedbackDetailUpdate.ts +0 -7
- package/src/opik/rest_api/api/types/ChatCompletionChoice.ts +0 -12
- package/src/opik/rest_api/api/types/ChatCompletionResponse.ts +0 -14
- package/src/opik/rest_api/api/types/ChunkedOutputJsonNode.ts +0 -10
- package/src/opik/rest_api/api/types/ChunkedOutputJsonNodeType.ts +0 -7
- package/src/opik/rest_api/api/types/Column.ts +0 -13
- package/src/opik/rest_api/api/types/ColumnCompare.ts +0 -13
- package/src/opik/rest_api/api/types/ColumnCompareTypesItem.ts +0 -14
- package/src/opik/rest_api/api/types/ColumnPublic.ts +0 -13
- package/src/opik/rest_api/api/types/ColumnPublicTypesItem.ts +0 -14
- package/src/opik/rest_api/api/types/ColumnTypesItem.ts +0 -14
- package/src/opik/rest_api/api/types/CompletionTokensDetails.ts +0 -7
- package/src/opik/rest_api/api/types/CountValueStatPublic.ts +0 -7
- package/src/opik/rest_api/api/types/DataPointNumberPublic.ts +0 -8
- package/src/opik/rest_api/api/types/Dataset.ts +0 -17
- package/src/opik/rest_api/api/types/DatasetItem.ts +0 -21
- package/src/opik/rest_api/api/types/DatasetItemBatch.ts +0 -13
- package/src/opik/rest_api/api/types/DatasetItemCompare.ts +0 -21
- package/src/opik/rest_api/api/types/DatasetItemCompareSource.ts +0 -12
- package/src/opik/rest_api/api/types/DatasetItemPageCompare.ts +0 -13
- package/src/opik/rest_api/api/types/DatasetItemPagePublic.ts +0 -13
- package/src/opik/rest_api/api/types/DatasetItemPublic.ts +0 -21
- package/src/opik/rest_api/api/types/DatasetItemPublicSource.ts +0 -12
- package/src/opik/rest_api/api/types/DatasetItemSource.ts +0 -12
- package/src/opik/rest_api/api/types/DatasetItemWrite.ts +0 -16
- package/src/opik/rest_api/api/types/DatasetItemWriteSource.ts +0 -12
- package/src/opik/rest_api/api/types/DatasetPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/DatasetPublic.ts +0 -17
- package/src/opik/rest_api/api/types/DeleteFeedbackScore.ts +0 -7
- package/src/opik/rest_api/api/types/Delta.ts +0 -12
- package/src/opik/rest_api/api/types/DeltaRole.ts +0 -13
- package/src/opik/rest_api/api/types/ErrorInfo.ts +0 -9
- package/src/opik/rest_api/api/types/ErrorInfoPublic.ts +0 -9
- package/src/opik/rest_api/api/types/ErrorInfoWrite.ts +0 -9
- package/src/opik/rest_api/api/types/ErrorMessage.ts +0 -9
- package/src/opik/rest_api/api/types/ErrorMessageDetail.ts +0 -9
- package/src/opik/rest_api/api/types/ErrorMessagePublic.ts +0 -7
- package/src/opik/rest_api/api/types/Experiment.ts +0 -20
- package/src/opik/rest_api/api/types/ExperimentItem.ts +0 -19
- package/src/opik/rest_api/api/types/ExperimentItemCompare.ts +0 -19
- package/src/opik/rest_api/api/types/ExperimentItemPublic.ts +0 -14
- package/src/opik/rest_api/api/types/ExperimentPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/ExperimentPublic.ts +0 -20
- package/src/opik/rest_api/api/types/Feedback.ts +0 -26
- package/src/opik/rest_api/api/types/FeedbackCreate.ts +0 -22
- package/src/opik/rest_api/api/types/FeedbackDefinitionPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/FeedbackObjectPublic.ts +0 -26
- package/src/opik/rest_api/api/types/FeedbackPublic.ts +0 -26
- package/src/opik/rest_api/api/types/FeedbackScore.ts +0 -17
- package/src/opik/rest_api/api/types/FeedbackScoreAverage.ts +0 -8
- package/src/opik/rest_api/api/types/FeedbackScoreAveragePublic.ts +0 -8
- package/src/opik/rest_api/api/types/FeedbackScoreBatch.ts +0 -9
- package/src/opik/rest_api/api/types/FeedbackScoreBatchItem.ts +0 -16
- package/src/opik/rest_api/api/types/FeedbackScoreBatchItemSource.ts +0 -10
- package/src/opik/rest_api/api/types/FeedbackScoreCompare.ts +0 -17
- package/src/opik/rest_api/api/types/FeedbackScoreCompareSource.ts +0 -10
- package/src/opik/rest_api/api/types/FeedbackScorePublic.ts +0 -17
- package/src/opik/rest_api/api/types/FeedbackScorePublicSource.ts +0 -10
- package/src/opik/rest_api/api/types/FeedbackScoreSource.ts +0 -10
- package/src/opik/rest_api/api/types/FeedbackUpdate.ts +0 -22
- package/src/opik/rest_api/api/types/Function.ts +0 -12
- package/src/opik/rest_api/api/types/FunctionCall.ts +0 -8
- package/src/opik/rest_api/api/types/JsonNode.ts +0 -5
- package/src/opik/rest_api/api/types/JsonNodeCompare.ts +0 -5
- package/src/opik/rest_api/api/types/JsonNodePublic.ts +0 -5
- package/src/opik/rest_api/api/types/JsonNodeWrite.ts +0 -5
- package/src/opik/rest_api/api/types/JsonObjectSchema.ts +0 -14
- package/src/opik/rest_api/api/types/JsonSchema.ts +0 -11
- package/src/opik/rest_api/api/types/JsonSchemaElement.ts +0 -7
- package/src/opik/rest_api/api/types/Message.ts +0 -5
- package/src/opik/rest_api/api/types/NumericalFeedbackDefinition.ts +0 -13
- package/src/opik/rest_api/api/types/NumericalFeedbackDefinitionCreate.ts +0 -9
- package/src/opik/rest_api/api/types/NumericalFeedbackDefinitionPublic.ts +0 -13
- package/src/opik/rest_api/api/types/NumericalFeedbackDefinitionUpdate.ts +0 -9
- package/src/opik/rest_api/api/types/NumericalFeedbackDetail.ts +0 -8
- package/src/opik/rest_api/api/types/NumericalFeedbackDetailCreate.ts +0 -8
- package/src/opik/rest_api/api/types/NumericalFeedbackDetailPublic.ts +0 -8
- package/src/opik/rest_api/api/types/NumericalFeedbackDetailUpdate.ts +0 -8
- package/src/opik/rest_api/api/types/PageColumns.ts +0 -9
- package/src/opik/rest_api/api/types/PercentageValueStatPublic.ts +0 -9
- package/src/opik/rest_api/api/types/PercentageValuesPublic.ts +0 -9
- package/src/opik/rest_api/api/types/Project.ts +0 -14
- package/src/opik/rest_api/api/types/ProjectMetricResponsePublic.ts +0 -12
- package/src/opik/rest_api/api/types/ProjectMetricResponsePublicInterval.ts +0 -11
- package/src/opik/rest_api/api/types/ProjectMetricResponsePublicMetricType.ts +0 -18
- package/src/opik/rest_api/api/types/ProjectPagePublic.ts +0 -13
- package/src/opik/rest_api/api/types/ProjectPublic.ts +0 -14
- package/src/opik/rest_api/api/types/ProjectStatItemObjectPublic.ts +0 -28
- package/src/opik/rest_api/api/types/ProjectStatsPublic.ts +0 -9
- package/src/opik/rest_api/api/types/Prompt.ts +0 -18
- package/src/opik/rest_api/api/types/PromptDetail.ts +0 -17
- package/src/opik/rest_api/api/types/PromptPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/PromptPublic.ts +0 -14
- package/src/opik/rest_api/api/types/PromptVersion.ts +0 -15
- package/src/opik/rest_api/api/types/PromptVersionDetail.ts +0 -15
- package/src/opik/rest_api/api/types/PromptVersionLink.ts +0 -9
- package/src/opik/rest_api/api/types/PromptVersionLinkPublic.ts +0 -9
- package/src/opik/rest_api/api/types/PromptVersionLinkWrite.ts +0 -7
- package/src/opik/rest_api/api/types/PromptVersionPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/PromptVersionPublic.ts +0 -14
- package/src/opik/rest_api/api/types/ProviderApiKey.ts +0 -13
- package/src/opik/rest_api/api/types/ProviderApiKeyPublic.ts +0 -12
- package/src/opik/rest_api/api/types/ResponseFormat.ts +0 -10
- package/src/opik/rest_api/api/types/ResponseFormatType.ts +0 -11
- package/src/opik/rest_api/api/types/ResultsNumberPublic.ts +0 -10
- package/src/opik/rest_api/api/types/Span.ts +0 -32
- package/src/opik/rest_api/api/types/SpanBatch.ts +0 -9
- package/src/opik/rest_api/api/types/SpanPagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/SpanPublic.ts +0 -30
- package/src/opik/rest_api/api/types/SpanPublicType.ts +0 -11
- package/src/opik/rest_api/api/types/SpanType.ts +0 -11
- package/src/opik/rest_api/api/types/SpanWrite.ts +0 -25
- package/src/opik/rest_api/api/types/SpanWriteType.ts +0 -11
- package/src/opik/rest_api/api/types/StreamOptions.ts +0 -7
- package/src/opik/rest_api/api/types/Tool.ts +0 -10
- package/src/opik/rest_api/api/types/ToolCall.ts +0 -12
- package/src/opik/rest_api/api/types/Trace.ts +0 -27
- package/src/opik/rest_api/api/types/TraceBatch.ts +0 -9
- package/src/opik/rest_api/api/types/TraceCountResponse.ts +0 -9
- package/src/opik/rest_api/api/types/TracePagePublic.ts +0 -12
- package/src/opik/rest_api/api/types/TracePublic.ts +0 -25
- package/src/opik/rest_api/api/types/TraceWrite.ts +0 -19
- package/src/opik/rest_api/api/types/Usage.ts +0 -12
- package/src/opik/rest_api/api/types/WorkspaceTraceCount.ts +0 -8
- package/src/opik/rest_api/api/types/index.ts +0 -138
- package/src/opik/rest_api/core/api-promise/APIPromise.ts +0 -54
- package/src/opik/rest_api/core/api-promise/index.ts +0 -1
- package/src/opik/rest_api/core/fetcher/APIResponse.ts +0 -12
- package/src/opik/rest_api/core/fetcher/Fetcher.ts +0 -143
- package/src/opik/rest_api/core/fetcher/Supplier.ts +0 -11
- package/src/opik/rest_api/core/fetcher/createRequestUrl.ts +0 -10
- package/src/opik/rest_api/core/fetcher/getFetchFn.ts +0 -25
- package/src/opik/rest_api/core/fetcher/getHeader.ts +0 -8
- package/src/opik/rest_api/core/fetcher/getRequestBody.ts +0 -14
- package/src/opik/rest_api/core/fetcher/getResponseBody.ts +0 -34
- package/src/opik/rest_api/core/fetcher/index.ts +0 -5
- package/src/opik/rest_api/core/fetcher/makeRequest.ts +0 -44
- package/src/opik/rest_api/core/fetcher/requestWithRetries.ts +0 -33
- package/src/opik/rest_api/core/fetcher/signals.ts +0 -38
- package/src/opik/rest_api/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +0 -256
- package/src/opik/rest_api/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +0 -106
- package/src/opik/rest_api/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +0 -243
- package/src/opik/rest_api/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +0 -33
- package/src/opik/rest_api/core/index.ts +0 -4
- package/src/opik/rest_api/core/runtime/index.ts +0 -1
- package/src/opik/rest_api/core/runtime/runtime.ts +0 -126
- package/src/opik/rest_api/core/schemas/Schema.ts +0 -99
- package/src/opik/rest_api/core/schemas/builders/bigint/bigint.ts +0 -50
- package/src/opik/rest_api/core/schemas/builders/bigint/index.ts +0 -1
- package/src/opik/rest_api/core/schemas/builders/date/date.ts +0 -65
- package/src/opik/rest_api/core/schemas/builders/date/index.ts +0 -1
- package/src/opik/rest_api/core/schemas/builders/enum/enum.ts +0 -43
- package/src/opik/rest_api/core/schemas/builders/enum/index.ts +0 -1
- package/src/opik/rest_api/core/schemas/builders/index.ts +0 -14
- package/src/opik/rest_api/core/schemas/builders/lazy/index.ts +0 -3
- package/src/opik/rest_api/core/schemas/builders/lazy/lazy.ts +0 -32
- package/src/opik/rest_api/core/schemas/builders/lazy/lazyObject.ts +0 -20
- package/src/opik/rest_api/core/schemas/builders/list/index.ts +0 -1
- package/src/opik/rest_api/core/schemas/builders/list/list.ts +0 -73
- package/src/opik/rest_api/core/schemas/builders/literals/booleanLiteral.ts +0 -29
- package/src/opik/rest_api/core/schemas/builders/literals/index.ts +0 -2
- package/src/opik/rest_api/core/schemas/builders/literals/stringLiteral.ts +0 -29
- package/src/opik/rest_api/core/schemas/builders/object/index.ts +0 -22
- package/src/opik/rest_api/core/schemas/builders/object/object.ts +0 -324
- package/src/opik/rest_api/core/schemas/builders/object/objectWithoutOptionalProperties.ts +0 -18
- package/src/opik/rest_api/core/schemas/builders/object/property.ts +0 -23
- package/src/opik/rest_api/core/schemas/builders/object/types.ts +0 -72
- package/src/opik/rest_api/core/schemas/builders/object-like/getObjectLikeUtils.ts +0 -79
- package/src/opik/rest_api/core/schemas/builders/object-like/index.ts +0 -2
- package/src/opik/rest_api/core/schemas/builders/object-like/types.ts +0 -11
- package/src/opik/rest_api/core/schemas/builders/primitives/any.ts +0 -4
- package/src/opik/rest_api/core/schemas/builders/primitives/boolean.ts +0 -25
- package/src/opik/rest_api/core/schemas/builders/primitives/index.ts +0 -5
- package/src/opik/rest_api/core/schemas/builders/primitives/number.ts +0 -25
- package/src/opik/rest_api/core/schemas/builders/primitives/string.ts +0 -25
- package/src/opik/rest_api/core/schemas/builders/primitives/unknown.ts +0 -4
- package/src/opik/rest_api/core/schemas/builders/record/index.ts +0 -2
- package/src/opik/rest_api/core/schemas/builders/record/record.ts +0 -130
- package/src/opik/rest_api/core/schemas/builders/record/types.ts +0 -17
- package/src/opik/rest_api/core/schemas/builders/schema-utils/JsonError.ts +0 -9
- package/src/opik/rest_api/core/schemas/builders/schema-utils/ParseError.ts +0 -9
- package/src/opik/rest_api/core/schemas/builders/schema-utils/getSchemaUtils.ts +0 -105
- package/src/opik/rest_api/core/schemas/builders/schema-utils/index.ts +0 -4
- package/src/opik/rest_api/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +0 -8
- package/src/opik/rest_api/core/schemas/builders/set/index.ts +0 -1
- package/src/opik/rest_api/core/schemas/builders/set/set.ts +0 -43
- package/src/opik/rest_api/core/schemas/builders/undiscriminated-union/index.ts +0 -6
- package/src/opik/rest_api/core/schemas/builders/undiscriminated-union/types.ts +0 -10
- package/src/opik/rest_api/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +0 -60
- package/src/opik/rest_api/core/schemas/builders/union/discriminant.ts +0 -14
- package/src/opik/rest_api/core/schemas/builders/union/index.ts +0 -10
- package/src/opik/rest_api/core/schemas/builders/union/types.ts +0 -26
- package/src/opik/rest_api/core/schemas/builders/union/union.ts +0 -170
- package/src/opik/rest_api/core/schemas/index.ts +0 -2
- package/src/opik/rest_api/core/schemas/utils/MaybePromise.ts +0 -1
- package/src/opik/rest_api/core/schemas/utils/addQuestionMarksToNullableProperties.ts +0 -15
- package/src/opik/rest_api/core/schemas/utils/createIdentitySchemaCreator.ts +0 -21
- package/src/opik/rest_api/core/schemas/utils/entries.ts +0 -3
- package/src/opik/rest_api/core/schemas/utils/filterObject.ts +0 -10
- package/src/opik/rest_api/core/schemas/utils/getErrorMessageForIncorrectType.ts +0 -25
- package/src/opik/rest_api/core/schemas/utils/isPlainObject.ts +0 -17
- package/src/opik/rest_api/core/schemas/utils/keys.ts +0 -3
- package/src/opik/rest_api/core/schemas/utils/maybeSkipValidation.ts +0 -38
- package/src/opik/rest_api/core/schemas/utils/partition.ts +0 -12
- package/src/opik/rest_api/environments.ts +0 -9
- package/src/opik/rest_api/errors/OpikApiError.ts +0 -45
- package/src/opik/rest_api/errors/OpikApiTimeoutError.ts +0 -10
- package/src/opik/rest_api/errors/index.ts +0 -2
- package/src/opik/rest_api/index.ts +0 -4
- package/src/opik/rest_api/serialization/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/chatCompletions/client/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/chatCompletions/client/requests/ChatCompletionRequest.ts +0 -72
- package/src/opik/rest_api/serialization/resources/chatCompletions/client/requests/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/chatCompletions/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/datasets/client/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetIdentifier.ts +0 -20
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetIdentifierPublic.ts +0 -20
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetItemBatchWrite.ts +0 -25
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetItemStreamRequest.ts +0 -24
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetItemsDelete.ts +0 -20
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetUpdate.ts +0 -20
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/DatasetWrite.ts +0 -22
- package/src/opik/rest_api/serialization/resources/datasets/client/requests/index.ts +0 -7
- package/src/opik/rest_api/serialization/resources/datasets/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/experiments/client/findFeedbackScoreNames.ts +0 -15
- package/src/opik/rest_api/serialization/resources/experiments/client/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/ExperimentItemStreamRequest.ts +0 -24
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/ExperimentItemsBatch.ts +0 -21
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/ExperimentItemsDelete.ts +0 -20
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/ExperimentWrite.ts +0 -28
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/ExperimentsDelete.ts +0 -20
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/IdentifierPublic.ts +0 -18
- package/src/opik/rest_api/serialization/resources/experiments/client/requests/index.ts +0 -6
- package/src/opik/rest_api/serialization/resources/experiments/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/feedbackDefinitions/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/feedbackDefinitions/types/FindFeedbackDefinitionsRequestType.ts +0 -16
- package/src/opik/rest_api/serialization/resources/feedbackDefinitions/types/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/index.ts +0 -20
- package/src/opik/rest_api/serialization/resources/llmProviderKey/client/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/llmProviderKey/client/requests/ProviderApiKeyUpdate.ts +0 -20
- package/src/opik/rest_api/serialization/resources/llmProviderKey/client/requests/ProviderApiKeyWrite.ts +0 -20
- package/src/opik/rest_api/serialization/resources/llmProviderKey/client/requests/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/llmProviderKey/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/projects/client/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/projects/client/requests/ProjectMetricRequestPublic.ts +0 -28
- package/src/opik/rest_api/serialization/resources/projects/client/requests/ProjectRetrievePublic.ts +0 -20
- package/src/opik/rest_api/serialization/resources/projects/client/requests/ProjectUpdate.ts +0 -20
- package/src/opik/rest_api/serialization/resources/projects/client/requests/ProjectWrite.ts +0 -20
- package/src/opik/rest_api/serialization/resources/projects/client/requests/index.ts +0 -4
- package/src/opik/rest_api/serialization/resources/projects/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/projects/types/ProjectMetricRequestPublicInterval.ts +0 -16
- package/src/opik/rest_api/serialization/resources/projects/types/ProjectMetricRequestPublicMetricType.ts +0 -16
- package/src/opik/rest_api/serialization/resources/projects/types/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/prompts/client/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/prompts/client/requests/CreatePromptVersionDetail.ts +0 -23
- package/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptUpdatable.ts +0 -20
- package/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptVersionRetrieveDetail.ts +0 -22
- package/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.ts +0 -24
- package/src/opik/rest_api/serialization/resources/prompts/client/requests/index.ts +0 -4
- package/src/opik/rest_api/serialization/resources/prompts/index.ts +0 -1
- package/src/opik/rest_api/serialization/resources/spans/client/findFeedbackScoreNames1.ts +0 -13
- package/src/opik/rest_api/serialization/resources/spans/client/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/spans/client/requests/SpanBatchWrite.ts +0 -19
- package/src/opik/rest_api/serialization/resources/spans/client/requests/SpanUpdate.ts +0 -44
- package/src/opik/rest_api/serialization/resources/spans/client/requests/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/spans/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/spans/types/FindFeedbackScoreNames1RequestType.ts +0 -16
- package/src/opik/rest_api/serialization/resources/spans/types/GetSpanStatsRequestType.ts +0 -16
- package/src/opik/rest_api/serialization/resources/spans/types/GetSpansByProjectRequestType.ts +0 -16
- package/src/opik/rest_api/serialization/resources/spans/types/index.ts +0 -3
- package/src/opik/rest_api/serialization/resources/traces/client/findFeedbackScoreNames2.ts +0 -13
- package/src/opik/rest_api/serialization/resources/traces/client/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/traces/client/requests/TraceBatchWrite.ts +0 -19
- package/src/opik/rest_api/serialization/resources/traces/client/requests/TraceUpdate.ts +0 -34
- package/src/opik/rest_api/serialization/resources/traces/client/requests/index.ts +0 -2
- package/src/opik/rest_api/serialization/resources/traces/index.ts +0 -1
- package/src/opik/rest_api/serialization/types/AssistantMessage.ts +0 -33
- package/src/opik/rest_api/serialization/types/AssistantMessageRole.ts +0 -16
- package/src/opik/rest_api/serialization/types/AuthDetailsHolder.ts +0 -16
- package/src/opik/rest_api/serialization/types/AvgValueStatPublic.ts +0 -20
- package/src/opik/rest_api/serialization/types/BatchDelete.ts +0 -18
- package/src/opik/rest_api/serialization/types/BiInformation.ts +0 -22
- package/src/opik/rest_api/serialization/types/BiInformationResponse.ts +0 -21
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDefinition.ts +0 -29
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDefinitionCreate.ts +0 -21
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDefinitionPublic.ts +0 -29
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDefinitionUpdate.ts +0 -21
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDetail.ts +0 -20
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDetailCreate.ts +0 -20
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDetailPublic.ts +0 -20
- package/src/opik/rest_api/serialization/types/CategoricalFeedbackDetailUpdate.ts +0 -20
- package/src/opik/rest_api/serialization/types/ChatCompletionChoice.ts +0 -28
- package/src/opik/rest_api/serialization/types/ChatCompletionResponse.ts +0 -32
- package/src/opik/rest_api/serialization/types/ChunkedOutputJsonNode.ts +0 -23
- package/src/opik/rest_api/serialization/types/ChunkedOutputJsonNodeType.ts +0 -20
- package/src/opik/rest_api/serialization/types/Column.ts +0 -25
- package/src/opik/rest_api/serialization/types/ColumnCompare.ts +0 -25
- package/src/opik/rest_api/serialization/types/ColumnCompareTypesItem.ts +0 -16
- package/src/opik/rest_api/serialization/types/ColumnPublic.ts +0 -25
- package/src/opik/rest_api/serialization/types/ColumnPublicTypesItem.ts +0 -16
- package/src/opik/rest_api/serialization/types/ColumnTypesItem.ts +0 -14
- package/src/opik/rest_api/serialization/types/CompletionTokensDetails.ts +0 -20
- package/src/opik/rest_api/serialization/types/CountValueStatPublic.ts +0 -20
- package/src/opik/rest_api/serialization/types/DataPointNumberPublic.ts +0 -22
- package/src/opik/rest_api/serialization/types/Dataset.ts +0 -44
- package/src/opik/rest_api/serialization/types/DatasetItem.ts +0 -48
- package/src/opik/rest_api/serialization/types/DatasetItemBatch.ts +0 -25
- package/src/opik/rest_api/serialization/types/DatasetItemCompare.ts +0 -51
- package/src/opik/rest_api/serialization/types/DatasetItemCompareSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/DatasetItemPageCompare.ts +0 -30
- package/src/opik/rest_api/serialization/types/DatasetItemPagePublic.ts +0 -30
- package/src/opik/rest_api/serialization/types/DatasetItemPublic.ts +0 -51
- package/src/opik/rest_api/serialization/types/DatasetItemPublicSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/DatasetItemSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/DatasetItemWrite.ts +0 -37
- package/src/opik/rest_api/serialization/types/DatasetItemWriteSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/DatasetPagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/DatasetPublic.ts +0 -44
- package/src/opik/rest_api/serialization/types/DeleteFeedbackScore.ts +0 -20
- package/src/opik/rest_api/serialization/types/Delta.ts +0 -26
- package/src/opik/rest_api/serialization/types/DeltaRole.ts +0 -14
- package/src/opik/rest_api/serialization/types/ErrorInfo.ts +0 -22
- package/src/opik/rest_api/serialization/types/ErrorInfoPublic.ts +0 -24
- package/src/opik/rest_api/serialization/types/ErrorInfoWrite.ts +0 -22
- package/src/opik/rest_api/serialization/types/ErrorMessage.ts +0 -22
- package/src/opik/rest_api/serialization/types/ErrorMessageDetail.ts +0 -24
- package/src/opik/rest_api/serialization/types/ErrorMessagePublic.ts +0 -20
- package/src/opik/rest_api/serialization/types/Experiment.ts +0 -46
- package/src/opik/rest_api/serialization/types/ExperimentItem.ts +0 -43
- package/src/opik/rest_api/serialization/types/ExperimentItemCompare.ts +0 -45
- package/src/opik/rest_api/serialization/types/ExperimentItemPublic.ts +0 -34
- package/src/opik/rest_api/serialization/types/ExperimentPagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/ExperimentPublic.ts +0 -48
- package/src/opik/rest_api/serialization/types/Feedback.ts +0 -48
- package/src/opik/rest_api/serialization/types/FeedbackCreate.ts +0 -41
- package/src/opik/rest_api/serialization/types/FeedbackDefinitionPagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/FeedbackObjectPublic.ts +0 -51
- package/src/opik/rest_api/serialization/types/FeedbackPublic.ts +0 -49
- package/src/opik/rest_api/serialization/types/FeedbackScore.ts +0 -35
- package/src/opik/rest_api/serialization/types/FeedbackScoreAverage.ts +0 -22
- package/src/opik/rest_api/serialization/types/FeedbackScoreAveragePublic.ts +0 -22
- package/src/opik/rest_api/serialization/types/FeedbackScoreBatch.ts +0 -21
- package/src/opik/rest_api/serialization/types/FeedbackScoreBatchItem.ts +0 -33
- package/src/opik/rest_api/serialization/types/FeedbackScoreBatchItemSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/FeedbackScoreCompare.ts +0 -37
- package/src/opik/rest_api/serialization/types/FeedbackScoreCompareSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/FeedbackScorePublic.ts +0 -37
- package/src/opik/rest_api/serialization/types/FeedbackScorePublicSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/FeedbackScoreSource.ts +0 -16
- package/src/opik/rest_api/serialization/types/FeedbackUpdate.ts +0 -41
- package/src/opik/rest_api/serialization/types/Function.ts +0 -25
- package/src/opik/rest_api/serialization/types/FunctionCall.ts +0 -20
- package/src/opik/rest_api/serialization/types/JsonNode.ts +0 -14
- package/src/opik/rest_api/serialization/types/JsonNodeCompare.ts +0 -14
- package/src/opik/rest_api/serialization/types/JsonNodePublic.ts +0 -14
- package/src/opik/rest_api/serialization/types/JsonNodeWrite.ts +0 -14
- package/src/opik/rest_api/serialization/types/JsonObjectSchema.ts +0 -34
- package/src/opik/rest_api/serialization/types/JsonSchema.ts +0 -23
- package/src/opik/rest_api/serialization/types/JsonSchemaElement.ts +0 -20
- package/src/opik/rest_api/serialization/types/Message.ts +0 -16
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDefinition.ts +0 -29
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDefinitionCreate.ts +0 -21
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDefinitionPublic.ts +0 -29
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDefinitionUpdate.ts +0 -21
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDetail.ts +0 -22
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDetailCreate.ts +0 -22
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDetailPublic.ts +0 -22
- package/src/opik/rest_api/serialization/types/NumericalFeedbackDetailUpdate.ts +0 -22
- package/src/opik/rest_api/serialization/types/PageColumns.ts +0 -19
- package/src/opik/rest_api/serialization/types/PercentageValueStatPublic.ts +0 -21
- package/src/opik/rest_api/serialization/types/PercentageValuesPublic.ts +0 -24
- package/src/opik/rest_api/serialization/types/Project.ts +0 -32
- package/src/opik/rest_api/serialization/types/ProjectMetricResponsePublic.ts +0 -29
- package/src/opik/rest_api/serialization/types/ProjectMetricResponsePublicInterval.ts +0 -16
- package/src/opik/rest_api/serialization/types/ProjectMetricResponsePublicMetricType.ts +0 -16
- package/src/opik/rest_api/serialization/types/ProjectPagePublic.ts +0 -29
- package/src/opik/rest_api/serialization/types/ProjectPublic.ts +0 -32
- package/src/opik/rest_api/serialization/types/ProjectStatItemObjectPublic.ts +0 -50
- package/src/opik/rest_api/serialization/types/ProjectStatsPublic.ts +0 -21
- package/src/opik/rest_api/serialization/types/Prompt.ts +0 -37
- package/src/opik/rest_api/serialization/types/PromptDetail.ts +0 -35
- package/src/opik/rest_api/serialization/types/PromptPagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/PromptPublic.ts +0 -32
- package/src/opik/rest_api/serialization/types/PromptVersion.ts +0 -30
- package/src/opik/rest_api/serialization/types/PromptVersionDetail.ts +0 -32
- package/src/opik/rest_api/serialization/types/PromptVersionLink.ts +0 -24
- package/src/opik/rest_api/serialization/types/PromptVersionLinkPublic.ts +0 -24
- package/src/opik/rest_api/serialization/types/PromptVersionLinkWrite.ts +0 -20
- package/src/opik/rest_api/serialization/types/PromptVersionPagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/PromptVersionPublic.ts +0 -30
- package/src/opik/rest_api/serialization/types/ProviderApiKey.ts +0 -30
- package/src/opik/rest_api/serialization/types/ProviderApiKeyPublic.ts +0 -30
- package/src/opik/rest_api/serialization/types/ResponseFormat.ts +0 -22
- package/src/opik/rest_api/serialization/types/ResponseFormatType.ts +0 -16
- package/src/opik/rest_api/serialization/types/ResultsNumberPublic.ts +0 -23
- package/src/opik/rest_api/serialization/types/Span.ts +0 -65
- package/src/opik/rest_api/serialization/types/SpanBatch.ts +0 -19
- package/src/opik/rest_api/serialization/types/SpanPagePublic.ts +0 -25
- package/src/opik/rest_api/serialization/types/SpanPublic.ts +0 -67
- package/src/opik/rest_api/serialization/types/SpanPublicType.ts +0 -14
- package/src/opik/rest_api/serialization/types/SpanType.ts +0 -15
- package/src/opik/rest_api/serialization/types/SpanWrite.ts +0 -51
- package/src/opik/rest_api/serialization/types/SpanWriteType.ts +0 -14
- package/src/opik/rest_api/serialization/types/StreamOptions.ts +0 -18
- package/src/opik/rest_api/serialization/types/Tool.ts +0 -20
- package/src/opik/rest_api/serialization/types/ToolCall.ts +0 -25
- package/src/opik/rest_api/serialization/types/Trace.ts +0 -54
- package/src/opik/rest_api/serialization/types/TraceBatch.ts +0 -19
- package/src/opik/rest_api/serialization/types/TraceCountResponse.ts +0 -24
- package/src/opik/rest_api/serialization/types/TracePagePublic.ts +0 -27
- package/src/opik/rest_api/serialization/types/TracePublic.ts +0 -56
- package/src/opik/rest_api/serialization/types/TraceWrite.ts +0 -38
- package/src/opik/rest_api/serialization/types/Usage.ts +0 -27
- package/src/opik/rest_api/serialization/types/WorkspaceTraceCount.ts +0 -22
- package/src/opik/rest_api/serialization/types/index.ts +0 -138
- package/src/opik/tracer/Span.ts +0 -34
- package/src/opik/tracer/Trace.ts +0 -61
- package/tests/client.test.ts +0 -25
- package/tsconfig.json +0 -25
- package/tsup.config.ts +0 -11
- package/vitest.config.ts +0 -13
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as OpikApi from "../index";
|
|
6
|
-
|
|
7
|
-
export interface TracePublic {
|
|
8
|
-
id?: string;
|
|
9
|
-
projectId?: string;
|
|
10
|
-
name: string;
|
|
11
|
-
startTime: Date;
|
|
12
|
-
endTime?: Date;
|
|
13
|
-
input?: OpikApi.JsonNodePublic;
|
|
14
|
-
output?: OpikApi.JsonNodePublic;
|
|
15
|
-
metadata?: OpikApi.JsonNodePublic;
|
|
16
|
-
tags?: string[];
|
|
17
|
-
errorInfo?: OpikApi.ErrorInfoPublic;
|
|
18
|
-
usage?: Record<string, number>;
|
|
19
|
-
createdAt?: Date;
|
|
20
|
-
lastUpdatedAt?: Date;
|
|
21
|
-
createdBy?: string;
|
|
22
|
-
lastUpdatedBy?: string;
|
|
23
|
-
feedbackScores?: OpikApi.FeedbackScorePublic[];
|
|
24
|
-
totalEstimatedCost?: number;
|
|
25
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as OpikApi from "../index";
|
|
6
|
-
|
|
7
|
-
export interface TraceWrite {
|
|
8
|
-
id?: string;
|
|
9
|
-
/** If null, the default project is used */
|
|
10
|
-
projectName?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
startTime: Date;
|
|
13
|
-
endTime?: Date;
|
|
14
|
-
input?: OpikApi.JsonNodeWrite;
|
|
15
|
-
output?: OpikApi.JsonNodeWrite;
|
|
16
|
-
metadata?: OpikApi.JsonNodeWrite;
|
|
17
|
-
tags?: string[];
|
|
18
|
-
errorInfo?: OpikApi.ErrorInfoWrite;
|
|
19
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as OpikApi from "../index";
|
|
6
|
-
|
|
7
|
-
export interface Usage {
|
|
8
|
-
totalTokens?: number;
|
|
9
|
-
promptTokens?: number;
|
|
10
|
-
completionTokens?: number;
|
|
11
|
-
completionTokensDetails?: OpikApi.CompletionTokensDetails;
|
|
12
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
export * from "./BiInformation";
|
|
2
|
-
export * from "./BiInformationResponse";
|
|
3
|
-
export * from "./TraceCountResponse";
|
|
4
|
-
export * from "./WorkspaceTraceCount";
|
|
5
|
-
export * from "./ErrorMessage";
|
|
6
|
-
export * from "./AuthDetailsHolder";
|
|
7
|
-
export * from "./AssistantMessageRole";
|
|
8
|
-
export * from "./AssistantMessage";
|
|
9
|
-
export * from "./ChatCompletionChoice";
|
|
10
|
-
export * from "./ChatCompletionResponse";
|
|
11
|
-
export * from "./CompletionTokensDetails";
|
|
12
|
-
export * from "./DeltaRole";
|
|
13
|
-
export * from "./Delta";
|
|
14
|
-
export * from "./FunctionCall";
|
|
15
|
-
export * from "./ToolCall";
|
|
16
|
-
export * from "./Usage";
|
|
17
|
-
export * from "./Function";
|
|
18
|
-
export * from "./JsonObjectSchema";
|
|
19
|
-
export * from "./JsonSchema";
|
|
20
|
-
export * from "./JsonSchemaElement";
|
|
21
|
-
export * from "./Message";
|
|
22
|
-
export * from "./ResponseFormatType";
|
|
23
|
-
export * from "./ResponseFormat";
|
|
24
|
-
export * from "./StreamOptions";
|
|
25
|
-
export * from "./Tool";
|
|
26
|
-
export * from "./Dataset";
|
|
27
|
-
export * from "./DatasetItemSource";
|
|
28
|
-
export * from "./DatasetItem";
|
|
29
|
-
export * from "./DatasetItemBatch";
|
|
30
|
-
export * from "./ExperimentItem";
|
|
31
|
-
export * from "./FeedbackScoreSource";
|
|
32
|
-
export * from "./FeedbackScore";
|
|
33
|
-
export * from "./JsonNode";
|
|
34
|
-
export * from "./DatasetItemWriteSource";
|
|
35
|
-
export * from "./DatasetItemWrite";
|
|
36
|
-
export * from "./JsonNodeWrite";
|
|
37
|
-
export * from "./BatchDelete";
|
|
38
|
-
export * from "./ColumnCompareTypesItem";
|
|
39
|
-
export * from "./ColumnCompare";
|
|
40
|
-
export * from "./DatasetItemPageCompare";
|
|
41
|
-
export * from "./DatasetItemCompareSource";
|
|
42
|
-
export * from "./DatasetItemCompare";
|
|
43
|
-
export * from "./ExperimentItemCompare";
|
|
44
|
-
export * from "./FeedbackScoreCompareSource";
|
|
45
|
-
export * from "./FeedbackScoreCompare";
|
|
46
|
-
export * from "./JsonNodeCompare";
|
|
47
|
-
export * from "./DatasetPagePublic";
|
|
48
|
-
export * from "./DatasetPublic";
|
|
49
|
-
export * from "./DatasetItemPublicSource";
|
|
50
|
-
export * from "./DatasetItemPublic";
|
|
51
|
-
export * from "./ExperimentItemPublic";
|
|
52
|
-
export * from "./JsonNodePublic";
|
|
53
|
-
export * from "./ColumnPublicTypesItem";
|
|
54
|
-
export * from "./ColumnPublic";
|
|
55
|
-
export * from "./DatasetItemPagePublic";
|
|
56
|
-
export * from "./ColumnTypesItem";
|
|
57
|
-
export * from "./Column";
|
|
58
|
-
export * from "./PageColumns";
|
|
59
|
-
export * from "./ChunkedOutputJsonNodeType";
|
|
60
|
-
export * from "./ChunkedOutputJsonNode";
|
|
61
|
-
export * from "./Experiment";
|
|
62
|
-
export * from "./FeedbackScoreAverage";
|
|
63
|
-
export * from "./PromptVersionLink";
|
|
64
|
-
export * from "./PromptVersionLinkWrite";
|
|
65
|
-
export * from "./ExperimentPagePublic";
|
|
66
|
-
export * from "./ExperimentPublic";
|
|
67
|
-
export * from "./FeedbackScoreAveragePublic";
|
|
68
|
-
export * from "./PromptVersionLinkPublic";
|
|
69
|
-
export * from "./ErrorMessagePublic";
|
|
70
|
-
export * from "./CategoricalFeedbackDefinition";
|
|
71
|
-
export * from "./CategoricalFeedbackDetail";
|
|
72
|
-
export * from "./Feedback";
|
|
73
|
-
export * from "./NumericalFeedbackDefinition";
|
|
74
|
-
export * from "./NumericalFeedbackDetail";
|
|
75
|
-
export * from "./CategoricalFeedbackDefinitionCreate";
|
|
76
|
-
export * from "./CategoricalFeedbackDetailCreate";
|
|
77
|
-
export * from "./FeedbackCreate";
|
|
78
|
-
export * from "./NumericalFeedbackDefinitionCreate";
|
|
79
|
-
export * from "./NumericalFeedbackDetailCreate";
|
|
80
|
-
export * from "./CategoricalFeedbackDefinitionPublic";
|
|
81
|
-
export * from "./CategoricalFeedbackDetailPublic";
|
|
82
|
-
export * from "./FeedbackDefinitionPagePublic";
|
|
83
|
-
export * from "./FeedbackObjectPublic";
|
|
84
|
-
export * from "./NumericalFeedbackDefinitionPublic";
|
|
85
|
-
export * from "./NumericalFeedbackDetailPublic";
|
|
86
|
-
export * from "./FeedbackPublic";
|
|
87
|
-
export * from "./CategoricalFeedbackDefinitionUpdate";
|
|
88
|
-
export * from "./CategoricalFeedbackDetailUpdate";
|
|
89
|
-
export * from "./FeedbackUpdate";
|
|
90
|
-
export * from "./NumericalFeedbackDefinitionUpdate";
|
|
91
|
-
export * from "./NumericalFeedbackDetailUpdate";
|
|
92
|
-
export * from "./ProjectPagePublic";
|
|
93
|
-
export * from "./ProviderApiKeyPublic";
|
|
94
|
-
export * from "./ProviderApiKey";
|
|
95
|
-
export * from "./Project";
|
|
96
|
-
export * from "./ProjectPublic";
|
|
97
|
-
export * from "./DataPointNumberPublic";
|
|
98
|
-
export * from "./ProjectMetricResponsePublicMetricType";
|
|
99
|
-
export * from "./ProjectMetricResponsePublicInterval";
|
|
100
|
-
export * from "./ProjectMetricResponsePublic";
|
|
101
|
-
export * from "./ResultsNumberPublic";
|
|
102
|
-
export * from "./Prompt";
|
|
103
|
-
export * from "./PromptVersion";
|
|
104
|
-
export * from "./PromptVersionDetail";
|
|
105
|
-
export * from "./ErrorMessageDetail";
|
|
106
|
-
export * from "./PromptDetail";
|
|
107
|
-
export * from "./PromptVersionPagePublic";
|
|
108
|
-
export * from "./PromptVersionPublic";
|
|
109
|
-
export * from "./PromptPagePublic";
|
|
110
|
-
export * from "./PromptPublic";
|
|
111
|
-
export * from "./ErrorInfo";
|
|
112
|
-
export * from "./SpanType";
|
|
113
|
-
export * from "./Span";
|
|
114
|
-
export * from "./ErrorInfoWrite";
|
|
115
|
-
export * from "./SpanWriteType";
|
|
116
|
-
export * from "./SpanWrite";
|
|
117
|
-
export * from "./SpanBatch";
|
|
118
|
-
export * from "./DeleteFeedbackScore";
|
|
119
|
-
export * from "./ErrorInfoPublic";
|
|
120
|
-
export * from "./FeedbackScorePublicSource";
|
|
121
|
-
export * from "./FeedbackScorePublic";
|
|
122
|
-
export * from "./SpanPublicType";
|
|
123
|
-
export * from "./SpanPublic";
|
|
124
|
-
export * from "./SpanPagePublic";
|
|
125
|
-
export * from "./AvgValueStatPublic";
|
|
126
|
-
export * from "./CountValueStatPublic";
|
|
127
|
-
export * from "./PercentageValueStatPublic";
|
|
128
|
-
export * from "./PercentageValuesPublic";
|
|
129
|
-
export * from "./ProjectStatItemObjectPublic";
|
|
130
|
-
export * from "./ProjectStatsPublic";
|
|
131
|
-
export * from "./FeedbackScoreBatch";
|
|
132
|
-
export * from "./FeedbackScoreBatchItemSource";
|
|
133
|
-
export * from "./FeedbackScoreBatchItem";
|
|
134
|
-
export * from "./Trace";
|
|
135
|
-
export * from "./TraceWrite";
|
|
136
|
-
export * from "./TraceBatch";
|
|
137
|
-
export * from "./TracePublic";
|
|
138
|
-
export * from "./TracePagePublic";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { APIResponse } from "../fetcher/APIResponse";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* APIPromise wraps a Promise that resolves with an APIResponse.
|
|
5
|
-
* It provides convenient methods for handling both successful responses and errors.
|
|
6
|
-
*
|
|
7
|
-
* By default, when awaited, it will return just the response body data.
|
|
8
|
-
* Use the `asRaw()` method to get access to both the response data and headers.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* // Get just the response data
|
|
12
|
-
* const data = await apiPromise;
|
|
13
|
-
*
|
|
14
|
-
* // Get response with headers
|
|
15
|
-
* const { data, headers } = await apiPromise.asRaw();
|
|
16
|
-
*
|
|
17
|
-
* @template T The type of the successful response body
|
|
18
|
-
*/
|
|
19
|
-
export class APIPromise<T> extends Promise<T> {
|
|
20
|
-
constructor(
|
|
21
|
-
private readonly responsePromise: Promise<APIResponse<T, unknown>>,
|
|
22
|
-
executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void
|
|
23
|
-
) {
|
|
24
|
-
super(executor);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public async asRaw(): Promise<{
|
|
28
|
-
data: T;
|
|
29
|
-
headers?: Record<string, any>;
|
|
30
|
-
}> {
|
|
31
|
-
const response = await this.responsePromise;
|
|
32
|
-
if (!response.ok) {
|
|
33
|
-
throw response.error;
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
data: response.body,
|
|
37
|
-
headers: response.headers,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public static from<T>(responsePromise: Promise<APIResponse<T, unknown>>): APIPromise<T> {
|
|
42
|
-
return new APIPromise(responsePromise, (resolve, reject) => {
|
|
43
|
-
responsePromise
|
|
44
|
-
.then((response) => {
|
|
45
|
-
if (response.ok) {
|
|
46
|
-
resolve(response.body);
|
|
47
|
-
} else {
|
|
48
|
-
reject(response.error);
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
.catch(reject);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { APIPromise } from "./APIPromise";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
|
|
2
|
-
|
|
3
|
-
export interface SuccessfulResponse<T> {
|
|
4
|
-
ok: true;
|
|
5
|
-
body: T;
|
|
6
|
-
headers?: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface FailedResponse<T> {
|
|
10
|
-
ok: false;
|
|
11
|
-
error: T;
|
|
12
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { APIResponse } from "./APIResponse";
|
|
2
|
-
import { createRequestUrl } from "./createRequestUrl";
|
|
3
|
-
import { getFetchFn } from "./getFetchFn";
|
|
4
|
-
import { getRequestBody } from "./getRequestBody";
|
|
5
|
-
import { getResponseBody } from "./getResponseBody";
|
|
6
|
-
import { makeRequest } from "./makeRequest";
|
|
7
|
-
import { requestWithRetries } from "./requestWithRetries";
|
|
8
|
-
|
|
9
|
-
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
10
|
-
|
|
11
|
-
export declare namespace Fetcher {
|
|
12
|
-
export interface Args {
|
|
13
|
-
url: string;
|
|
14
|
-
method: string;
|
|
15
|
-
contentType?: string;
|
|
16
|
-
headers?: Record<string, string | undefined>;
|
|
17
|
-
queryParameters?: Record<string, string | string[] | object | object[]>;
|
|
18
|
-
body?: unknown;
|
|
19
|
-
timeoutMs?: number;
|
|
20
|
-
maxRetries?: number;
|
|
21
|
-
withCredentials?: boolean;
|
|
22
|
-
abortSignal?: AbortSignal;
|
|
23
|
-
requestType?: "json" | "file" | "bytes";
|
|
24
|
-
responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer";
|
|
25
|
-
duplex?: "half";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
29
|
-
|
|
30
|
-
export interface FailedStatusCodeError {
|
|
31
|
-
reason: "status-code";
|
|
32
|
-
statusCode: number;
|
|
33
|
-
body: unknown;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface NonJsonError {
|
|
37
|
-
reason: "non-json";
|
|
38
|
-
statusCode: number;
|
|
39
|
-
rawBody: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface TimeoutError {
|
|
43
|
-
reason: "timeout";
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface UnknownError {
|
|
47
|
-
reason: "unknown";
|
|
48
|
-
errorMessage: string;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export async function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>> {
|
|
53
|
-
const headers: Record<string, string> = {};
|
|
54
|
-
if (args.body !== undefined && args.contentType != null) {
|
|
55
|
-
headers["Content-Type"] = args.contentType;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (args.headers != null) {
|
|
59
|
-
for (const [key, value] of Object.entries(args.headers)) {
|
|
60
|
-
if (value != null) {
|
|
61
|
-
headers[key] = value;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const url = createRequestUrl(args.url, args.queryParameters);
|
|
67
|
-
let requestBody: BodyInit | undefined = await getRequestBody({
|
|
68
|
-
body: args.body,
|
|
69
|
-
type: args.requestType === "json" ? "json" : "other",
|
|
70
|
-
});
|
|
71
|
-
const fetchFn = await getFetchFn();
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const response = await requestWithRetries(
|
|
75
|
-
async () =>
|
|
76
|
-
makeRequest(
|
|
77
|
-
fetchFn,
|
|
78
|
-
url,
|
|
79
|
-
args.method,
|
|
80
|
-
headers,
|
|
81
|
-
requestBody,
|
|
82
|
-
args.timeoutMs,
|
|
83
|
-
args.abortSignal,
|
|
84
|
-
args.withCredentials,
|
|
85
|
-
args.duplex
|
|
86
|
-
),
|
|
87
|
-
args.maxRetries
|
|
88
|
-
);
|
|
89
|
-
let responseBody = await getResponseBody(response, args.responseType);
|
|
90
|
-
|
|
91
|
-
if (response.status >= 200 && response.status < 400) {
|
|
92
|
-
return {
|
|
93
|
-
ok: true,
|
|
94
|
-
body: responseBody as R,
|
|
95
|
-
headers: response.headers,
|
|
96
|
-
};
|
|
97
|
-
} else {
|
|
98
|
-
return {
|
|
99
|
-
ok: false,
|
|
100
|
-
error: {
|
|
101
|
-
reason: "status-code",
|
|
102
|
-
statusCode: response.status,
|
|
103
|
-
body: responseBody,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
} catch (error) {
|
|
108
|
-
if (args.abortSignal != null && args.abortSignal.aborted) {
|
|
109
|
-
return {
|
|
110
|
-
ok: false,
|
|
111
|
-
error: {
|
|
112
|
-
reason: "unknown",
|
|
113
|
-
errorMessage: "The user aborted a request",
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
} else if (error instanceof Error && error.name === "AbortError") {
|
|
117
|
-
return {
|
|
118
|
-
ok: false,
|
|
119
|
-
error: {
|
|
120
|
-
reason: "timeout",
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
} else if (error instanceof Error) {
|
|
124
|
-
return {
|
|
125
|
-
ok: false,
|
|
126
|
-
error: {
|
|
127
|
-
reason: "unknown",
|
|
128
|
-
errorMessage: error.message,
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return {
|
|
134
|
-
ok: false,
|
|
135
|
-
error: {
|
|
136
|
-
reason: "unknown",
|
|
137
|
-
errorMessage: JSON.stringify(error),
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export const fetcher: FetchFunction = fetcherImpl;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type Supplier<T> = T | Promise<T> | (() => T | Promise<T>);
|
|
2
|
-
|
|
3
|
-
export const Supplier = {
|
|
4
|
-
get: async <T>(supplier: Supplier<T>): Promise<T> => {
|
|
5
|
-
if (typeof supplier === "function") {
|
|
6
|
-
return (supplier as () => T)();
|
|
7
|
-
} else {
|
|
8
|
-
return supplier;
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import qs from "qs";
|
|
2
|
-
|
|
3
|
-
export function createRequestUrl(
|
|
4
|
-
baseUrl: string,
|
|
5
|
-
queryParameters?: Record<string, string | string[] | object | object[]>
|
|
6
|
-
): string {
|
|
7
|
-
return Object.keys(queryParameters ?? {}).length > 0
|
|
8
|
-
? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}`
|
|
9
|
-
: baseUrl;
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { RUNTIME } from "../runtime";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns a fetch function based on the runtime
|
|
5
|
-
*/
|
|
6
|
-
export async function getFetchFn(): Promise<any> {
|
|
7
|
-
// In Node.js 18+ environments, use native fetch
|
|
8
|
-
if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) {
|
|
9
|
-
return fetch;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// In Node.js 18 or lower environments, the SDK always uses`node-fetch`.
|
|
13
|
-
if (RUNTIME.type === "node") {
|
|
14
|
-
return (await import("node-fetch")).default as any;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Otherwise the SDK uses global fetch if available,
|
|
18
|
-
// and falls back to node-fetch.
|
|
19
|
-
if (typeof fetch == "function") {
|
|
20
|
-
return fetch;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Defaults to node `node-fetch` if global fetch isn't available
|
|
24
|
-
return (await import("node-fetch")).default as any;
|
|
25
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function getHeader(headers: Record<string, any>, header: string): string | undefined {
|
|
2
|
-
for (const [headerKey, headerValue] of Object.entries(headers)) {
|
|
3
|
-
if (headerKey.toLowerCase() === header.toLowerCase()) {
|
|
4
|
-
return headerValue;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare namespace GetRequestBody {
|
|
2
|
-
interface Args {
|
|
3
|
-
body: unknown;
|
|
4
|
-
type: "json" | "file" | "bytes" | "other";
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise<BodyInit | undefined> {
|
|
9
|
-
if (type.includes("json")) {
|
|
10
|
-
return JSON.stringify(body);
|
|
11
|
-
} else {
|
|
12
|
-
return body as BodyInit;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper";
|
|
2
|
-
|
|
3
|
-
export async function getResponseBody(response: Response, responseType?: string): Promise<unknown> {
|
|
4
|
-
if (response.body != null && responseType === "blob") {
|
|
5
|
-
return await response.blob();
|
|
6
|
-
} else if (response.body != null && responseType === "arrayBuffer") {
|
|
7
|
-
return await response.arrayBuffer();
|
|
8
|
-
} else if (response.body != null && responseType === "sse") {
|
|
9
|
-
return response.body;
|
|
10
|
-
} else if (response.body != null && responseType === "streaming") {
|
|
11
|
-
return chooseStreamWrapper(response.body);
|
|
12
|
-
} else if (response.body != null && responseType === "text") {
|
|
13
|
-
return await response.text();
|
|
14
|
-
} else {
|
|
15
|
-
const text = await response.text();
|
|
16
|
-
if (text.length > 0) {
|
|
17
|
-
try {
|
|
18
|
-
let responseBody = JSON.parse(text);
|
|
19
|
-
return responseBody;
|
|
20
|
-
} catch (err) {
|
|
21
|
-
return {
|
|
22
|
-
ok: false,
|
|
23
|
-
error: {
|
|
24
|
-
reason: "non-json",
|
|
25
|
-
statusCode: response.status,
|
|
26
|
-
rawBody: text,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { anySignal, getTimeoutSignal } from "./signals";
|
|
2
|
-
|
|
3
|
-
export const makeRequest = async (
|
|
4
|
-
fetchFn: (url: string, init: RequestInit) => Promise<Response>,
|
|
5
|
-
url: string,
|
|
6
|
-
method: string,
|
|
7
|
-
headers: Record<string, string>,
|
|
8
|
-
requestBody: BodyInit | undefined,
|
|
9
|
-
timeoutMs?: number,
|
|
10
|
-
abortSignal?: AbortSignal,
|
|
11
|
-
withCredentials?: boolean,
|
|
12
|
-
duplex?: "half"
|
|
13
|
-
): Promise<Response> => {
|
|
14
|
-
const signals: AbortSignal[] = [];
|
|
15
|
-
|
|
16
|
-
// Add timeout signal
|
|
17
|
-
let timeoutAbortId: NodeJS.Timeout | undefined = undefined;
|
|
18
|
-
if (timeoutMs != null) {
|
|
19
|
-
const { signal, abortId } = getTimeoutSignal(timeoutMs);
|
|
20
|
-
timeoutAbortId = abortId;
|
|
21
|
-
signals.push(signal);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Add arbitrary signal
|
|
25
|
-
if (abortSignal != null) {
|
|
26
|
-
signals.push(abortSignal);
|
|
27
|
-
}
|
|
28
|
-
let newSignals = anySignal(signals);
|
|
29
|
-
const response = await fetchFn(url, {
|
|
30
|
-
method: method,
|
|
31
|
-
headers,
|
|
32
|
-
body: requestBody,
|
|
33
|
-
signal: newSignals,
|
|
34
|
-
credentials: withCredentials ? "include" : undefined,
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
duplex,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (timeoutAbortId != null) {
|
|
40
|
-
clearTimeout(timeoutAbortId);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return response;
|
|
44
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const INITIAL_RETRY_DELAY = 1000; // in milliseconds
|
|
2
|
-
const MAX_RETRY_DELAY = 60000; // in milliseconds
|
|
3
|
-
const DEFAULT_MAX_RETRIES = 2;
|
|
4
|
-
const JITTER_FACTOR = 0.2; // 20% random jitter
|
|
5
|
-
|
|
6
|
-
function addJitter(delay: number): number {
|
|
7
|
-
// Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
|
|
8
|
-
const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
|
|
9
|
-
return delay * jitterMultiplier;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export async function requestWithRetries(
|
|
13
|
-
requestFn: () => Promise<Response>,
|
|
14
|
-
maxRetries: number = DEFAULT_MAX_RETRIES
|
|
15
|
-
): Promise<Response> {
|
|
16
|
-
let response: Response = await requestFn();
|
|
17
|
-
|
|
18
|
-
for (let i = 0; i < maxRetries; ++i) {
|
|
19
|
-
if ([408, 409, 429].includes(response.status) || response.status >= 500) {
|
|
20
|
-
// Calculate base delay using exponential backoff (in milliseconds)
|
|
21
|
-
const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
|
|
22
|
-
|
|
23
|
-
// Add jitter to the delay
|
|
24
|
-
const delayWithJitter = addJitter(baseDelay);
|
|
25
|
-
|
|
26
|
-
await new Promise((resolve) => setTimeout(resolve, delayWithJitter));
|
|
27
|
-
response = await requestFn();
|
|
28
|
-
} else {
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return response!;
|
|
33
|
-
}
|