From c95e11a863d092a9f5b12a484ace481c2b5fdef1 Mon Sep 17 00:00:00 2001 From: Borys Tkachenko Date: Wed, 18 Dec 2024 12:44:26 +0100 Subject: [PATCH] OPIK-627 Delete LLM Provider Api key endpoint documentation and SDK code --- .../comet/opik/api/ProviderApiKeyUpdate.java | 3 +- .../v1/priv/LlmProviderApiKeyResource.java | 7 +- .../priv/LlmProviderApiKeyResourceTest.java | 6 +- .../documentation/rest_api/opik.yaml | 39 +++++++ .../code_generation/fern/openapi/openapi.yaml | 39 +++++++ .../opik/rest_api/llm_provider_key/client.py | 104 +++++++++++++++++- sdks/python/src/opik/rest_api/types/span.py | 4 + .../src/opik/rest_api/types/span_public.py | 6 +- sdks/python/src/opik/rest_api/types/trace.py | 4 + .../src/opik/rest_api/types/trace_public.py | 6 +- .../llmProviderKey/client/Client.d.ts | 12 ++ .../resources/llmProviderKey/client/Client.js | 55 ++++++++- .../src/opik/rest_api/api/types/Span.d.ts | 2 + .../opik/rest_api/api/types/SpanPublic.d.ts | 2 + .../src/opik/rest_api/api/types/Trace.d.ts | 2 + .../opik/rest_api/api/types/TracePublic.d.ts | 2 + .../rest_api/serialization/types/Span.d.ts | 1 + .../opik/rest_api/serialization/types/Span.js | 1 + .../serialization/types/SpanPublic.d.ts | 1 + .../serialization/types/SpanPublic.js | 1 + .../rest_api/serialization/types/Trace.d.ts | 1 + .../rest_api/serialization/types/Trace.js | 1 + .../serialization/types/TracePublic.d.ts | 1 + .../serialization/types/TracePublic.js | 1 + 24 files changed, 289 insertions(+), 12 deletions(-) diff --git a/apps/opik-backend/src/main/java/com/comet/opik/api/ProviderApiKeyUpdate.java b/apps/opik-backend/src/main/java/com/comet/opik/api/ProviderApiKeyUpdate.java index 7ab82ed52b..518d23a8dd 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/api/ProviderApiKeyUpdate.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/api/ProviderApiKeyUpdate.java @@ -12,8 +12,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public record ProviderApiKeyUpdate( - @NotBlank @JsonDeserialize(using = ProviderApiKeyDeserializer.class) String apiKey -){ + @NotBlank @JsonDeserialize(using = ProviderApiKeyDeserializer.class) String apiKey) { @Override public String toString() { diff --git a/apps/opik-backend/src/main/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResource.java b/apps/opik-backend/src/main/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResource.java index f58d511a6a..eba7ef04d9 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResource.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResource.java @@ -22,7 +22,6 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.DELETE; import jakarta.ws.rs.GET; import jakarta.ws.rs.PATCH; import jakarta.ws.rs.POST; @@ -135,9 +134,11 @@ public Response updateApiKey(@PathParam("id") UUID id, public Response deleteApiKeys( @NotNull @RequestBody(content = @Content(schema = @Schema(implementation = BatchDelete.class))) @Valid BatchDelete batchDelete) { String workspaceId = requestContext.get().getWorkspaceId(); - log.info("Deleting api keys for LLM provider by ids, count '{}', on workspace_id '{}'", batchDelete.ids().size(), workspaceId); + log.info("Deleting api keys for LLM provider by ids, count '{}', on workspace_id '{}'", + batchDelete.ids().size(), workspaceId); llmProviderApiKeyService.delete(batchDelete.ids(), workspaceId); - log.info("Deleted api keys for LLM provider by ids, count '{}', on workspace_id '{}'", batchDelete.ids().size(), workspaceId); + log.info("Deleted api keys for LLM provider by ids, count '{}', on workspace_id '{}'", batchDelete.ids().size(), + workspaceId); return Response.noContent().build(); } } diff --git a/apps/opik-backend/src/test/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResourceTest.java b/apps/opik-backend/src/test/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResourceTest.java index 834c7ffb39..db4b1bfd1e 100644 --- a/apps/opik-backend/src/test/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResourceTest.java +++ b/apps/opik-backend/src/test/java/com/comet/opik/api/resources/v1/priv/LlmProviderApiKeyResourceTest.java @@ -139,10 +139,12 @@ void createAndBatchDeleteProviderApiKeys() { workspaceName, 201); // Delete - llmProviderApiKeyResourceClient.batchDeleteProviderApiKey(Set.of(createdProviderApiKey.id()), apiKey, workspaceName); + llmProviderApiKeyResourceClient.batchDeleteProviderApiKey(Set.of(createdProviderApiKey.id()), apiKey, + workspaceName); // Delete one more time for non existing key, should return same 204 response - llmProviderApiKeyResourceClient.batchDeleteProviderApiKey(Set.of(createdProviderApiKey.id()), apiKey, workspaceName); + llmProviderApiKeyResourceClient.batchDeleteProviderApiKey(Set.of(createdProviderApiKey.id()), apiKey, + workspaceName); // Check that it was deleted llmProviderApiKeyResourceClient.getById(createdProviderApiKey.id(), workspaceName, apiKey, 404); diff --git a/apps/opik-documentation/documentation/rest_api/opik.yaml b/apps/opik-documentation/documentation/rest_api/opik.yaml index 131767c870..392c91254c 100644 --- a/apps/opik-documentation/documentation/rest_api/opik.yaml +++ b/apps/opik-documentation/documentation/rest_api/opik.yaml @@ -902,6 +902,21 @@ paths: responses: "204": description: No Content + /v1/private/llm-provider-key/delete: + post: + tags: + - LlmProviderKey + summary: Delete LLM Provider's ApiKeys + description: Delete LLM Provider's ApiKeys batch + operationId: deleteLlmProviderApiKeysBatch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDelete' + responses: + "204": + description: No Content /v1/private/llm-provider-key: get: tags: @@ -4422,6 +4437,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true ErrorInfo_Write: required: - exception_type @@ -4650,6 +4671,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true SpanPage_Public: type: object properties: @@ -4880,6 +4907,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true Trace_Write: required: - name @@ -4999,6 +5032,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true TracePage_Public: type: object properties: diff --git a/sdks/code_generation/fern/openapi/openapi.yaml b/sdks/code_generation/fern/openapi/openapi.yaml index 131767c870..392c91254c 100644 --- a/sdks/code_generation/fern/openapi/openapi.yaml +++ b/sdks/code_generation/fern/openapi/openapi.yaml @@ -902,6 +902,21 @@ paths: responses: "204": description: No Content + /v1/private/llm-provider-key/delete: + post: + tags: + - LlmProviderKey + summary: Delete LLM Provider's ApiKeys + description: Delete LLM Provider's ApiKeys batch + operationId: deleteLlmProviderApiKeysBatch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDelete' + responses: + "204": + description: No Content /v1/private/llm-provider-key: get: tags: @@ -4422,6 +4437,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true ErrorInfo_Write: required: - exception_type @@ -4650,6 +4671,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true SpanPage_Public: type: object properties: @@ -4880,6 +4907,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true Trace_Write: required: - name @@ -4999,6 +5032,12 @@ components: total_estimated_cost: type: number readOnly: true + duration: + type: number + description: Duration in milliseconds as a decimal number to support sub-millisecond + precision + format: double + readOnly: true TracePage_Public: type: object properties: diff --git a/sdks/python/src/opik/rest_api/llm_provider_key/client.py b/sdks/python/src/opik/rest_api/llm_provider_key/client.py index 5f13c2ed45..d419af182a 100644 --- a/sdks/python/src/opik/rest_api/llm_provider_key/client.py +++ b/sdks/python/src/opik/rest_api/llm_provider_key/client.py @@ -3,10 +3,10 @@ import typing from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.project_page_public import ProjectPagePublic -from ..core.pydantic_utilities import parse_obj_as from json.decoder import JSONDecodeError from ..core.api_error import ApiError +from ..types.project_page_public import ProjectPagePublic +from ..core.pydantic_utilities import parse_obj_as from ..errors.unauthorized_error import UnauthorizedError from ..types.error_message import ErrorMessage from ..errors.forbidden_error import ForbiddenError @@ -23,6 +23,52 @@ class LlmProviderKeyClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def delete_llm_provider_api_keys_batch( + self, + *, + ids: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Delete LLM Provider's ApiKeys batch + + Parameters + ---------- + ids : typing.Sequence[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from Opik import OpikApi + + client = OpikApi() + client.llm_provider_key.delete_llm_provider_api_keys_batch( + ids=["ids"], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "v1/private/llm-provider-key/delete", + method="POST", + json={ + "ids": ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def find_llm_provider_keys( self, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectPagePublic: @@ -276,6 +322,60 @@ class AsyncLlmProviderKeyClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def delete_llm_provider_api_keys_batch( + self, + *, + ids: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Delete LLM Provider's ApiKeys batch + + Parameters + ---------- + ids : typing.Sequence[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from Opik import AsyncOpikApi + + client = AsyncOpikApi() + + + async def main() -> None: + await client.llm_provider_key.delete_llm_provider_api_keys_batch( + ids=["ids"], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/private/llm-provider-key/delete", + method="POST", + json={ + "ids": ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + async def find_llm_provider_keys( self, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectPagePublic: diff --git a/sdks/python/src/opik/rest_api/types/span.py b/sdks/python/src/opik/rest_api/types/span.py index 325cfd87cd..d0b5b8d16b 100644 --- a/sdks/python/src/opik/rest_api/types/span.py +++ b/sdks/python/src/opik/rest_api/types/span.py @@ -39,6 +39,10 @@ class Span(UniversalBaseModel): last_updated_by: typing.Optional[str] = None feedback_scores: typing.Optional[typing.List[FeedbackScore]] = None total_estimated_cost: typing.Optional[float] = None + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + Duration in milliseconds as a decimal number to support sub-millisecond precision + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/sdks/python/src/opik/rest_api/types/span_public.py b/sdks/python/src/opik/rest_api/types/span_public.py index 38a194098c..d8b7f7247f 100644 --- a/sdks/python/src/opik/rest_api/types/span_public.py +++ b/sdks/python/src/opik/rest_api/types/span_public.py @@ -7,8 +7,8 @@ from .json_node_public import JsonNodePublic from .error_info_public import ErrorInfoPublic from .feedback_score_public import FeedbackScorePublic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SpanPublic(UniversalBaseModel): @@ -34,6 +34,10 @@ class SpanPublic(UniversalBaseModel): last_updated_by: typing.Optional[str] = None feedback_scores: typing.Optional[typing.List[FeedbackScorePublic]] = None total_estimated_cost: typing.Optional[float] = None + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + Duration in milliseconds as a decimal number to support sub-millisecond precision + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/sdks/python/src/opik/rest_api/types/trace.py b/sdks/python/src/opik/rest_api/types/trace.py index 84e46c19a2..74263d5eec 100644 --- a/sdks/python/src/opik/rest_api/types/trace.py +++ b/sdks/python/src/opik/rest_api/types/trace.py @@ -33,6 +33,10 @@ class Trace(UniversalBaseModel): last_updated_by: typing.Optional[str] = None feedback_scores: typing.Optional[typing.List[FeedbackScore]] = None total_estimated_cost: typing.Optional[float] = None + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + Duration in milliseconds as a decimal number to support sub-millisecond precision + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/sdks/python/src/opik/rest_api/types/trace_public.py b/sdks/python/src/opik/rest_api/types/trace_public.py index 036f04354b..ee83d6bb76 100644 --- a/sdks/python/src/opik/rest_api/types/trace_public.py +++ b/sdks/python/src/opik/rest_api/types/trace_public.py @@ -6,8 +6,8 @@ from .json_node_public import JsonNodePublic from .error_info_public import ErrorInfoPublic from .feedback_score_public import FeedbackScorePublic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TracePublic(UniversalBaseModel): @@ -28,6 +28,10 @@ class TracePublic(UniversalBaseModel): last_updated_by: typing.Optional[str] = None feedback_scores: typing.Optional[typing.List[FeedbackScorePublic]] = None total_estimated_cost: typing.Optional[float] = None + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + Duration in milliseconds as a decimal number to support sub-millisecond precision + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.d.ts b/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.d.ts index 6b6310b741..f6b10b7734 100644 --- a/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.d.ts @@ -25,6 +25,18 @@ export declare namespace LlmProviderKey { export declare class LlmProviderKey { protected readonly _options: LlmProviderKey.Options; constructor(_options?: LlmProviderKey.Options); + /** + * Delete LLM Provider's ApiKeys batch + * + * @param {OpikApi.BatchDelete} request + * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.llmProviderKey.deleteLlmProviderApiKeysBatch({ + * ids: ["ids"] + * }) + */ + deleteLlmProviderApiKeysBatch(request: OpikApi.BatchDelete, requestOptions?: LlmProviderKey.RequestOptions): core.APIPromise; /** * Find LLM Provider's ApiKeys * diff --git a/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.js b/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.js index f25e782c89..3370ffbdb2 100644 --- a/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.js +++ b/sdks/typescript/src/opik/rest_api/api/resources/llmProviderKey/client/Client.js @@ -42,8 +42,8 @@ exports.LlmProviderKey = void 0; const environments = __importStar(require("../../../../environments")); const core = __importStar(require("../../../../core")); const OpikApi = __importStar(require("../../../index")); -const url_join_1 = __importDefault(require("url-join")); const serializers = __importStar(require("../../../../serialization/index")); +const url_join_1 = __importDefault(require("url-join")); const errors = __importStar(require("../../../../errors/index")); /** * LLM Provider Key @@ -52,6 +52,59 @@ class LlmProviderKey { constructor(_options = {}) { this._options = _options; } + /** + * Delete LLM Provider's ApiKeys batch + * + * @param {OpikApi.BatchDelete} request + * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.llmProviderKey.deleteLlmProviderApiKeysBatch({ + * ids: ["ids"] + * }) + */ + deleteLlmProviderApiKeysBatch(request, requestOptions) { + return core.APIPromise.from((() => __awaiter(this, void 0, void 0, function* () { + var _a; + const _response = yield core.fetcher({ + url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.OpikApiEnvironment.Default, "v1/private/llm-provider-key/delete"), + method: "POST", + headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers), + contentType: "application/json", + requestType: "json", + body: serializers.BatchDelete.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal, + }); + if (_response.ok) { + return { + ok: _response.ok, + body: undefined, + headers: _response.headers, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.OpikApiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + switch (_response.error.reason) { + case "non-json": + throw new errors.OpikApiError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.OpikApiTimeoutError("Timeout exceeded when calling POST /v1/private/llm-provider-key/delete."); + case "unknown": + throw new errors.OpikApiError({ + message: _response.error.errorMessage, + }); + } + }))()); + } /** * Find LLM Provider's ApiKeys * diff --git a/sdks/typescript/src/opik/rest_api/api/types/Span.d.ts b/sdks/typescript/src/opik/rest_api/api/types/Span.d.ts index d84168116a..3cde1d4b47 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/Span.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/Span.d.ts @@ -27,4 +27,6 @@ export interface Span { lastUpdatedBy?: string; feedbackScores?: OpikApi.FeedbackScore[]; totalEstimatedCost?: number; + /** Duration in milliseconds as a decimal number to support sub-millisecond precision */ + duration?: number; } diff --git a/sdks/typescript/src/opik/rest_api/api/types/SpanPublic.d.ts b/sdks/typescript/src/opik/rest_api/api/types/SpanPublic.d.ts index 1d1e123de8..93d3318a71 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/SpanPublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/SpanPublic.d.ts @@ -25,4 +25,6 @@ export interface SpanPublic { lastUpdatedBy?: string; feedbackScores?: OpikApi.FeedbackScorePublic[]; totalEstimatedCost?: number; + /** Duration in milliseconds as a decimal number to support sub-millisecond precision */ + duration?: number; } diff --git a/sdks/typescript/src/opik/rest_api/api/types/Trace.d.ts b/sdks/typescript/src/opik/rest_api/api/types/Trace.d.ts index 89ad5db27f..af2d9daee0 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/Trace.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/Trace.d.ts @@ -22,4 +22,6 @@ export interface Trace { lastUpdatedBy?: string; feedbackScores?: OpikApi.FeedbackScore[]; totalEstimatedCost?: number; + /** Duration in milliseconds as a decimal number to support sub-millisecond precision */ + duration?: number; } diff --git a/sdks/typescript/src/opik/rest_api/api/types/TracePublic.d.ts b/sdks/typescript/src/opik/rest_api/api/types/TracePublic.d.ts index a5cc3257ef..b9a87737e8 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/TracePublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/TracePublic.d.ts @@ -20,4 +20,6 @@ export interface TracePublic { lastUpdatedBy?: string; feedbackScores?: OpikApi.FeedbackScorePublic[]; totalEstimatedCost?: number; + /** Duration in milliseconds as a decimal number to support sub-millisecond precision */ + duration?: number; } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Span.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/Span.d.ts index 89852768b0..ff142ec4d8 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Span.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Span.d.ts @@ -34,5 +34,6 @@ export declare namespace Span { last_updated_by?: string | null; feedback_scores?: FeedbackScore.Raw[] | null; total_estimated_cost?: number | null; + duration?: number | null; } } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Span.js b/sdks/typescript/src/opik/rest_api/serialization/types/Span.js index e3e38a5b06..884d816dbc 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Span.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Span.js @@ -56,4 +56,5 @@ exports.Span = core.serialization.object({ lastUpdatedBy: core.serialization.property("last_updated_by", core.serialization.string().optional()), feedbackScores: core.serialization.property("feedback_scores", core.serialization.list(FeedbackScore_1.FeedbackScore).optional()), totalEstimatedCost: core.serialization.property("total_estimated_cost", core.serialization.number().optional()), + duration: core.serialization.number().optional(), }); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.d.ts index 21f5956643..e9f0a0193f 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.d.ts @@ -33,5 +33,6 @@ export declare namespace SpanPublic { last_updated_by?: string | null; feedback_scores?: FeedbackScorePublic.Raw[] | null; total_estimated_cost?: number | null; + duration?: number | null; } } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.js b/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.js index 6ce3b43f6e..a8c1738908 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.js @@ -55,4 +55,5 @@ exports.SpanPublic = core.serialization.object({ lastUpdatedBy: core.serialization.property("last_updated_by", core.serialization.string().optional()), feedbackScores: core.serialization.property("feedback_scores", core.serialization.list(FeedbackScorePublic_1.FeedbackScorePublic).optional()), totalEstimatedCost: core.serialization.property("total_estimated_cost", core.serialization.number().optional()), + duration: core.serialization.number().optional(), }); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Trace.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/Trace.d.ts index 49c683b50a..110b33392b 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Trace.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Trace.d.ts @@ -28,5 +28,6 @@ export declare namespace Trace { last_updated_by?: string | null; feedback_scores?: FeedbackScore.Raw[] | null; total_estimated_cost?: number | null; + duration?: number | null; } } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Trace.js b/sdks/typescript/src/opik/rest_api/serialization/types/Trace.js index 81d48f7f40..54dc4a045d 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Trace.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Trace.js @@ -50,4 +50,5 @@ exports.Trace = core.serialization.object({ lastUpdatedBy: core.serialization.property("last_updated_by", core.serialization.string().optional()), feedbackScores: core.serialization.property("feedback_scores", core.serialization.list(FeedbackScore_1.FeedbackScore).optional()), totalEstimatedCost: core.serialization.property("total_estimated_cost", core.serialization.number().optional()), + duration: core.serialization.number().optional(), }); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.d.ts index 7b0431d9de..b33445f275 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.d.ts @@ -27,5 +27,6 @@ export declare namespace TracePublic { last_updated_by?: string | null; feedback_scores?: FeedbackScorePublic.Raw[] | null; total_estimated_cost?: number | null; + duration?: number | null; } } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.js b/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.js index 10a56214a1..c2ce2bccfc 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/TracePublic.js @@ -49,4 +49,5 @@ exports.TracePublic = core.serialization.object({ lastUpdatedBy: core.serialization.property("last_updated_by", core.serialization.string().optional()), feedbackScores: core.serialization.property("feedback_scores", core.serialization.list(FeedbackScorePublic_1.FeedbackScorePublic).optional()), totalEstimatedCost: core.serialization.property("total_estimated_cost", core.serialization.number().optional()), + duration: core.serialization.number().optional(), });