@samchon/openapi
Version:
OpenAPI definitions and converters for 'typia' and 'nestia'.
1 lines • 4.49 kB
Source Map (JSON)
{"version":3,"file":"IDeepSeekSchema.mjs","sources":["../../src/structures/IDeepSeekSchema.ts"],"sourcesContent":["import { ILlmSchemaV3_1 } from \"./ILlmSchemaV3_1\";\n\n/**\n * Type schema info of the DeepSeek.\n *\n * `IDeepSeekSchema` is a type schema info of the DeepSeek function calling.\n *\n * `IDeepSeekSchema` seems fully supporting the JSON schema definition of the OpenAPI v3.1\n * specification; {@link OpenApiV3_1.IJsonSchema}. By the way, as the\n * {@link OpenApiV3_1.IJsonSchema} has too much ambiguous and duplicated expressions,\n * `IDeepSeekSchema` is designed to be clear and simple for the DeepSeek function calling,\n * by utilizing {@link ILlmSchemaV3_1} which has been transformed from the\n * {@link OpenApi.IJsonSchema} for the convenience and clarity.\n *\n * Therefore, `IDeepSeekSchema` does not follow the entire specification of\n * the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the\n * list of how `ILlmSchemaV3_1` is different with the OpenAPI v3.1 JSON schema.\n *\n * - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}\n * - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}\n * - Tuple type is banned: {@link OpenApiV3_1.IJsonSchema.ITuple.prefixItems}\n * - Constant type is banned: {@link OpenApiV3_1.IJsonSchema.IConstant}\n * - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link IDeepSeekSchema.IOneOf}\n * - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link IDeepSeekSchema.IObject}\n * - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link IDeepSeekSchema.IReference}\n * - Do not support {@link OpenApiV3_1.IJsonSchema.ITuple} type\n *\n * If compare with the {@link OpenApi.IJsonSchema}, the emended JSON schema specification,\n *\n * - {@link IDeepSeekSchema.IParameters.$defs} instead of the {@link OpenApi.IJsonSchema.schemas}\n * - Do not support {@link OpenApi.IJsonSchema.ITuple} type\n * - {@link IDeepSeekSchema.properties} and {@link IDeepSeekSchema.required} are always defined\n *\n * For reference, if you've composed the `IDeepSeekSchema` type with the\n * {@link IDeepSeekSchema.IConfig.reference} `false` option (default is `false`), only the\n * recursive named types would be archived into the {@link IDeepSeekSchema.IParameters.$defs},\n * and the others would be escaped from the {@link IDeepSeekSchema.IReference} type.\n *\n * @author Jeongho Nam - https://github.com/samchon\n */\nexport type IDeepSeekSchema =\n | IDeepSeekSchema.IConstant\n | IDeepSeekSchema.IBoolean\n | IDeepSeekSchema.IInteger\n | IDeepSeekSchema.INumber\n | IDeepSeekSchema.IString\n | IDeepSeekSchema.IArray\n | IDeepSeekSchema.IObject\n | IDeepSeekSchema.IReference\n | IDeepSeekSchema.IOneOf\n | IDeepSeekSchema.INull\n | IDeepSeekSchema.IUnknown;\nexport namespace IDeepSeekSchema {\n /**\n * Configuration for DeepSeek schema composition.\n */\n export interface IConfig {\n /**\n * Whether to allow reference type in everywhere.\n *\n * If you configure this property to `false`, most of reference types\n * represented by {@link IDeepSeekSchema.IReference} would be escaped to\n * a plain type unless recursive type case.\n *\n * This is because some low sized LLM models does not understand the\n * reference type well, and even the large size LLM models sometimes occur\n * the hallucination.\n *\n * However, the reference type makes the schema size smaller, so that reduces\n * the LLM token cost. Therefore, if you're using the large size of LLM model,\n * and want to reduce the LLM token cost, you can configure this property to\n * `true`.\n *\n * @default false\n */\n reference: boolean;\n }\n\n export import IParameters = ILlmSchemaV3_1.IParameters;\n\n export import IConstant = ILlmSchemaV3_1.IConstant;\n export import IBoolean = ILlmSchemaV3_1.IBoolean;\n export import IInteger = ILlmSchemaV3_1.IInteger;\n export import INumber = ILlmSchemaV3_1.INumber;\n export import IString = ILlmSchemaV3_1.IString;\n\n export import IObject = ILlmSchemaV3_1.IObject;\n export import IArray = ILlmSchemaV3_1.IArray;\n export import IReference = ILlmSchemaV3_1.IReference;\n export import IOneOf = ILlmSchemaV3_1.IOneOf;\n export import INull = ILlmSchemaV3_1.INull;\n export import IUnknown = ILlmSchemaV3_1.IUnknown;\n}\n"],"names":["IDeepSeekSchema"],"mappings":"AAoDM,IAAWA;;CAAjB,SAAiBA,kBAwChB,EAxCD,CAAiBA,oBAAAA,kBAwChB,CAAA;;"}