diff --git a/apps/opik-backend/src/main/java/com/comet/opik/api/PromptVersion.java b/apps/opik-backend/src/main/java/com/comet/opik/api/PromptVersion.java index 6618cc6dda..0a8a47ae34 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/api/PromptVersion.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/api/PromptVersion.java @@ -34,9 +34,9 @@ public record PromptVersion( @JsonView({PromptVersion.View.Public.class, Prompt.View.Detail.class, PromptVersion.View.Detail.class}) @NotBlank String template, @Json @JsonView({PromptVersion.View.Public.class, Prompt.View.Detail.class, - PromptVersion.View.Detail.class}) @Nullable JsonNode metadata, + PromptVersion.View.Detail.class}) JsonNode metadata, @JsonView({PromptVersion.View.Public.class, Prompt.View.Detail.class, - PromptVersion.View.Detail.class}) @Nullable String changeDescription, + PromptVersion.View.Detail.class}) String changeDescription, @JsonView({Prompt.View.Detail.class, PromptVersion.View.Detail.class}) @Schema(accessMode = Schema.AccessMode.READ_ONLY) @Nullable Set variables, @JsonView({Prompt.View.Detail.class, diff --git a/apps/opik-backend/src/main/java/com/comet/opik/domain/PromptService.java b/apps/opik-backend/src/main/java/com/comet/opik/domain/PromptService.java index 95fdbe1937..bc6accd75c 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/domain/PromptService.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/domain/PromptService.java @@ -35,7 +35,7 @@ @ImplementedBy(PromptServiceImpl.class) public interface PromptService { - Prompt create(Prompt prompt); + Prompt create(Prompt promptRequest); PromptPage find(String name, int page, int size); @@ -75,13 +75,13 @@ class PromptServiceImpl implements PromptService { private final @NonNull TransactionTemplate transactionTemplate; @Override - public Prompt create(@NonNull Prompt prompt) { + public Prompt create(@NonNull Prompt promptRequest) { String workspaceId = requestContext.get().getWorkspaceId(); String userName = requestContext.get().getUserName(); - var newPrompt = prompt.toBuilder() - .id(prompt.id() == null ? idGenerator.generateId() : prompt.id()) + var newPrompt = promptRequest.toBuilder() + .id(promptRequest.id() == null ? idGenerator.generateId() : promptRequest.id()) .createdBy(userName) .lastUpdatedBy(userName) .build(); @@ -94,9 +94,9 @@ public Prompt create(@NonNull Prompt prompt) { createdPrompt.name(), workspaceId); - if (!StringUtils.isEmpty(prompt.template())) { + if (!StringUtils.isEmpty(promptRequest.template())) { EntityConstraintHandler - .handle(() -> createPromptVersionFromPromptRequest(createdPrompt, workspaceId, prompt)) + .handle(() -> createPromptVersionFromPromptRequest(createdPrompt, workspaceId, promptRequest)) .withRetry(3, this::newVersionConflict); } @@ -104,8 +104,8 @@ public Prompt create(@NonNull Prompt prompt) { } private PromptVersion createPromptVersionFromPromptRequest(Prompt createdPrompt, - String workspaceId, - Prompt promptPayload) { + String workspaceId, + Prompt promptRequest) { log.info("Creating prompt version for prompt id '{}'", createdPrompt.id()); var createdVersion = transactionTemplate.inTransaction(WRITE, handle -> { @@ -116,9 +116,9 @@ private PromptVersion createPromptVersionFromPromptRequest(Prompt createdPrompt, .id(versionId) .promptId(createdPrompt.id()) .commit(CommitUtils.getCommit(versionId)) - .template(promptPayload.template()) - .metadata(promptPayload.metadata()) - .changeDescription(promptPayload.changeDescription()) + .template(promptRequest.template()) + .metadata(promptRequest.metadata()) + .changeDescription(promptRequest.changeDescription()) .createdBy(createdPrompt.createdBy()) .build(); diff --git a/apps/opik-documentation/documentation/rest_api/opik.yaml b/apps/opik-documentation/documentation/rest_api/opik.yaml index 392c91254c..dc28affd35 100644 --- a/apps/opik-documentation/documentation/rest_api/opik.yaml +++ b/apps/opik-documentation/documentation/rest_api/opik.yaml @@ -4075,6 +4075,10 @@ components: template: pattern: (?s)^\s*(\S.*\S|\S)\s*$ type: string + metadata: + $ref: '#/components/schemas/JsonNode' + change_description: + type: string created_at: type: string format: date-time @@ -4115,6 +4119,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode' + change_description: + type: string variables: uniqueItems: true type: array @@ -4146,6 +4154,12 @@ components: template: pattern: (?s)^\s*(\S.*\S|\S)\s*$ type: string + metadata: + $ref: '#/components/schemas/JsonNode_Write' + change_description: + type: string + JsonNode_Detail: + type: object PromptVersion_Detail: required: - template @@ -4166,6 +4180,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode_Detail' + change_description: + type: string variables: uniqueItems: true type: array @@ -4269,6 +4287,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode_Public' + change_description: + type: string created_at: type: string format: date-time diff --git a/sdks/code_generation/fern/openapi/openapi.yaml b/sdks/code_generation/fern/openapi/openapi.yaml index 392c91254c..dc28affd35 100644 --- a/sdks/code_generation/fern/openapi/openapi.yaml +++ b/sdks/code_generation/fern/openapi/openapi.yaml @@ -4075,6 +4075,10 @@ components: template: pattern: (?s)^\s*(\S.*\S|\S)\s*$ type: string + metadata: + $ref: '#/components/schemas/JsonNode' + change_description: + type: string created_at: type: string format: date-time @@ -4115,6 +4119,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode' + change_description: + type: string variables: uniqueItems: true type: array @@ -4146,6 +4154,12 @@ components: template: pattern: (?s)^\s*(\S.*\S|\S)\s*$ type: string + metadata: + $ref: '#/components/schemas/JsonNode_Write' + change_description: + type: string + JsonNode_Detail: + type: object PromptVersion_Detail: required: - template @@ -4166,6 +4180,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode_Detail' + change_description: + type: string variables: uniqueItems: true type: array @@ -4269,6 +4287,10 @@ components: \ be 8 characters long" template: type: string + metadata: + $ref: '#/components/schemas/JsonNode_Public' + change_description: + type: string created_at: type: string format: date-time diff --git a/sdks/python/src/opik/rest_api/__init__.py b/sdks/python/src/opik/rest_api/__init__.py index 0d8a72f46e..304654ea6b 100644 --- a/sdks/python/src/opik/rest_api/__init__.py +++ b/sdks/python/src/opik/rest_api/__init__.py @@ -89,6 +89,7 @@ FunctionCall, JsonNode, JsonNodeCompare, + JsonNodeDetail, JsonNodePublic, JsonNodeWrite, JsonObjectSchema, @@ -285,6 +286,7 @@ "GetSpansByProjectRequestType", "JsonNode", "JsonNodeCompare", + "JsonNodeDetail", "JsonNodePublic", "JsonNodeWrite", "JsonObjectSchema", diff --git a/sdks/python/src/opik/rest_api/prompts/client.py b/sdks/python/src/opik/rest_api/prompts/client.py index 3cb96d482f..5447405de6 100644 --- a/sdks/python/src/opik/rest_api/prompts/client.py +++ b/sdks/python/src/opik/rest_api/prompts/client.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import parse_obj_as from json.decoder import JSONDecodeError from ..core.api_error import ApiError +from ..types.json_node_write import JsonNodeWrite from ..errors.bad_request_error import BadRequestError from ..errors.conflict_error import ConflictError from ..errors.unprocessable_entity_error import UnprocessableEntityError @@ -91,6 +92,8 @@ def create_prompt( id: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, template: typing.Optional[str] = OMIT, + metadata: typing.Optional[JsonNodeWrite] = OMIT, + change_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ @@ -106,6 +109,10 @@ def create_prompt( template : typing.Optional[str] + metadata : typing.Optional[JsonNodeWrite] + + change_description : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -130,6 +137,8 @@ def create_prompt( "name": name, "description": description, "template": template, + "metadata": metadata, + "change_description": change_description, }, headers={ "content-type": "application/json", @@ -794,6 +803,8 @@ async def create_prompt( id: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, template: typing.Optional[str] = OMIT, + metadata: typing.Optional[JsonNodeWrite] = OMIT, + change_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ @@ -809,6 +820,10 @@ async def create_prompt( template : typing.Optional[str] + metadata : typing.Optional[JsonNodeWrite] + + change_description : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -841,6 +856,8 @@ async def main() -> None: "name": name, "description": description, "template": template, + "metadata": metadata, + "change_description": change_description, }, headers={ "content-type": "application/json", diff --git a/sdks/python/src/opik/rest_api/types/__init__.py b/sdks/python/src/opik/rest_api/types/__init__.py index a27a9b243c..e7c90634c3 100644 --- a/sdks/python/src/opik/rest_api/types/__init__.py +++ b/sdks/python/src/opik/rest_api/types/__init__.py @@ -94,6 +94,7 @@ from .function_call import FunctionCall from .json_node import JsonNode from .json_node_compare import JsonNodeCompare +from .json_node_detail import JsonNodeDetail from .json_node_public import JsonNodePublic from .json_node_write import JsonNodeWrite from .json_object_schema import JsonObjectSchema @@ -251,6 +252,7 @@ "FunctionCall", "JsonNode", "JsonNodeCompare", + "JsonNodeDetail", "JsonNodePublic", "JsonNodeWrite", "JsonObjectSchema", diff --git a/sdks/python/src/opik/rest_api/types/json_node_detail.py b/sdks/python/src/opik/rest_api/types/json_node_detail.py new file mode 100644 index 0000000000..0321cb1c34 --- /dev/null +++ b/sdks/python/src/opik/rest_api/types/json_node_detail.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +JsonNodeDetail = typing.Dict[str, typing.Optional[typing.Any]] diff --git a/sdks/python/src/opik/rest_api/types/prompt.py b/sdks/python/src/opik/rest_api/types/prompt.py index f8e87146be..36ff77728e 100644 --- a/sdks/python/src/opik/rest_api/types/prompt.py +++ b/sdks/python/src/opik/rest_api/types/prompt.py @@ -2,6 +2,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing +from .json_node import JsonNode import datetime as dt from .prompt_version import PromptVersion from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -13,6 +14,8 @@ class Prompt(UniversalBaseModel): name: str description: typing.Optional[str] = None template: typing.Optional[str] = None + metadata: typing.Optional[JsonNode] = None + change_description: typing.Optional[str] = None created_at: typing.Optional[dt.datetime] = None created_by: typing.Optional[str] = None last_updated_at: typing.Optional[dt.datetime] = None diff --git a/sdks/python/src/opik/rest_api/types/prompt_version.py b/sdks/python/src/opik/rest_api/types/prompt_version.py index d84e1343b7..654f9e079a 100644 --- a/sdks/python/src/opik/rest_api/types/prompt_version.py +++ b/sdks/python/src/opik/rest_api/types/prompt_version.py @@ -3,6 +3,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing import pydantic +from .json_node import JsonNode import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -20,6 +21,8 @@ class PromptVersion(UniversalBaseModel): """ template: str + metadata: typing.Optional[JsonNode] = None + change_description: typing.Optional[str] = None variables: typing.Optional[typing.List[str]] = None created_at: typing.Optional[dt.datetime] = None created_by: typing.Optional[str] = None diff --git a/sdks/python/src/opik/rest_api/types/prompt_version_detail.py b/sdks/python/src/opik/rest_api/types/prompt_version_detail.py index 983645e4fe..d8366fdabc 100644 --- a/sdks/python/src/opik/rest_api/types/prompt_version_detail.py +++ b/sdks/python/src/opik/rest_api/types/prompt_version_detail.py @@ -3,6 +3,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing import pydantic +from .json_node_detail import JsonNodeDetail import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -20,6 +21,8 @@ class PromptVersionDetail(UniversalBaseModel): """ template: str + metadata: typing.Optional[JsonNodeDetail] = None + change_description: typing.Optional[str] = None variables: typing.Optional[typing.List[str]] = None created_at: typing.Optional[dt.datetime] = None created_by: typing.Optional[str] = None diff --git a/sdks/python/src/opik/rest_api/types/prompt_version_public.py b/sdks/python/src/opik/rest_api/types/prompt_version_public.py index eb9ef705a8..1ee3d917f9 100644 --- a/sdks/python/src/opik/rest_api/types/prompt_version_public.py +++ b/sdks/python/src/opik/rest_api/types/prompt_version_public.py @@ -3,6 +3,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing import pydantic +from .json_node_public import JsonNodePublic import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -20,6 +21,8 @@ class PromptVersionPublic(UniversalBaseModel): """ template: str + metadata: typing.Optional[JsonNodePublic] = None + change_description: typing.Optional[str] = None created_at: typing.Optional[dt.datetime] = None created_by: typing.Optional[str] = None diff --git a/sdks/typescript/src/opik/rest_api/api/resources/prompts/client/requests/PromptWrite.d.ts b/sdks/typescript/src/opik/rest_api/api/resources/prompts/client/requests/PromptWrite.d.ts index f0fe2313f7..158105fe55 100644 --- a/sdks/typescript/src/opik/rest_api/api/resources/prompts/client/requests/PromptWrite.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/resources/prompts/client/requests/PromptWrite.d.ts @@ -1,6 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ +import * as OpikApi from "../../../../index"; /** * @example * { @@ -12,4 +13,6 @@ export interface PromptWrite { name: string; description?: string; template?: string; + metadata?: OpikApi.JsonNodeWrite; + changeDescription?: string; } diff --git a/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.d.ts b/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.d.ts new file mode 100644 index 0000000000..f6f52efc65 --- /dev/null +++ b/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.d.ts @@ -0,0 +1,4 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +export declare type JsonNodeDetail = Record; diff --git a/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.js b/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.js new file mode 100644 index 0000000000..33e43da19c --- /dev/null +++ b/sdks/typescript/src/opik/rest_api/api/types/JsonNodeDetail.js @@ -0,0 +1,5 @@ +"use strict"; +/** + * This file was auto-generated by Fern from our API Definition. + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/sdks/typescript/src/opik/rest_api/api/types/Prompt.d.ts b/sdks/typescript/src/opik/rest_api/api/types/Prompt.d.ts index 221ea349af..cd3fea918e 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/Prompt.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/Prompt.d.ts @@ -7,6 +7,8 @@ export interface Prompt { name: string; description?: string; template?: string; + metadata?: OpikApi.JsonNode; + changeDescription?: string; createdAt?: Date; createdBy?: string; lastUpdatedAt?: Date; diff --git a/sdks/typescript/src/opik/rest_api/api/types/PromptVersion.d.ts b/sdks/typescript/src/opik/rest_api/api/types/PromptVersion.d.ts index 7e4a462dc5..30f6ffe3f9 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/PromptVersion.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/PromptVersion.d.ts @@ -1,6 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ +import * as OpikApi from "../index"; export interface PromptVersion { /** version unique identifier, generated if absent */ id?: string; @@ -8,6 +9,8 @@ export interface PromptVersion { /** version short unique identifier, generated if absent. it must be 8 characters long */ commit?: string; template: string; + metadata?: OpikApi.JsonNode; + changeDescription?: string; variables?: string[]; createdAt?: Date; createdBy?: string; diff --git a/sdks/typescript/src/opik/rest_api/api/types/PromptVersionDetail.d.ts b/sdks/typescript/src/opik/rest_api/api/types/PromptVersionDetail.d.ts index 38bf4a906a..eefb47dff7 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/PromptVersionDetail.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/PromptVersionDetail.d.ts @@ -1,6 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ +import * as OpikApi from "../index"; export interface PromptVersionDetail { /** version unique identifier, generated if absent */ id?: string; @@ -8,6 +9,8 @@ export interface PromptVersionDetail { /** version short unique identifier, generated if absent. it must be 8 characters long */ commit?: string; template: string; + metadata?: OpikApi.JsonNodeDetail; + changeDescription?: string; variables?: string[]; createdAt?: Date; createdBy?: string; diff --git a/sdks/typescript/src/opik/rest_api/api/types/PromptVersionPublic.d.ts b/sdks/typescript/src/opik/rest_api/api/types/PromptVersionPublic.d.ts index 4280cae324..af5077a411 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/PromptVersionPublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/PromptVersionPublic.d.ts @@ -1,6 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ +import * as OpikApi from "../index"; export interface PromptVersionPublic { /** version unique identifier, generated if absent */ id?: string; @@ -8,6 +9,8 @@ export interface PromptVersionPublic { /** version short unique identifier, generated if absent. it must be 8 characters long */ commit?: string; template: string; + metadata?: OpikApi.JsonNodePublic; + changeDescription?: string; createdAt?: Date; createdBy?: string; } diff --git a/sdks/typescript/src/opik/rest_api/api/types/index.d.ts b/sdks/typescript/src/opik/rest_api/api/types/index.d.ts index 839c211ab3..f1930bf300 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/index.d.ts +++ b/sdks/typescript/src/opik/rest_api/api/types/index.d.ts @@ -101,6 +101,7 @@ export * from "./ProjectMetricResponsePublic"; export * from "./ResultsNumberPublic"; export * from "./Prompt"; export * from "./PromptVersion"; +export * from "./JsonNodeDetail"; export * from "./PromptVersionDetail"; export * from "./ErrorMessageDetail"; export * from "./PromptDetail"; diff --git a/sdks/typescript/src/opik/rest_api/api/types/index.js b/sdks/typescript/src/opik/rest_api/api/types/index.js index d7b6e4a793..3be33f5726 100644 --- a/sdks/typescript/src/opik/rest_api/api/types/index.js +++ b/sdks/typescript/src/opik/rest_api/api/types/index.js @@ -117,6 +117,7 @@ __exportStar(require("./ProjectMetricResponsePublic"), exports); __exportStar(require("./ResultsNumberPublic"), exports); __exportStar(require("./Prompt"), exports); __exportStar(require("./PromptVersion"), exports); +__exportStar(require("./JsonNodeDetail"), exports); __exportStar(require("./PromptVersionDetail"), exports); __exportStar(require("./ErrorMessageDetail"), exports); __exportStar(require("./PromptDetail"), exports); diff --git a/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.d.ts b/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.d.ts index 528aca6f4c..923f03a1ec 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.d.ts @@ -4,6 +4,7 @@ import * as serializers from "../../../../index"; import * as OpikApi from "../../../../../api/index"; import * as core from "../../../../../core"; +import { JsonNodeWrite } from "../../../../types/JsonNodeWrite"; export declare const PromptWrite: core.serialization.Schema; export declare namespace PromptWrite { interface Raw { @@ -11,5 +12,7 @@ export declare namespace PromptWrite { name: string; description?: string | null; template?: string | null; + metadata?: JsonNodeWrite.Raw | null; + change_description?: string | null; } } diff --git a/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.js b/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.js index 1de8e6a2b5..cb1b5dcf32 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.js +++ b/sdks/typescript/src/opik/rest_api/serialization/resources/prompts/client/requests/PromptWrite.js @@ -28,9 +28,12 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PromptWrite = void 0; const core = __importStar(require("../../../../../core")); +const JsonNodeWrite_1 = require("../../../../types/JsonNodeWrite"); exports.PromptWrite = core.serialization.object({ id: core.serialization.string().optional(), name: core.serialization.string(), description: core.serialization.string().optional(), template: core.serialization.string().optional(), + metadata: JsonNodeWrite_1.JsonNodeWrite.optional(), + changeDescription: core.serialization.property("change_description", core.serialization.string().optional()), }); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.d.ts new file mode 100644 index 0000000000..9d7f548fc3 --- /dev/null +++ b/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.d.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +import * as serializers from "../index"; +import * as OpikApi from "../../api/index"; +import * as core from "../../core"; +export declare const JsonNodeDetail: core.serialization.Schema; +export declare namespace JsonNodeDetail { + type Raw = Record; +} diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.js b/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.js new file mode 100644 index 0000000000..778f00dfd2 --- /dev/null +++ b/sdks/typescript/src/opik/rest_api/serialization/types/JsonNodeDetail.js @@ -0,0 +1,31 @@ +"use strict"; +/** + * This file was auto-generated by Fern from our API Definition. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JsonNodeDetail = void 0; +const core = __importStar(require("../../core")); +exports.JsonNodeDetail = core.serialization.record(core.serialization.string(), core.serialization.unknown()); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.d.ts index 1e9277fbb5..8c7e03e088 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.d.ts @@ -4,6 +4,7 @@ import * as serializers from "../index"; import * as OpikApi from "../../api/index"; import * as core from "../../core"; +import { JsonNode } from "./JsonNode"; import { PromptVersion } from "./PromptVersion"; export declare const Prompt: core.serialization.ObjectSchema; export declare namespace Prompt { @@ -12,6 +13,8 @@ export declare namespace Prompt { name: string; description?: string | null; template?: string | null; + metadata?: JsonNode.Raw | null; + change_description?: string | null; created_at?: string | null; created_by?: string | null; last_updated_at?: string | null; diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.js b/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.js index 5b8e5528d4..e412c548f7 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/Prompt.js @@ -28,12 +28,15 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Prompt = void 0; const core = __importStar(require("../../core")); +const JsonNode_1 = require("./JsonNode"); const PromptVersion_1 = require("./PromptVersion"); exports.Prompt = core.serialization.object({ id: core.serialization.string().optional(), name: core.serialization.string(), description: core.serialization.string().optional(), template: core.serialization.string().optional(), + metadata: JsonNode_1.JsonNode.optional(), + changeDescription: core.serialization.property("change_description", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date().optional()), createdBy: core.serialization.property("created_by", core.serialization.string().optional()), lastUpdatedAt: core.serialization.property("last_updated_at", core.serialization.date().optional()), diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.d.ts index 24b32549e0..8ac751c63d 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.d.ts @@ -4,6 +4,7 @@ import * as serializers from "../index"; import * as OpikApi from "../../api/index"; import * as core from "../../core"; +import { JsonNode } from "./JsonNode"; export declare const PromptVersion: core.serialization.ObjectSchema; export declare namespace PromptVersion { interface Raw { @@ -11,6 +12,8 @@ export declare namespace PromptVersion { prompt_id?: string | null; commit?: string | null; template: string; + metadata?: JsonNode.Raw | null; + change_description?: string | null; variables?: string[] | null; created_at?: string | null; created_by?: string | null; diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.js b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.js index 1cbedef4fe..8df94fe044 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersion.js @@ -28,11 +28,14 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PromptVersion = void 0; const core = __importStar(require("../../core")); +const JsonNode_1 = require("./JsonNode"); exports.PromptVersion = core.serialization.object({ id: core.serialization.string().optional(), promptId: core.serialization.property("prompt_id", core.serialization.string().optional()), commit: core.serialization.string().optional(), template: core.serialization.string(), + metadata: JsonNode_1.JsonNode.optional(), + changeDescription: core.serialization.property("change_description", core.serialization.string().optional()), variables: core.serialization.list(core.serialization.string()).optional(), createdAt: core.serialization.property("created_at", core.serialization.date().optional()), createdBy: core.serialization.property("created_by", core.serialization.string().optional()), diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.d.ts index 419b39312f..2a25e6c285 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.d.ts @@ -4,6 +4,7 @@ import * as serializers from "../index"; import * as OpikApi from "../../api/index"; import * as core from "../../core"; +import { JsonNodeDetail } from "./JsonNodeDetail"; export declare const PromptVersionDetail: core.serialization.ObjectSchema; export declare namespace PromptVersionDetail { interface Raw { @@ -11,6 +12,8 @@ export declare namespace PromptVersionDetail { prompt_id?: string | null; commit?: string | null; template: string; + metadata?: JsonNodeDetail.Raw | null; + change_description?: string | null; variables?: string[] | null; created_at?: string | null; created_by?: string | null; diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.js b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.js index 8eb8bad87a..72a561a399 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionDetail.js @@ -28,11 +28,14 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PromptVersionDetail = void 0; const core = __importStar(require("../../core")); +const JsonNodeDetail_1 = require("./JsonNodeDetail"); exports.PromptVersionDetail = core.serialization.object({ id: core.serialization.string().optional(), promptId: core.serialization.property("prompt_id", core.serialization.string().optional()), commit: core.serialization.string().optional(), template: core.serialization.string(), + metadata: JsonNodeDetail_1.JsonNodeDetail.optional(), + changeDescription: core.serialization.property("change_description", core.serialization.string().optional()), variables: core.serialization.list(core.serialization.string()).optional(), createdAt: core.serialization.property("created_at", core.serialization.date().optional()), createdBy: core.serialization.property("created_by", core.serialization.string().optional()), diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.d.ts index 1873f57d89..46c1ada140 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.d.ts @@ -4,6 +4,7 @@ import * as serializers from "../index"; import * as OpikApi from "../../api/index"; import * as core from "../../core"; +import { JsonNodePublic } from "./JsonNodePublic"; export declare const PromptVersionPublic: core.serialization.ObjectSchema; export declare namespace PromptVersionPublic { interface Raw { @@ -11,6 +12,8 @@ export declare namespace PromptVersionPublic { prompt_id?: string | null; commit?: string | null; template: string; + metadata?: JsonNodePublic.Raw | null; + change_description?: string | null; created_at?: string | null; created_by?: string | null; } diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.js b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.js index 0b40da15ef..cf80fae7ce 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/PromptVersionPublic.js @@ -28,11 +28,14 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PromptVersionPublic = void 0; const core = __importStar(require("../../core")); +const JsonNodePublic_1 = require("./JsonNodePublic"); exports.PromptVersionPublic = core.serialization.object({ id: core.serialization.string().optional(), promptId: core.serialization.property("prompt_id", core.serialization.string().optional()), commit: core.serialization.string().optional(), template: core.serialization.string(), + metadata: JsonNodePublic_1.JsonNodePublic.optional(), + changeDescription: core.serialization.property("change_description", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date().optional()), createdBy: core.serialization.property("created_by", core.serialization.string().optional()), }); diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/index.d.ts b/sdks/typescript/src/opik/rest_api/serialization/types/index.d.ts index 839c211ab3..f1930bf300 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/index.d.ts +++ b/sdks/typescript/src/opik/rest_api/serialization/types/index.d.ts @@ -101,6 +101,7 @@ export * from "./ProjectMetricResponsePublic"; export * from "./ResultsNumberPublic"; export * from "./Prompt"; export * from "./PromptVersion"; +export * from "./JsonNodeDetail"; export * from "./PromptVersionDetail"; export * from "./ErrorMessageDetail"; export * from "./PromptDetail"; diff --git a/sdks/typescript/src/opik/rest_api/serialization/types/index.js b/sdks/typescript/src/opik/rest_api/serialization/types/index.js index d7b6e4a793..3be33f5726 100644 --- a/sdks/typescript/src/opik/rest_api/serialization/types/index.js +++ b/sdks/typescript/src/opik/rest_api/serialization/types/index.js @@ -117,6 +117,7 @@ __exportStar(require("./ProjectMetricResponsePublic"), exports); __exportStar(require("./ResultsNumberPublic"), exports); __exportStar(require("./Prompt"), exports); __exportStar(require("./PromptVersion"), exports); +__exportStar(require("./JsonNodeDetail"), exports); __exportStar(require("./PromptVersionDetail"), exports); __exportStar(require("./ErrorMessageDetail"), exports); __exportStar(require("./PromptDetail"), exports);