UNPKG

@sap-ai-sdk/prompt-registry

Version:

SAP Cloud SDK for AI is the official Software Development Kit (SDK) for **SAP AI Core**, **SAP Generative AI Hub**, and **Orchestration Service**.

836 lines 48.5 kB
/** * Generated by orval v7.10.0 🍺 * Do not edit manually. * Prompt Registry API * Prompt Storage service for Design time & Runtime prompt templates. * OpenAPI spec version: 0.0.1. */ import { z as zod } from 'zod'; /** * Create or update a prompt template. */ export const registryControllerPromptControllerCreateUpdatePromptTemplateBodyNameMax = 120; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodyVersionMax = 10; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodyScenarioMax = 120; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerCreateUpdatePromptTemplateBody = zod.object({ name: zod .string() .max(registryControllerPromptControllerCreateUpdatePromptTemplateBodyNameMax), version: zod .string() .max(registryControllerPromptControllerCreateUpdatePromptTemplateBodyVersionMax), scenario: zod .string() .max(registryControllerPromptControllerCreateUpdatePromptTemplateBodyScenarioMax), spec: zod.object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerCreateUpdatePromptTemplateBodySpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) }); export const registryControllerPromptControllerCreateUpdatePromptTemplateResponse = zod.object({ message: zod.string(), id: zod.string().uuid(), scenario: zod.string(), name: zod.string(), version: zod.string() }); /** * List prompt templates. */ export const registryControllerPromptControllerListPromptTemplatesQueryRetrieveDefault = 'both'; export const registryControllerPromptControllerListPromptTemplatesQueryIncludeSpecDefault = false; export const registryControllerPromptControllerListPromptTemplatesQueryParams = zod.object({ scenario: zod.string().optional(), name: zod.string().optional(), version: zod.string().optional(), retrieve: zod .string() .default(registryControllerPromptControllerListPromptTemplatesQueryRetrieveDefault), includeSpec: zod.boolean().optional() }); export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerListPromptTemplatesResponse = zod.object({ count: zod.number(), resources: zod.array(zod.object({ id: zod.string().uuid().optional(), name: zod.string().optional(), version: zod.string().optional(), scenario: zod.string().optional(), creationTimestamp: zod.string().optional(), managedBy: zod.string().optional(), isVersionHead: zod.boolean().optional(), spec: zod .object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerListPromptTemplatesResponseResourcesItemSpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) .optional() })) }); /** * List prompt template history. */ export const registryControllerPromptControllerListPromptTemplateHistoryParams = zod.object({ scenario: zod.string(), version: zod.string(), name: zod.string() }); export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerListPromptTemplateHistoryResponse = zod.object({ count: zod.number(), resources: zod.array(zod.object({ id: zod.string().uuid().optional(), name: zod.string().optional(), version: zod.string().optional(), scenario: zod.string().optional(), creationTimestamp: zod.string().optional(), managedBy: zod.string().optional(), isVersionHead: zod.boolean().optional(), spec: zod .object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerListPromptTemplateHistoryResponseResourcesItemSpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) .optional() })) }); /** * Get prompt template by UUID. */ export const registryControllerPromptControllerGetPromptTemplateByUuidParams = zod.object({ promptTemplateId: zod.string().uuid() }); export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerGetPromptTemplateByUuidResponse = zod.object({ id: zod.string().uuid().optional(), name: zod.string().optional(), version: zod.string().optional(), scenario: zod.string().optional(), creationTimestamp: zod.string().optional(), managedBy: zod.string().optional(), isVersionHead: zod.boolean().optional(), spec: zod .object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerGetPromptTemplateByUuidResponseSpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) .optional() }); /** * Delete prompt template. */ export const registryControllerPromptControllerDeletePromptTemplateParams = zod.object({ promptTemplateId: zod.string().uuid() }); export const registryControllerPromptControllerDeletePromptTemplateResponse = zod.object({ message: zod.string() }); /** * Import prompt template. */ export const registryControllerPromptControllerImportPromptTemplateBody = zod.object({ file: zod.instanceof(File).optional() }); export const registryControllerPromptControllerImportPromptTemplateResponse = zod.object({ message: zod.string(), id: zod.string().uuid(), scenario: zod.string(), name: zod.string(), version: zod.string() }); /** * Export prompt template. */ export const registryControllerPromptControllerExportPromptTemplateParams = zod.object({ promptTemplateId: zod.string().uuid() }); /** * Parse prompt template by ID. */ export const registryControllerPromptControllerParsePromptTemplateByIdParams = zod.object({ promptTemplateId: zod.string().uuid() }); export const registryControllerPromptControllerParsePromptTemplateByIdQueryMetadataDefault = false; export const registryControllerPromptControllerParsePromptTemplateByIdQueryParams = zod.object({ metadata: zod.boolean().optional() }); export const registryControllerPromptControllerParsePromptTemplateByIdBody = zod.object({ inputParams: zod.object({}).optional() }); export const registryControllerPromptControllerParsePromptTemplateByIdResponseParsedPromptItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerParsePromptTemplateByIdResponse = zod.object({ parsedPrompt: zod .array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerParsePromptTemplateByIdResponseParsedPromptItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))) .optional(), resource: zod .object({ id: zod.string().uuid().optional(), name: zod.string().optional(), version: zod.string().optional(), scenario: zod.string().optional(), creationTimestamp: zod.string().optional(), managedBy: zod.string().optional(), isVersionHead: zod.boolean().optional(), spec: zod .object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerParsePromptTemplateByIdResponseResourceSpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) .optional() }) .optional() }); /** * Parse prompt template by name and version. */ export const registryControllerPromptControllerParsePromptTemplateByNameVersionParams = zod.object({ scenario: zod.string(), version: zod.string(), name: zod.string() }); export const registryControllerPromptControllerParsePromptTemplateByNameVersionQueryMetadataDefault = false; export const registryControllerPromptControllerParsePromptTemplateByNameVersionQueryParams = zod.object({ metadata: zod.boolean().optional() }); export const registryControllerPromptControllerParsePromptTemplateByNameVersionBody = zod.object({ inputParams: zod.object({}).optional() }); export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseParsedPromptItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecTemplateItemContentItemImageUrlDetailDefault = 'auto'; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecResponseFormatJsonSchemaNameMax = 64; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecResponseFormatJsonSchemaNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecResponseFormatJsonSchemaStrictDefault = false; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecToolsItemFunctionNameMax = 64; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecToolsItemFunctionNameRegExp = new RegExp('^[a-zA-Z0-9-_]+$'); export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecToolsItemFunctionStrictDefault = false; export const registryControllerPromptControllerParsePromptTemplateByNameVersionResponse = zod.object({ parsedPrompt: zod .array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseParsedPromptItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))) .optional(), resource: zod .object({ id: zod.string().uuid().optional(), name: zod.string().optional(), version: zod.string().optional(), scenario: zod.string().optional(), creationTimestamp: zod.string().optional(), managedBy: zod.string().optional(), isVersionHead: zod.boolean().optional(), spec: zod .object({ template: zod.array(zod .object({ role: zod.string(), content: zod.string() }) .or(zod.object({ role: zod.string(), content: zod.array(zod .object({ type: zod.enum(['image_url']), image_url: zod.object({ url: zod.string(), detail: zod .string() .default(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecTemplateItemContentItemImageUrlDetailDefault) }) }) .or(zod.object({ type: zod.enum(['text']), text: zod.string() }))) }))), defaults: zod.object({}).optional(), additionalFields: zod .object({}) .optional() .describe('DEPRECATED. Please use additional_fields instead.\n'), response_format: zod .object({ type: zod .enum(['text']) .describe('The type of response format being defined: `text`') }) .or(zod.object({ type: zod .enum(['json_object']) .describe('The type of response format being defined: `json_object`') })) .or(zod.object({ type: zod .enum(['json_schema']) .describe('The type of response format being defined: `json_schema`'), json_schema: zod.object({ description: zod .string() .optional() .describe('A description of what the response format is for, used by the model to determine how to respond in the format.'), name: zod .string() .max(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecResponseFormatJsonSchemaNameMax) .regex(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecResponseFormatJsonSchemaNameRegExp) .describe('The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), schema: zod .record(zod.string(), zod.any()) .optional() .describe('The schema for the response format, described as a JSON Schema object.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).') }) })) .optional() .describe('Response format that the model output should adhere to. This is the same as the OpenAI definition.\nCompatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.\n'), tools: zod .array(zod.object({ type: zod .enum(['function']) .describe('The type of the tool. Currently, only `function` is supported.'), function: zod.object({ description: zod .string() .optional() .describe('A description of what the function does, used by the model to choose when and how to call the function.'), name: zod .string() .max(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecToolsItemFunctionNameMax) .regex(registryControllerPromptControllerParsePromptTemplateByNameVersionResponseResourceSpecToolsItemFunctionNameRegExp) .describe('The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.'), parameters: zod .record(zod.string(), zod.any()) .optional() .describe('The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list.'), strict: zod .boolean() .nullish() .describe('Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).') }) })) .optional() .describe('A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.\n') }) .optional() }) .optional() }); //# sourceMappingURL=prompt-registry.zod.js.map