@langchain/core
Version:
Core LangChain.js abstractions and schemas
1 lines • 2.27 kB
Source Map (JSON)
{"version":3,"file":"serde.d.ts","names":["MessageContent","TemplateFormat","SerializedPromptTemplate","SerializedFewShotTemplate","SerializedBasePromptTemplate"],"sources":["../../src/prompts/serde.d.ts"],"sourcesContent":["import { MessageContent } from \"../messages/index.js\";\nimport type { TemplateFormat } from \"./template.js\";\n/**\n * Represents a serialized version of a prompt template. This type is used\n * to create dynamic prompts for language models. It contains an optional\n * `_type` field which, if present, is set to 'prompt'. It also includes\n * `input_variables`, an array of strings representing the variables to be\n * used in the prompt, an optional `template_format` specifying the format\n * of the template, and an optional `template` which is the actual\n * template string.\n */\nexport type SerializedPromptTemplate = {\n _type?: \"prompt\";\n input_variables: string[];\n template_format?: TemplateFormat;\n template?: MessageContent;\n};\n/**\n * Represents a serialized version of a few-shot template. This type\n * includes an `_type` field set to 'few_shot', `input_variables` which\n * are an array of strings representing the variables to be used in the\n * template, `examples` which can be a string or an array of Example\n * objects, an optional `example_prompt` which is a\n * SerializedPromptTemplate, `example_separator` which is a string,\n * optional `prefix` and `suffix` strings, and `template_format` which\n * specifies the format of the template.\n */\nexport type SerializedFewShotTemplate = {\n _type: \"few_shot\";\n input_variables: string[];\n examples: string | any[];\n example_prompt?: SerializedPromptTemplate;\n example_separator: string;\n prefix?: string;\n suffix?: string;\n template_format: TemplateFormat;\n};\n/**\n * Represents a serialized version of a base prompt template. This type\n * can be either a SerializedFewShotTemplate or a\n * SerializedPromptTemplate.\n */\nexport type SerializedBasePromptTemplate = SerializedFewShotTemplate | SerializedPromptTemplate;\n//# sourceMappingURL=serde.d.ts.map"],"mappings":";;;;;;;;;AAWA;AAgBA;AAeA;;;;KA/BYE,wBAAAA;;;oBAGUD;aACPD;;;;;;;;;;;;KAYHG,yBAAAA;;;;mBAISD;;;;mBAIAD;;;;;;;KAOTG,4BAAAA,GAA+BD,4BAA4BD"}