UNPKG

@langchain/core

Version:
1 lines 4.58 kB
{"version":3,"file":"image.d.ts","names":["ContentBlock","ImagePromptValue","ImageContent","InputValues","PartialValues","BasePromptTemplate","BasePromptTemplateInput","TypedPromptInputValues","TemplateFormat","ImagePromptTemplateInput","RunInput","PartialVariableName","Record","ImagePromptTemplate","NewPartialVariableName","FormatOutput","Extract","Exclude","Promise"],"sources":["../../src/prompts/image.d.ts"],"sourcesContent":["import { ContentBlock } from \"../messages/index.js\";\nimport { ImagePromptValue, ImageContent } from \"../prompt_values.js\";\nimport type { InputValues, PartialValues } from \"../utils/types/index.js\";\nimport { BasePromptTemplate, BasePromptTemplateInput, TypedPromptInputValues } from \"./base.js\";\nimport { TemplateFormat } from \"./template.js\";\n/**\n * Inputs to create a {@link ImagePromptTemplate}\n * @augments BasePromptTemplateInput\n */\nexport interface ImagePromptTemplateInput<RunInput extends InputValues = any, PartialVariableName extends string = any> extends BasePromptTemplateInput<RunInput, PartialVariableName> {\n /**\n * The prompt template\n */\n template: Record<string, unknown>;\n /**\n * The format of the prompt template. Options are 'f-string'\n *\n * @defaultValue 'f-string'\n */\n templateFormat?: TemplateFormat;\n /**\n * Whether or not to try validating the template on initialization\n *\n * @defaultValue `true`\n */\n validateTemplate?: boolean;\n /**\n * Additional fields which should be included inside\n * the message content array if using a complex message\n * content.\n */\n additionalContentFields?: ContentBlock;\n}\n/**\n * An image prompt template for a multimodal model.\n */\nexport declare class ImagePromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends BasePromptTemplate<RunInput, ImagePromptValue, PartialVariableName> {\n static lc_name(): string;\n lc_namespace: string[];\n template: Record<string, unknown>;\n templateFormat: TemplateFormat;\n validateTemplate: boolean;\n /**\n * Additional fields which should be included inside\n * the message content array if using a complex message\n * content.\n */\n additionalContentFields?: ContentBlock;\n constructor(input: ImagePromptTemplateInput<RunInput, PartialVariableName>);\n _getPromptType(): \"prompt\";\n /**\n * Partially applies values to the prompt template.\n * @param values The values to be partially applied to the prompt template.\n * @returns A new instance of ImagePromptTemplate with the partially applied values.\n */\n partial<NewPartialVariableName extends string>(values: PartialValues<NewPartialVariableName>): Promise<ImagePromptTemplate<InputValues<Exclude<Extract<keyof RunInput, string>, NewPartialVariableName>>, any>>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format<FormatOutput = ImageContent>(values: TypedPromptInputValues<RunInput>): Promise<FormatOutput>;\n /**\n * Formats the prompt given the input values and returns a formatted\n * prompt value.\n * @param values The input values to format the prompt.\n * @returns A Promise that resolves to a formatted prompt value.\n */\n formatPromptValue(values: TypedPromptInputValues<RunInput>): Promise<ImagePromptValue>;\n}\n//# sourceMappingURL=image.d.ts.map"],"mappings":";;;;;;;;;;;;AASA;AAA2DG,UAA1CM,wBAA0CN,CAAAA,iBAAAA,WAAAA,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAAqEG,uBAArEH,CAA6FO,QAA7FP,EAAuGQ,mBAAvGR,CAAAA,CAAAA;EAA6FO;;;EAUnIF,QAAAA,EANPI,MAMOJ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAYSR;;AAtByH;AA2BvJ;;EAAkJU,cAAAA,CAAAA,EAjB7HF,cAiB6HE;EAAUT;;;;;EAY5GS,gBAAAA,CAAAA,EAAAA,OAAAA;EAAUC;;;;;EAOyFK,uBAAAA,CAAAA,EAxBrHhB,YAwBqHgB;;;;;AAAhDE,cAnB9EL,mBAmB8EK,CAAAA,iBAnBzCf,WAmByCe,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAnB4Bb,kBAmB5Ba,CAnB+CR,QAmB/CQ,EAnByDjB,gBAmBzDiB,EAnB2EP,mBAmB3EO,CAAAA,CAAAA;EAMzEhB,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAA6CQ,YAAAA,EAAAA,MAAAA,EAAAA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