@langchain/openai 1.2.7 → 1.2.8-dev-1771365493298

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/azure/chat_models/common.cjs +9 -10
  2. package/dist/azure/chat_models/common.cjs.map +1 -1
  3. package/dist/azure/chat_models/common.d.cts +0 -1
  4. package/dist/azure/chat_models/common.d.cts.map +1 -1
  5. package/dist/azure/chat_models/common.d.ts +0 -1
  6. package/dist/azure/chat_models/common.d.ts.map +1 -1
  7. package/dist/azure/chat_models/common.js +1 -1
  8. package/dist/azure/chat_models/common.js.map +1 -1
  9. package/dist/azure/chat_models/completions.cjs.map +1 -1
  10. package/dist/azure/chat_models/completions.d.cts.map +1 -1
  11. package/dist/azure/chat_models/completions.d.ts.map +1 -1
  12. package/dist/azure/chat_models/completions.js.map +1 -1
  13. package/dist/azure/chat_models/index.cjs.map +1 -1
  14. package/dist/azure/chat_models/index.d.cts +0 -1
  15. package/dist/azure/chat_models/index.d.cts.map +1 -1
  16. package/dist/azure/chat_models/index.d.ts +0 -1
  17. package/dist/azure/chat_models/index.d.ts.map +1 -1
  18. package/dist/azure/chat_models/index.js.map +1 -1
  19. package/dist/azure/chat_models/responses.cjs.map +1 -1
  20. package/dist/azure/chat_models/responses.d.cts.map +1 -1
  21. package/dist/azure/chat_models/responses.d.ts.map +1 -1
  22. package/dist/azure/chat_models/responses.js.map +1 -1
  23. package/dist/azure/embeddings.cjs +10 -13
  24. package/dist/azure/embeddings.cjs.map +1 -1
  25. package/dist/azure/embeddings.d.cts +1 -2
  26. package/dist/azure/embeddings.d.cts.map +1 -1
  27. package/dist/azure/embeddings.d.ts +1 -2
  28. package/dist/azure/embeddings.d.ts.map +1 -1
  29. package/dist/azure/embeddings.js +3 -5
  30. package/dist/azure/embeddings.js.map +1 -1
  31. package/dist/azure/llms.cjs +9 -10
  32. package/dist/azure/llms.cjs.map +1 -1
  33. package/dist/azure/llms.d.cts +2 -2
  34. package/dist/azure/llms.d.cts.map +1 -1
  35. package/dist/azure/llms.d.ts +2 -2
  36. package/dist/azure/llms.d.ts.map +1 -1
  37. package/dist/azure/llms.js +3 -3
  38. package/dist/azure/llms.js.map +1 -1
  39. package/dist/chat_models/base.cjs +38 -45
  40. package/dist/chat_models/base.cjs.map +1 -1
  41. package/dist/chat_models/base.d.cts.map +1 -1
  42. package/dist/chat_models/base.d.ts.map +1 -1
  43. package/dist/chat_models/base.js +10 -16
  44. package/dist/chat_models/base.js.map +1 -1
  45. package/dist/chat_models/completions.cjs +9 -13
  46. package/dist/chat_models/completions.cjs.map +1 -1
  47. package/dist/chat_models/completions.d.cts.map +1 -1
  48. package/dist/chat_models/completions.d.ts.map +1 -1
  49. package/dist/chat_models/completions.js +3 -6
  50. package/dist/chat_models/completions.js.map +1 -1
  51. package/dist/chat_models/index.cjs.map +1 -1
  52. package/dist/chat_models/index.d.cts.map +1 -1
  53. package/dist/chat_models/index.d.ts.map +1 -1
  54. package/dist/chat_models/index.js.map +1 -1
  55. package/dist/chat_models/profiles.cjs +1 -2
  56. package/dist/chat_models/profiles.cjs.map +1 -1
  57. package/dist/chat_models/profiles.js +1 -2
  58. package/dist/chat_models/profiles.js.map +1 -1
  59. package/dist/chat_models/responses.cjs +4 -7
  60. package/dist/chat_models/responses.cjs.map +1 -1
  61. package/dist/chat_models/responses.d.cts.map +1 -1
  62. package/dist/chat_models/responses.d.ts.map +1 -1
  63. package/dist/chat_models/responses.js +2 -4
  64. package/dist/chat_models/responses.js.map +1 -1
  65. package/dist/converters/completions.cjs +36 -45
  66. package/dist/converters/completions.cjs.map +1 -1
  67. package/dist/converters/completions.d.cts +0 -1
  68. package/dist/converters/completions.d.cts.map +1 -1
  69. package/dist/converters/completions.d.ts +0 -1
  70. package/dist/converters/completions.d.ts.map +1 -1
  71. package/dist/converters/completions.js +14 -22
  72. package/dist/converters/completions.js.map +1 -1
  73. package/dist/converters/index.js +2 -0
  74. package/dist/converters/responses.cjs +39 -54
  75. package/dist/converters/responses.cjs.map +1 -1
  76. package/dist/converters/responses.d.cts.map +1 -1
  77. package/dist/converters/responses.d.ts.map +1 -1
  78. package/dist/converters/responses.js +31 -45
  79. package/dist/converters/responses.js.map +1 -1
  80. package/dist/embeddings.cjs +11 -15
  81. package/dist/embeddings.cjs.map +1 -1
  82. package/dist/embeddings.d.cts +1 -3
  83. package/dist/embeddings.d.cts.map +1 -1
  84. package/dist/embeddings.d.ts +1 -3
  85. package/dist/embeddings.d.ts.map +1 -1
  86. package/dist/embeddings.js +3 -6
  87. package/dist/embeddings.js.map +1 -1
  88. package/dist/index.cjs +2 -2
  89. package/dist/llms.cjs +27 -33
  90. package/dist/llms.cjs.map +1 -1
  91. package/dist/llms.d.cts +0 -1
  92. package/dist/llms.d.cts.map +1 -1
  93. package/dist/llms.d.ts +0 -1
  94. package/dist/llms.d.ts.map +1 -1
  95. package/dist/llms.js +15 -20
  96. package/dist/llms.js.map +1 -1
  97. package/dist/tools/applyPatch.cjs +3 -4
  98. package/dist/tools/applyPatch.cjs.map +1 -1
  99. package/dist/tools/applyPatch.d.cts +0 -1
  100. package/dist/tools/applyPatch.d.cts.map +1 -1
  101. package/dist/tools/applyPatch.d.ts +0 -1
  102. package/dist/tools/applyPatch.d.ts.map +1 -1
  103. package/dist/tools/applyPatch.js.map +1 -1
  104. package/dist/tools/codeInterpreter.cjs.map +1 -1
  105. package/dist/tools/codeInterpreter.d.cts +0 -1
  106. package/dist/tools/codeInterpreter.d.cts.map +1 -1
  107. package/dist/tools/codeInterpreter.d.ts +0 -1
  108. package/dist/tools/codeInterpreter.d.ts.map +1 -1
  109. package/dist/tools/codeInterpreter.js.map +1 -1
  110. package/dist/tools/computerUse.cjs +7 -13
  111. package/dist/tools/computerUse.cjs.map +1 -1
  112. package/dist/tools/computerUse.d.cts +0 -1
  113. package/dist/tools/computerUse.d.cts.map +1 -1
  114. package/dist/tools/computerUse.d.ts +0 -1
  115. package/dist/tools/computerUse.d.ts.map +1 -1
  116. package/dist/tools/computerUse.js +1 -6
  117. package/dist/tools/computerUse.js.map +1 -1
  118. package/dist/tools/custom.cjs +6 -7
  119. package/dist/tools/custom.cjs.map +1 -1
  120. package/dist/tools/custom.d.cts.map +1 -1
  121. package/dist/tools/custom.d.ts.map +1 -1
  122. package/dist/tools/custom.js.map +1 -1
  123. package/dist/tools/dalle.cjs +10 -16
  124. package/dist/tools/dalle.cjs.map +1 -1
  125. package/dist/tools/dalle.d.cts +0 -1
  126. package/dist/tools/dalle.d.cts.map +1 -1
  127. package/dist/tools/dalle.d.ts +0 -1
  128. package/dist/tools/dalle.d.ts.map +1 -1
  129. package/dist/tools/dalle.js +6 -11
  130. package/dist/tools/dalle.js.map +1 -1
  131. package/dist/tools/fileSearch.cjs.map +1 -1
  132. package/dist/tools/fileSearch.d.cts +0 -1
  133. package/dist/tools/fileSearch.d.cts.map +1 -1
  134. package/dist/tools/fileSearch.d.ts +0 -1
  135. package/dist/tools/fileSearch.d.ts.map +1 -1
  136. package/dist/tools/fileSearch.js.map +1 -1
  137. package/dist/tools/imageGeneration.cjs.map +1 -1
  138. package/dist/tools/imageGeneration.d.cts +0 -1
  139. package/dist/tools/imageGeneration.d.cts.map +1 -1
  140. package/dist/tools/imageGeneration.d.ts +0 -1
  141. package/dist/tools/imageGeneration.d.ts.map +1 -1
  142. package/dist/tools/imageGeneration.js.map +1 -1
  143. package/dist/tools/index.cjs.map +1 -1
  144. package/dist/tools/index.d.cts +0 -1
  145. package/dist/tools/index.d.cts.map +1 -1
  146. package/dist/tools/index.d.ts +0 -1
  147. package/dist/tools/index.d.ts.map +1 -1
  148. package/dist/tools/index.js.map +1 -1
  149. package/dist/tools/localShell.cjs +3 -4
  150. package/dist/tools/localShell.cjs.map +1 -1
  151. package/dist/tools/localShell.d.cts +0 -1
  152. package/dist/tools/localShell.d.cts.map +1 -1
  153. package/dist/tools/localShell.d.ts +0 -1
  154. package/dist/tools/localShell.d.ts.map +1 -1
  155. package/dist/tools/localShell.js.map +1 -1
  156. package/dist/tools/mcp.cjs.map +1 -1
  157. package/dist/tools/mcp.d.cts +0 -1
  158. package/dist/tools/mcp.d.cts.map +1 -1
  159. package/dist/tools/mcp.d.ts +0 -1
  160. package/dist/tools/mcp.d.ts.map +1 -1
  161. package/dist/tools/mcp.js.map +1 -1
  162. package/dist/tools/shell.cjs +3 -4
  163. package/dist/tools/shell.cjs.map +1 -1
  164. package/dist/tools/shell.d.cts +0 -1
  165. package/dist/tools/shell.d.cts.map +1 -1
  166. package/dist/tools/shell.d.ts +0 -1
  167. package/dist/tools/shell.d.ts.map +1 -1
  168. package/dist/tools/shell.js.map +1 -1
  169. package/dist/tools/webSearch.cjs.map +1 -1
  170. package/dist/tools/webSearch.d.cts +0 -1
  171. package/dist/tools/webSearch.d.cts.map +1 -1
  172. package/dist/tools/webSearch.d.ts +0 -1
  173. package/dist/tools/webSearch.d.ts.map +1 -1
  174. package/dist/tools/webSearch.js.map +1 -1
  175. package/dist/types.d.cts +0 -1
  176. package/dist/types.d.cts.map +1 -1
  177. package/dist/types.d.ts +0 -1
  178. package/dist/types.d.ts.map +1 -1
  179. package/dist/utils/azure.cjs +2 -3
  180. package/dist/utils/azure.cjs.map +1 -1
  181. package/dist/utils/azure.d.cts.map +1 -1
  182. package/dist/utils/azure.d.ts.map +1 -1
  183. package/dist/utils/azure.js.map +1 -1
  184. package/dist/utils/client.cjs +9 -3
  185. package/dist/utils/client.cjs.map +1 -1
  186. package/dist/utils/client.d.cts.map +1 -1
  187. package/dist/utils/client.d.ts.map +1 -1
  188. package/dist/utils/client.js +8 -1
  189. package/dist/utils/client.js.map +1 -1
  190. package/dist/utils/errors.cjs.map +1 -1
  191. package/dist/utils/errors.js.map +1 -1
  192. package/dist/utils/misc.cjs +2 -3
  193. package/dist/utils/misc.cjs.map +1 -1
  194. package/dist/utils/misc.d.cts +0 -1
  195. package/dist/utils/misc.d.cts.map +1 -1
  196. package/dist/utils/misc.d.ts +0 -1
  197. package/dist/utils/misc.d.ts.map +1 -1
  198. package/dist/utils/misc.js.map +1 -1
  199. package/dist/utils/output.cjs +7 -8
  200. package/dist/utils/output.cjs.map +1 -1
  201. package/dist/utils/output.js.map +1 -1
  202. package/dist/utils/prompts.cjs +1 -2
  203. package/dist/utils/prompts.cjs.map +1 -1
  204. package/dist/utils/prompts.d.cts +0 -1
  205. package/dist/utils/prompts.d.cts.map +1 -1
  206. package/dist/utils/prompts.d.ts +0 -1
  207. package/dist/utils/prompts.d.ts.map +1 -1
  208. package/dist/utils/prompts.js +1 -2
  209. package/dist/utils/prompts.js.map +1 -1
  210. package/dist/utils/tools.cjs +9 -12
  211. package/dist/utils/tools.cjs.map +1 -1
  212. package/dist/utils/tools.d.cts +0 -1
  213. package/dist/utils/tools.d.cts.map +1 -1
  214. package/dist/utils/tools.d.ts +0 -1
  215. package/dist/utils/tools.d.ts.map +1 -1
  216. package/dist/utils/tools.js +5 -7
  217. package/dist/utils/tools.js.map +1 -1
  218. package/package.json +5 -5
  219. package/dist/_virtual/rolldown_runtime.cjs +0 -25
@@ -1 +1 @@
1
- {"version":3,"file":"dalle.js","names":["fields?: DallEAPIWrapperParams","OpenAIClient","response: OpenAIClient.Images.ImagesResponse[]","input: string"],"sources":["../../src/tools/dalle.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { OpenAI as OpenAIClient } from \"openai\";\nimport { Tool, ToolParams } from \"@langchain/core/tools\";\nimport {\n MessageContentComplex,\n MessageContentImageUrl,\n} from \"@langchain/core/messages\";\n\n/**\n * @see https://platform.openai.com/docs/api-reference/images/create\n */\nexport type OpenAIImageModelId =\n | OpenAIClient.ImageModel\n | (string & NonNullable<unknown>);\n\n/**\n * An interface for the Dall-E API Wrapper.\n */\nexport interface DallEAPIWrapperParams extends ToolParams {\n /**\n * The OpenAI API key\n * Alias for `apiKey`\n */\n openAIApiKey?: string;\n /**\n * The OpenAI API key\n */\n apiKey?: string;\n /**\n * The model to use.\n * Alias for `model`\n * @params \"dall-e-2\" | \"dall-e-3\"\n * @default \"dall-e-3\"\n * @deprecated Use `model` instead.\n */\n modelName?: OpenAIImageModelId;\n /**\n * The model to use.\n * @params \"dall-e-2\" | \"dall-e-3\"\n * @default \"dall-e-3\"\n */\n model?: OpenAIImageModelId;\n /**\n * The style of the generated images. Must be one of vivid or natural.\n * Vivid causes the model to lean towards generating hyper-real and dramatic images.\n * Natural causes the model to produce more natural, less hyper-real looking images.\n * @default \"vivid\"\n */\n style?: \"natural\" | \"vivid\";\n /**\n * The quality of the image that will be generated. ‘hd’ creates images with finer\n * details and greater consistency across the image.\n * @default \"standard\"\n */\n quality?: \"standard\" | \"hd\";\n /**\n * The number of images to generate.\n * Must be between 1 and 10.\n * For dall-e-3, only `n: 1` is supported.\n * @default 1\n */\n n?: number;\n /**\n * The size of the generated images.\n * Must be one of 256x256, 512x512, or 1024x1024 for DALL·E-2 models.\n * Must be one of 1024x1024, 1792x1024, or 1024x1792 for DALL·E-3 models.\n * @default \"1024x1024\"\n */\n size?: \"256x256\" | \"512x512\" | \"1024x1024\" | \"1792x1024\" | \"1024x1792\";\n /**\n * The format in which the generated images are returned.\n * Must be one of \"url\" or \"b64_json\".\n * @default \"url\"\n */\n dallEResponseFormat?: \"url\" | \"b64_json\";\n /**\n * @deprecated Use dallEResponseFormat instead for the Dall-E response type.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responseFormat?: any;\n /**\n * A unique identifier representing your end-user, which will help\n * OpenAI to monitor and detect abuse.\n */\n user?: string;\n /**\n * The organization to use\n */\n organization?: string;\n /**\n * The base URL of the OpenAI API.\n */\n baseUrl?: string;\n}\n\n/**\n * A tool for generating images with Open AIs Dall-E 2 or 3 API.\n */\nexport class DallEAPIWrapper extends Tool {\n static lc_name() {\n return \"DallEAPIWrapper\";\n }\n\n name = \"dalle_api_wrapper\";\n\n description =\n \"A wrapper around OpenAI DALL-E API. Useful for when you need to generate images from a text description. Input should be an image description.\";\n\n protected client: OpenAIClient;\n\n static readonly toolName = \"dalle_api_wrapper\";\n\n private model = \"dall-e-3\";\n\n private style: \"natural\" | \"vivid\" = \"vivid\";\n\n private quality: \"standard\" | \"hd\" = \"standard\";\n\n private n = 1;\n\n private size:\n | \"256x256\"\n | \"512x512\"\n | \"1024x1024\"\n | \"1792x1024\"\n | \"1024x1792\" = \"1024x1024\";\n\n private dallEResponseFormat: \"url\" | \"b64_json\" = \"url\";\n\n private user?: string;\n\n constructor(fields?: DallEAPIWrapperParams) {\n // Shim for new base tool param name\n if (\n fields?.responseFormat !== undefined &&\n [\"url\", \"b64_json\"].includes(fields.responseFormat)\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fields.dallEResponseFormat = fields.responseFormat as any;\n fields.responseFormat = \"content\";\n }\n super(fields);\n const openAIApiKey =\n fields?.apiKey ??\n fields?.openAIApiKey ??\n getEnvironmentVariable(\"OPENAI_API_KEY\");\n\n const organization =\n fields?.organization ?? getEnvironmentVariable(\"OPENAI_ORGANIZATION\");\n\n const clientConfig = {\n apiKey: openAIApiKey,\n organization,\n dangerouslyAllowBrowser: true,\n baseURL: fields?.baseUrl,\n };\n this.client = new OpenAIClient(clientConfig);\n this.model = fields?.model ?? fields?.modelName ?? this.model;\n this.style = fields?.style ?? this.style;\n this.quality = fields?.quality ?? this.quality;\n this.n = fields?.n ?? this.n;\n this.size = fields?.size ?? this.size;\n this.dallEResponseFormat =\n fields?.dallEResponseFormat ?? this.dallEResponseFormat;\n this.user = fields?.user;\n }\n\n /**\n * Processes the API response if multiple images are generated.\n * Returns a list of MessageContentImageUrl objects. If the response\n * format is `url`, then the `image_url` field will contain the URL.\n * If it is `b64_json`, then the `image_url` field will contain an object\n * with a `url` field with the base64 encoded image.\n *\n * @param {OpenAIClient.Images.ImagesResponse[]} response The API response\n * @returns {MessageContentImageUrl[]}\n */\n private processMultipleGeneratedUrls(\n response: OpenAIClient.Images.ImagesResponse[]\n ): MessageContentImageUrl[] {\n if (this.dallEResponseFormat === \"url\") {\n return response.flatMap((res) => {\n const imageUrlContent =\n res.data\n ?.flatMap((item) => {\n if (!item.url) return [];\n return {\n type: \"image_url\" as const,\n image_url: item.url,\n };\n })\n .filter(\n (item) =>\n item !== undefined &&\n item.type === \"image_url\" &&\n typeof item.image_url === \"string\" &&\n item.image_url !== undefined\n ) ?? [];\n return imageUrlContent;\n });\n } else {\n return response.flatMap((res) => {\n const b64Content =\n res.data\n ?.flatMap((item) => {\n if (!item.b64_json) return [];\n return {\n type: \"image_url\" as const,\n image_url: {\n url: item.b64_json,\n },\n };\n })\n .filter(\n (item) =>\n item !== undefined &&\n item.type === \"image_url\" &&\n typeof item.image_url === \"object\" &&\n \"url\" in item.image_url &&\n typeof item.image_url.url === \"string\" &&\n item.image_url.url !== undefined\n ) ?? [];\n return b64Content;\n });\n }\n }\n\n /** @ignore */\n async _call(input: string): Promise<string | MessageContentComplex[]> {\n const generateImageFields = {\n model: this.model,\n prompt: input,\n n: 1,\n size: this.size,\n response_format: this.dallEResponseFormat,\n style: this.style,\n quality: this.quality,\n user: this.user,\n };\n\n if (this.n > 1) {\n const results = await Promise.all(\n Array.from({ length: this.n }).map(() =>\n this.client.images.generate(generateImageFields)\n )\n );\n\n return this.processMultipleGeneratedUrls(results);\n }\n\n const response = await this.client.images.generate(generateImageFields);\n\n let data = \"\";\n if (this.dallEResponseFormat === \"url\") {\n [data] =\n response.data\n ?.map((item) => item.url)\n .filter((url): url is string => url !== \"undefined\") ?? [];\n } else {\n [data] =\n response.data\n ?.map((item) => item.b64_json)\n .filter((b64_json): b64_json is string => b64_json !== \"undefined\") ??\n [];\n }\n return data;\n }\n}\n"],"mappings":";;;;;;;;AAkGA,IAAa,kBAAb,cAAqC,KAAK;CACxC,OAAO,UAAU;AACf,SAAO;CACR;CAED,OAAO;CAEP,cACE;CAEF,AAAU;CAEV,OAAgB,WAAW;CAE3B,AAAQ,QAAQ;CAEhB,AAAQ,QAA6B;CAErC,AAAQ,UAA6B;CAErC,AAAQ,IAAI;CAEZ,AAAQ,OAKU;CAElB,AAAQ,sBAA0C;CAElD,AAAQ;CAER,YAAYA,QAAgC;AAE1C,MACE,QAAQ,mBAAmB,UAC3B,CAAC,OAAO,UAAW,EAAC,SAAS,OAAO,eAAe,EACnD;GAEA,OAAO,sBAAsB,OAAO;GACpC,OAAO,iBAAiB;EACzB;EACD,MAAM,OAAO;EACb,MAAM,eACJ,QAAQ,UACR,QAAQ,gBACR,uBAAuB,iBAAiB;EAE1C,MAAM,eACJ,QAAQ,gBAAgB,uBAAuB,sBAAsB;EAEvE,MAAM,eAAe;GACnB,QAAQ;GACR;GACA,yBAAyB;GACzB,SAAS,QAAQ;EAClB;EACD,KAAK,SAAS,IAAIC,SAAa;EAC/B,KAAK,QAAQ,QAAQ,SAAS,QAAQ,aAAa,KAAK;EACxD,KAAK,QAAQ,QAAQ,SAAS,KAAK;EACnC,KAAK,UAAU,QAAQ,WAAW,KAAK;EACvC,KAAK,IAAI,QAAQ,KAAK,KAAK;EAC3B,KAAK,OAAO,QAAQ,QAAQ,KAAK;EACjC,KAAK,sBACH,QAAQ,uBAAuB,KAAK;EACtC,KAAK,OAAO,QAAQ;CACrB;;;;;;;;;;;CAYD,AAAQ,6BACNC,UAC0B;AAC1B,MAAI,KAAK,wBAAwB,MAC/B,QAAO,SAAS,QAAQ,CAAC,QAAQ;GAC/B,MAAM,kBACJ,IAAI,MACA,QAAQ,CAAC,SAAS;AAClB,QAAI,CAAC,KAAK,IAAK,QAAO,CAAE;AACxB,WAAO;KACL,MAAM;KACN,WAAW,KAAK;IACjB;GACF,EAAC,CACD,OACC,CAAC,SACC,SAAS,UACT,KAAK,SAAS,eACd,OAAO,KAAK,cAAc,YAC1B,KAAK,cAAc,OACtB,IAAI,CAAE;AACX,UAAO;EACR,EAAC;MAEF,QAAO,SAAS,QAAQ,CAAC,QAAQ;GAC/B,MAAM,aACJ,IAAI,MACA,QAAQ,CAAC,SAAS;AAClB,QAAI,CAAC,KAAK,SAAU,QAAO,CAAE;AAC7B,WAAO;KACL,MAAM;KACN,WAAW,EACT,KAAK,KAAK,SACX;IACF;GACF,EAAC,CACD,OACC,CAAC,SACC,SAAS,UACT,KAAK,SAAS,eACd,OAAO,KAAK,cAAc,YAC1B,SAAS,KAAK,aACd,OAAO,KAAK,UAAU,QAAQ,YAC9B,KAAK,UAAU,QAAQ,OAC1B,IAAI,CAAE;AACX,UAAO;EACR,EAAC;CAEL;;CAGD,MAAM,MAAMC,OAA0D;EACpE,MAAM,sBAAsB;GAC1B,OAAO,KAAK;GACZ,QAAQ;GACR,GAAG;GACH,MAAM,KAAK;GACX,iBAAiB,KAAK;GACtB,OAAO,KAAK;GACZ,SAAS,KAAK;GACd,MAAM,KAAK;EACZ;AAED,MAAI,KAAK,IAAI,GAAG;GACd,MAAM,UAAU,MAAM,QAAQ,IAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,EAAG,EAAC,CAAC,IAAI,MACjC,KAAK,OAAO,OAAO,SAAS,oBAAoB,CACjD,CACF;AAED,UAAO,KAAK,6BAA6B,QAAQ;EAClD;EAED,MAAM,WAAW,MAAM,KAAK,OAAO,OAAO,SAAS,oBAAoB;EAEvE,IAAI,OAAO;AACX,MAAI,KAAK,wBAAwB,OAC/B,CAAC,KAAK,GACJ,SAAS,MACL,IAAI,CAAC,SAAS,KAAK,IAAI,CACxB,OAAO,CAAC,QAAuB,QAAQ,YAAY,IAAI,CAAE;OAE9D,CAAC,KAAK,GACJ,SAAS,MACL,IAAI,CAAC,SAAS,KAAK,SAAS,CAC7B,OAAO,CAAC,aAAiC,aAAa,YAAY,IACrE,CAAE;AAEN,SAAO;CACR;AACF"}
1
+ {"version":3,"file":"dalle.js","names":["OpenAIClient"],"sources":["../../src/tools/dalle.ts"],"sourcesContent":["import { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { OpenAI as OpenAIClient } from \"openai\";\nimport { Tool, ToolParams } from \"@langchain/core/tools\";\nimport {\n MessageContentComplex,\n MessageContentImageUrl,\n} from \"@langchain/core/messages\";\n\n/**\n * @see https://platform.openai.com/docs/api-reference/images/create\n */\nexport type OpenAIImageModelId =\n | OpenAIClient.ImageModel\n | (string & NonNullable<unknown>);\n\n/**\n * An interface for the Dall-E API Wrapper.\n */\nexport interface DallEAPIWrapperParams extends ToolParams {\n /**\n * The OpenAI API key\n * Alias for `apiKey`\n */\n openAIApiKey?: string;\n /**\n * The OpenAI API key\n */\n apiKey?: string;\n /**\n * The model to use.\n * Alias for `model`\n * @params \"dall-e-2\" | \"dall-e-3\"\n * @default \"dall-e-3\"\n * @deprecated Use `model` instead.\n */\n modelName?: OpenAIImageModelId;\n /**\n * The model to use.\n * @params \"dall-e-2\" | \"dall-e-3\"\n * @default \"dall-e-3\"\n */\n model?: OpenAIImageModelId;\n /**\n * The style of the generated images. Must be one of vivid or natural.\n * Vivid causes the model to lean towards generating hyper-real and dramatic images.\n * Natural causes the model to produce more natural, less hyper-real looking images.\n * @default \"vivid\"\n */\n style?: \"natural\" | \"vivid\";\n /**\n * The quality of the image that will be generated. ‘hd’ creates images with finer\n * details and greater consistency across the image.\n * @default \"standard\"\n */\n quality?: \"standard\" | \"hd\";\n /**\n * The number of images to generate.\n * Must be between 1 and 10.\n * For dall-e-3, only `n: 1` is supported.\n * @default 1\n */\n n?: number;\n /**\n * The size of the generated images.\n * Must be one of 256x256, 512x512, or 1024x1024 for DALL·E-2 models.\n * Must be one of 1024x1024, 1792x1024, or 1024x1792 for DALL·E-3 models.\n * @default \"1024x1024\"\n */\n size?: \"256x256\" | \"512x512\" | \"1024x1024\" | \"1792x1024\" | \"1024x1792\";\n /**\n * The format in which the generated images are returned.\n * Must be one of \"url\" or \"b64_json\".\n * @default \"url\"\n */\n dallEResponseFormat?: \"url\" | \"b64_json\";\n /**\n * @deprecated Use dallEResponseFormat instead for the Dall-E response type.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responseFormat?: any;\n /**\n * A unique identifier representing your end-user, which will help\n * OpenAI to monitor and detect abuse.\n */\n user?: string;\n /**\n * The organization to use\n */\n organization?: string;\n /**\n * The base URL of the OpenAI API.\n */\n baseUrl?: string;\n}\n\n/**\n * A tool for generating images with Open AIs Dall-E 2 or 3 API.\n */\nexport class DallEAPIWrapper extends Tool {\n static lc_name() {\n return \"DallEAPIWrapper\";\n }\n\n name = \"dalle_api_wrapper\";\n\n description =\n \"A wrapper around OpenAI DALL-E API. Useful for when you need to generate images from a text description. Input should be an image description.\";\n\n protected client: OpenAIClient;\n\n static readonly toolName = \"dalle_api_wrapper\";\n\n private model = \"dall-e-3\";\n\n private style: \"natural\" | \"vivid\" = \"vivid\";\n\n private quality: \"standard\" | \"hd\" = \"standard\";\n\n private n = 1;\n\n private size:\n | \"256x256\"\n | \"512x512\"\n | \"1024x1024\"\n | \"1792x1024\"\n | \"1024x1792\" = \"1024x1024\";\n\n private dallEResponseFormat: \"url\" | \"b64_json\" = \"url\";\n\n private user?: string;\n\n constructor(fields?: DallEAPIWrapperParams) {\n // Shim for new base tool param name\n if (\n fields?.responseFormat !== undefined &&\n [\"url\", \"b64_json\"].includes(fields.responseFormat)\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fields.dallEResponseFormat = fields.responseFormat as any;\n fields.responseFormat = \"content\";\n }\n super(fields);\n const openAIApiKey =\n fields?.apiKey ??\n fields?.openAIApiKey ??\n getEnvironmentVariable(\"OPENAI_API_KEY\");\n\n const organization =\n fields?.organization ?? getEnvironmentVariable(\"OPENAI_ORGANIZATION\");\n\n const clientConfig = {\n apiKey: openAIApiKey,\n organization,\n dangerouslyAllowBrowser: true,\n baseURL: fields?.baseUrl,\n };\n this.client = new OpenAIClient(clientConfig);\n this.model = fields?.model ?? fields?.modelName ?? this.model;\n this.style = fields?.style ?? this.style;\n this.quality = fields?.quality ?? this.quality;\n this.n = fields?.n ?? this.n;\n this.size = fields?.size ?? this.size;\n this.dallEResponseFormat =\n fields?.dallEResponseFormat ?? this.dallEResponseFormat;\n this.user = fields?.user;\n }\n\n /**\n * Processes the API response if multiple images are generated.\n * Returns a list of MessageContentImageUrl objects. If the response\n * format is `url`, then the `image_url` field will contain the URL.\n * If it is `b64_json`, then the `image_url` field will contain an object\n * with a `url` field with the base64 encoded image.\n *\n * @param {OpenAIClient.Images.ImagesResponse[]} response The API response\n * @returns {MessageContentImageUrl[]}\n */\n private processMultipleGeneratedUrls(\n response: OpenAIClient.Images.ImagesResponse[]\n ): MessageContentImageUrl[] {\n if (this.dallEResponseFormat === \"url\") {\n return response.flatMap((res) => {\n const imageUrlContent =\n res.data\n ?.flatMap((item) => {\n if (!item.url) return [];\n return {\n type: \"image_url\" as const,\n image_url: item.url,\n };\n })\n .filter(\n (item) =>\n item !== undefined &&\n item.type === \"image_url\" &&\n typeof item.image_url === \"string\" &&\n item.image_url !== undefined\n ) ?? [];\n return imageUrlContent;\n });\n } else {\n return response.flatMap((res) => {\n const b64Content =\n res.data\n ?.flatMap((item) => {\n if (!item.b64_json) return [];\n return {\n type: \"image_url\" as const,\n image_url: {\n url: item.b64_json,\n },\n };\n })\n .filter(\n (item) =>\n item !== undefined &&\n item.type === \"image_url\" &&\n typeof item.image_url === \"object\" &&\n \"url\" in item.image_url &&\n typeof item.image_url.url === \"string\" &&\n item.image_url.url !== undefined\n ) ?? [];\n return b64Content;\n });\n }\n }\n\n /** @ignore */\n async _call(input: string): Promise<string | MessageContentComplex[]> {\n const generateImageFields = {\n model: this.model,\n prompt: input,\n n: 1,\n size: this.size,\n response_format: this.dallEResponseFormat,\n style: this.style,\n quality: this.quality,\n user: this.user,\n };\n\n if (this.n > 1) {\n const results = await Promise.all(\n Array.from({ length: this.n }).map(() =>\n this.client.images.generate(generateImageFields)\n )\n );\n\n return this.processMultipleGeneratedUrls(results);\n }\n\n const response = await this.client.images.generate(generateImageFields);\n\n let data = \"\";\n if (this.dallEResponseFormat === \"url\") {\n [data] =\n response.data\n ?.map((item) => item.url)\n .filter((url): url is string => url !== \"undefined\") ?? [];\n } else {\n [data] =\n response.data\n ?.map((item) => item.b64_json)\n .filter((b64_json): b64_json is string => b64_json !== \"undefined\") ??\n [];\n }\n return data;\n }\n}\n"],"mappings":";;;;;;;;AAkGA,IAAa,kBAAb,cAAqC,KAAK;CACxC,OAAO,UAAU;AACf,SAAO;;CAGT,OAAO;CAEP,cACE;CAEF,AAAU;CAEV,OAAgB,WAAW;CAE3B,AAAQ,QAAQ;CAEhB,AAAQ,QAA6B;CAErC,AAAQ,UAA6B;CAErC,AAAQ,IAAI;CAEZ,AAAQ,OAKU;CAElB,AAAQ,sBAA0C;CAElD,AAAQ;CAER,YAAY,QAAgC;AAE1C,MACE,QAAQ,mBAAmB,UAC3B,CAAC,OAAO,WAAW,CAAC,SAAS,OAAO,eAAe,EACnD;AAEA,UAAO,sBAAsB,OAAO;AACpC,UAAO,iBAAiB;;AAE1B,QAAM,OAAO;AAeb,OAAK,SAAS,IAAIA,SANG;GACnB,QARA,QAAQ,UACR,QAAQ,gBACR,uBAAuB,iBAAiB;GAOxC,cAJA,QAAQ,gBAAgB,uBAAuB,sBAAsB;GAKrE,yBAAyB;GACzB,SAAS,QAAQ;GAClB,CAC2C;AAC5C,OAAK,QAAQ,QAAQ,SAAS,QAAQ,aAAa,KAAK;AACxD,OAAK,QAAQ,QAAQ,SAAS,KAAK;AACnC,OAAK,UAAU,QAAQ,WAAW,KAAK;AACvC,OAAK,IAAI,QAAQ,KAAK,KAAK;AAC3B,OAAK,OAAO,QAAQ,QAAQ,KAAK;AACjC,OAAK,sBACH,QAAQ,uBAAuB,KAAK;AACtC,OAAK,OAAO,QAAQ;;;;;;;;;;;;CAatB,AAAQ,6BACN,UAC0B;AAC1B,MAAI,KAAK,wBAAwB,MAC/B,QAAO,SAAS,SAAS,QAAQ;AAiB/B,UAfE,IAAI,MACA,SAAS,SAAS;AAClB,QAAI,CAAC,KAAK,IAAK,QAAO,EAAE;AACxB,WAAO;KACL,MAAM;KACN,WAAW,KAAK;KACjB;KACD,CACD,QACE,SACC,SAAS,UACT,KAAK,SAAS,eACd,OAAO,KAAK,cAAc,YAC1B,KAAK,cAAc,OACtB,IAAI,EAAE;IAEX;MAEF,QAAO,SAAS,SAAS,QAAQ;AAqB/B,UAnBE,IAAI,MACA,SAAS,SAAS;AAClB,QAAI,CAAC,KAAK,SAAU,QAAO,EAAE;AAC7B,WAAO;KACL,MAAM;KACN,WAAW,EACT,KAAK,KAAK,UACX;KACF;KACD,CACD,QACE,SACC,SAAS,UACT,KAAK,SAAS,eACd,OAAO,KAAK,cAAc,YAC1B,SAAS,KAAK,aACd,OAAO,KAAK,UAAU,QAAQ,YAC9B,KAAK,UAAU,QAAQ,OAC1B,IAAI,EAAE;IAEX;;;CAKN,MAAM,MAAM,OAA0D;EACpE,MAAM,sBAAsB;GAC1B,OAAO,KAAK;GACZ,QAAQ;GACR,GAAG;GACH,MAAM,KAAK;GACX,iBAAiB,KAAK;GACtB,OAAO,KAAK;GACZ,SAAS,KAAK;GACd,MAAM,KAAK;GACZ;AAED,MAAI,KAAK,IAAI,GAAG;GACd,MAAM,UAAU,MAAM,QAAQ,IAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,GAAG,CAAC,CAAC,UAC7B,KAAK,OAAO,OAAO,SAAS,oBAAoB,CACjD,CACF;AAED,UAAO,KAAK,6BAA6B,QAAQ;;EAGnD,MAAM,WAAW,MAAM,KAAK,OAAO,OAAO,SAAS,oBAAoB;EAEvE,IAAI,OAAO;AACX,MAAI,KAAK,wBAAwB,MAC/B,EAAC,QACC,SAAS,MACL,KAAK,SAAS,KAAK,IAAI,CACxB,QAAQ,QAAuB,QAAQ,YAAY,IAAI,EAAE;MAE9D,EAAC,QACC,SAAS,MACL,KAAK,SAAS,KAAK,SAAS,CAC7B,QAAQ,aAAiC,aAAa,YAAY,IACrE,EAAE;AAEN,SAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileSearch.cjs","names":["options: FileSearchRankingOptions | undefined","options: FileSearchOptions"],"sources":["../../src/tools/fileSearch.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType =\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\";\n\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter =\n | FileSearchComparisonFilter\n | FileSearchCompoundFilter;\n\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n\n/**\n * Converts ranking options to the API format.\n */\nfunction convertRankingOptions(\n options: FileSearchRankingOptions | undefined\n): OpenAIClient.Responses.FileSearchTool.RankingOptions | undefined {\n if (!options) return undefined;\n return {\n ranker: options.ranker,\n score_threshold: options.scoreThreshold,\n hybrid_search: options.hybridSearch\n ? {\n embedding_weight: options.hybridSearch.embeddingWeight,\n text_weight: options.hybridSearch.textWeight,\n }\n : undefined,\n };\n}\n\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport function fileSearch(options: FileSearchOptions): ServerTool {\n return {\n type: \"file_search\",\n vector_store_ids: options.vectorStoreIds,\n max_num_results: options.maxNumResults,\n filters: options.filters as FileSearchTool[\"filters\"],\n ranking_options: convertRankingOptions(options.rankingOptions),\n } satisfies FileSearchTool;\n}\n"],"mappings":";;;;;AAiIA,SAAS,sBACPA,SACkE;AAClE,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO;EACL,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ;EACzB,eAAe,QAAQ,eACnB;GACE,kBAAkB,QAAQ,aAAa;GACvC,aAAa,QAAQ,aAAa;EACnC,IACD;CACL;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GD,SAAgB,WAAWC,SAAwC;AACjE,QAAO;EACL,MAAM;EACN,kBAAkB,QAAQ;EAC1B,iBAAiB,QAAQ;EACzB,SAAS,QAAQ;EACjB,iBAAiB,sBAAsB,QAAQ,eAAe;CAC/D;AACF"}
1
+ {"version":3,"file":"fileSearch.cjs","names":[],"sources":["../../src/tools/fileSearch.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType =\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\";\n\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter =\n | FileSearchComparisonFilter\n | FileSearchCompoundFilter;\n\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n\n/**\n * Converts ranking options to the API format.\n */\nfunction convertRankingOptions(\n options: FileSearchRankingOptions | undefined\n): OpenAIClient.Responses.FileSearchTool.RankingOptions | undefined {\n if (!options) return undefined;\n return {\n ranker: options.ranker,\n score_threshold: options.scoreThreshold,\n hybrid_search: options.hybridSearch\n ? {\n embedding_weight: options.hybridSearch.embeddingWeight,\n text_weight: options.hybridSearch.textWeight,\n }\n : undefined,\n };\n}\n\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport function fileSearch(options: FileSearchOptions): ServerTool {\n return {\n type: \"file_search\",\n vector_store_ids: options.vectorStoreIds,\n max_num_results: options.maxNumResults,\n filters: options.filters as FileSearchTool[\"filters\"],\n ranking_options: convertRankingOptions(options.rankingOptions),\n } satisfies FileSearchTool;\n}\n"],"mappings":";;;;;AAiIA,SAAS,sBACP,SACkE;AAClE,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO;EACL,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ;EACzB,eAAe,QAAQ,eACnB;GACE,kBAAkB,QAAQ,aAAa;GACvC,aAAa,QAAQ,aAAa;GACnC,GACD;EACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GH,SAAgB,WAAW,SAAwC;AACjE,QAAO;EACL,MAAM;EACN,kBAAkB,QAAQ;EAC1B,iBAAiB,QAAQ;EACzB,SAAS,QAAQ;EACjB,iBAAiB,sBAAsB,QAAQ,eAAe;EAC/D"}
@@ -2,7 +2,6 @@ import { OpenAI as OpenAI$1 } from "openai";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/fileSearch.d.ts
5
-
6
5
  /**
7
6
  * Comparison operators for file attribute filtering.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fileSearch.d.cts","names":["OpenAI","OpenAIClient","ServerTool","FileSearchComparisonType","FileSearchComparisonFilter","Array","FileSearchCompoundFilter","FileSearchFilter","FileSearchHybridSearchWeights","FileSearchRankingOptions","FileSearchOptions","FileSearchTool","Responses","fileSearch"],"sources":["../../src/tools/fileSearch.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType = \"eq\" | \"ne\" | \"gt\" | \"gte\" | \"lt\" | \"lte\";\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter = FileSearchComparisonFilter | FileSearchCompoundFilter;\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport declare function fileSearch(options: FileSearchOptions): ServerTool;\n//# sourceMappingURL=fileSearch.d.ts.map"],"mappings":";;;;;;;AAKA;AAIiBI,KAJLD,wBAAAA,GAI+B,IAAA,GAUjCA,IAAAA,GAAAA,IAAAA,GAAAA,KAAAA,GAAAA,IAS6BE,GAAAA,KAAK;AAK5C;;;AAQaA,UAhCID,0BAAAA,CAgCJC;EAAK;AAKlB;AAIA;AAaA;AAqBA;AAwBA;AA6GA;;;QAtMUF;;;;;;;;;qCAS6BE;;;;;UAKtBC,wBAAAA;;;;;;;;WAQJD,MAAMD,6BAA6BE;;;;;KAKpCC,gBAAAA,GAAmBH,6BAA6BE;;;;UAI3CE,6BAAAA;;;;;;;;;;;;;UAaAC,wBAAAA;;;;;;;;;;;;;;;;iBAgBED;;;;;UAKFE,iBAAAA;;;;;;;;;;;;;;;YAeHH;;;;mBAIOE;;;;;KAKTE,cAAAA,GAAiBV,QAAAA,CAAaW,SAAAA,CAAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6G5BE,UAAAA,UAAoBH,oBAAoBR"}
1
+ {"version":3,"file":"fileSearch.d.cts","names":[],"sources":["../../src/tools/fileSearch.ts"],"mappings":";;;;;;AAMA;KAAY,wBAAA;;;;UAWK,0BAAA;EAA0B;;;;;;;;;EAUzC,IAAA,EAAM,wBAAA;EAeS;;;EAXf,GAAA;EAmB4C;;;;EAd5C,KAAA,8BAAmC,KAAA;AAAA;;;;UAMpB,wBAAA;EAQqD;AAMtE;;EAVE,IAAA;EAWE;;AAMJ;EAbE,OAAA,EAAS,KAAA,CAAM,0BAAA,GAA6B,wBAAA;AAAA;;;AA2B9C;KArBY,gBAAA,GACR,0BAAA,GACA,wBAAA;;;;UAKa,6BAAA;EA8Bf;;;EA1BA,eAAA;EAgCe;;;EA5Bf,UAAA;AAAA;;;;UAMe,wBAAA;EAyCE;;;AAMnB;;EAzCE,MAAA;EAyCgE;;;;EApChE,cAAA;EAoCgE;AAiIlE;;;EAhKE,YAAA,GAAe,6BAAA;AAAA;;;;UAMA,iBAAA;;;;;EAKf,cAAA;;;;;EAKA,aAAA;;;;;EAKA,OAAA,GAAU,gBAAA;;;;EAIV,cAAA,GAAiB,wBAAA;AAAA;;;;KAMP,cAAA,GAAiB,QAAA,CAAa,SAAA,CAAU,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiIpC,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,UAAA"}
@@ -2,7 +2,6 @@ import { OpenAI as OpenAI$1 } from "openai";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/fileSearch.d.ts
5
-
6
5
  /**
7
6
  * Comparison operators for file attribute filtering.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fileSearch.d.ts","names":["OpenAI","OpenAIClient","ServerTool","FileSearchComparisonType","FileSearchComparisonFilter","Array","FileSearchCompoundFilter","FileSearchFilter","FileSearchHybridSearchWeights","FileSearchRankingOptions","FileSearchOptions","FileSearchTool","Responses","fileSearch"],"sources":["../../src/tools/fileSearch.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType = \"eq\" | \"ne\" | \"gt\" | \"gte\" | \"lt\" | \"lte\";\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter = FileSearchComparisonFilter | FileSearchCompoundFilter;\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport declare function fileSearch(options: FileSearchOptions): ServerTool;\n//# sourceMappingURL=fileSearch.d.ts.map"],"mappings":";;;;;;;AAKA;AAIiBI,KAJLD,wBAAAA,GAI+B,IAAA,GAUjCA,IAAAA,GAAAA,IAAAA,GAAAA,KAAAA,GAAAA,IAS6BE,GAAAA,KAAK;AAK5C;;;AAQaA,UAhCID,0BAAAA,CAgCJC;EAAK;AAKlB;AAIA;AAaA;AAqBA;AAwBA;AA6GA;;;QAtMUF;;;;;;;;;qCAS6BE;;;;;UAKtBC,wBAAAA;;;;;;;;WAQJD,MAAMD,6BAA6BE;;;;;KAKpCC,gBAAAA,GAAmBH,6BAA6BE;;;;UAI3CE,6BAAAA;;;;;;;;;;;;;UAaAC,wBAAAA;;;;;;;;;;;;;;;;iBAgBED;;;;;UAKFE,iBAAAA;;;;;;;;;;;;;;;YAeHH;;;;mBAIOE;;;;;KAKTE,cAAAA,GAAiBV,QAAAA,CAAaW,SAAAA,CAAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6G5BE,UAAAA,UAAoBH,oBAAoBR"}
1
+ {"version":3,"file":"fileSearch.d.ts","names":[],"sources":["../../src/tools/fileSearch.ts"],"mappings":";;;;;;AAMA;KAAY,wBAAA;;;;UAWK,0BAAA;EAA0B;;;;;;;;;EAUzC,IAAA,EAAM,wBAAA;EAeS;;;EAXf,GAAA;EAmB4C;;;;EAd5C,KAAA,8BAAmC,KAAA;AAAA;;;;UAMpB,wBAAA;EAQqD;AAMtE;;EAVE,IAAA;EAWE;;AAMJ;EAbE,OAAA,EAAS,KAAA,CAAM,0BAAA,GAA6B,wBAAA;AAAA;;;AA2B9C;KArBY,gBAAA,GACR,0BAAA,GACA,wBAAA;;;;UAKa,6BAAA;EA8Bf;;;EA1BA,eAAA;EAgCe;;;EA5Bf,UAAA;AAAA;;;;UAMe,wBAAA;EAyCE;;;AAMnB;;EAzCE,MAAA;EAyCgE;;;;EApChE,cAAA;EAoCgE;AAiIlE;;;EAhKE,YAAA,GAAe,6BAAA;AAAA;;;;UAMA,iBAAA;;;;;EAKf,cAAA;;;;;EAKA,aAAA;;;;;EAKA,OAAA,GAAU,gBAAA;;;;EAIV,cAAA,GAAiB,wBAAA;AAAA;;;;KAMP,cAAA,GAAiB,QAAA,CAAa,SAAA,CAAU,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiIpC,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileSearch.js","names":["options: FileSearchRankingOptions | undefined","options: FileSearchOptions"],"sources":["../../src/tools/fileSearch.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType =\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\";\n\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter =\n | FileSearchComparisonFilter\n | FileSearchCompoundFilter;\n\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n\n/**\n * Converts ranking options to the API format.\n */\nfunction convertRankingOptions(\n options: FileSearchRankingOptions | undefined\n): OpenAIClient.Responses.FileSearchTool.RankingOptions | undefined {\n if (!options) return undefined;\n return {\n ranker: options.ranker,\n score_threshold: options.scoreThreshold,\n hybrid_search: options.hybridSearch\n ? {\n embedding_weight: options.hybridSearch.embeddingWeight,\n text_weight: options.hybridSearch.textWeight,\n }\n : undefined,\n };\n}\n\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport function fileSearch(options: FileSearchOptions): ServerTool {\n return {\n type: \"file_search\",\n vector_store_ids: options.vectorStoreIds,\n max_num_results: options.maxNumResults,\n filters: options.filters as FileSearchTool[\"filters\"],\n ranking_options: convertRankingOptions(options.rankingOptions),\n } satisfies FileSearchTool;\n}\n"],"mappings":";;;;AAiIA,SAAS,sBACPA,SACkE;AAClE,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO;EACL,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ;EACzB,eAAe,QAAQ,eACnB;GACE,kBAAkB,QAAQ,aAAa;GACvC,aAAa,QAAQ,aAAa;EACnC,IACD;CACL;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GD,SAAgB,WAAWC,SAAwC;AACjE,QAAO;EACL,MAAM;EACN,kBAAkB,QAAQ;EAC1B,iBAAiB,QAAQ;EACzB,SAAS,QAAQ;EACjB,iBAAiB,sBAAsB,QAAQ,eAAe;CAC/D;AACF"}
1
+ {"version":3,"file":"fileSearch.js","names":[],"sources":["../../src/tools/fileSearch.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Comparison operators for file attribute filtering.\n */\nexport type FileSearchComparisonType =\n | \"eq\"\n | \"ne\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\";\n\n/**\n * A filter used to compare a specified attribute key to a given value.\n */\nexport interface FileSearchComparisonFilter {\n /**\n * The comparison operator to use.\n * - `eq`: equals\n * - `ne`: not equal\n * - `gt`: greater than\n * - `gte`: greater than or equal\n * - `lt`: less than\n * - `lte`: less than or equal\n */\n type: FileSearchComparisonType;\n /**\n * The attribute key to compare against.\n */\n key: string;\n /**\n * The value to compare against the attribute key.\n * Supports string, number, boolean, or array of strings/numbers.\n */\n value: string | number | boolean | Array<string | number>;\n}\n\n/**\n * Combine multiple filters using `and` or `or`.\n */\nexport interface FileSearchCompoundFilter {\n /**\n * Type of operation: `and` or `or`.\n */\n type: \"and\" | \"or\";\n /**\n * Array of filters to combine.\n */\n filters: Array<FileSearchComparisonFilter | FileSearchCompoundFilter>;\n}\n\n/**\n * Filter type for file search - can be a comparison or compound filter.\n */\nexport type FileSearchFilter =\n | FileSearchComparisonFilter\n | FileSearchCompoundFilter;\n\n/**\n * Weights for hybrid search balancing semantic and keyword matches.\n */\nexport interface FileSearchHybridSearchWeights {\n /**\n * The weight of semantic embedding matches (0-1).\n */\n embeddingWeight: number;\n /**\n * The weight of keyword/text matches (0-1).\n */\n textWeight: number;\n}\n\n/**\n * Ranking options for file search results.\n */\nexport interface FileSearchRankingOptions {\n /**\n * The ranker to use for the file search.\n * - `auto`: Automatically select the best ranker\n * - `default-2024-11-15`: Default ranker as of November 2024\n */\n ranker?: \"auto\" | \"default-2024-11-15\";\n /**\n * The score threshold for results (0-1).\n * Numbers closer to 1 return only the most relevant results but may return fewer.\n */\n scoreThreshold?: number;\n /**\n * Weights that control how reciprocal rank fusion balances semantic\n * embedding matches versus sparse keyword matches when hybrid search is enabled.\n */\n hybridSearch?: FileSearchHybridSearchWeights;\n}\n\n/**\n * Options for the File Search tool.\n */\nexport interface FileSearchOptions {\n /**\n * The IDs of the vector stores to search.\n * You must have previously created vector stores and uploaded files to them.\n */\n vectorStoreIds: string[];\n /**\n * The maximum number of results to return.\n * Must be between 1 and 50 inclusive.\n */\n maxNumResults?: number;\n /**\n * A filter to apply based on file attributes/metadata.\n * Use this to narrow down search results to specific categories or file types.\n */\n filters?: FileSearchFilter;\n /**\n * Ranking options to customize how results are scored and ordered.\n */\n rankingOptions?: FileSearchRankingOptions;\n}\n\n/**\n * OpenAI File Search tool type for the Responses API.\n */\nexport type FileSearchTool = OpenAIClient.Responses.FileSearchTool;\n\n/**\n * Converts ranking options to the API format.\n */\nfunction convertRankingOptions(\n options: FileSearchRankingOptions | undefined\n): OpenAIClient.Responses.FileSearchTool.RankingOptions | undefined {\n if (!options) return undefined;\n return {\n ranker: options.ranker,\n score_threshold: options.scoreThreshold,\n hybrid_search: options.hybridSearch\n ? {\n embedding_weight: options.hybridSearch.embeddingWeight,\n text_weight: options.hybridSearch.textWeight,\n }\n : undefined,\n };\n}\n\n/**\n * Creates a File Search tool that allows models to search your files\n * for relevant information using semantic and keyword search.\n *\n * File Search enables models to retrieve information from a knowledge base\n * of previously uploaded files stored in vector stores. This is a hosted tool\n * managed by OpenAI - you don't need to implement the search execution yourself.\n *\n * **Prerequisites**: Before using File Search, you must:\n * 1. Upload files to the File API with `purpose: \"assistants\"`\n * 2. Create a vector store\n * 3. Add files to the vector store\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-file-search | OpenAI File Search Documentation}\n *\n * @param options - Configuration options for the File Search tool\n * @returns A File Search tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4.1\" });\n *\n * // Basic usage with a vector store\n * const response = await model.invoke(\n * \"What is deep research by OpenAI?\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"]\n * })]\n * }\n * );\n *\n * // Limit the number of results for lower latency\n * const response = await model.invoke(\n * \"Find information about pricing\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * maxNumResults: 5\n * })]\n * }\n * );\n *\n * // With metadata filtering\n * const response = await model.invoke(\n * \"Find recent blog posts about AI\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"eq\",\n * key: \"category\",\n * value: \"blog\"\n * }\n * })]\n * }\n * );\n *\n * // With compound filters (AND/OR)\n * const response = await model.invoke(\n * \"Find technical docs from 2024\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * filters: {\n * type: \"and\",\n * filters: [\n * { type: \"eq\", key: \"category\", value: \"technical\" },\n * { type: \"gte\", key: \"year\", value: 2024 }\n * ]\n * }\n * })]\n * }\n * );\n *\n * // With ranking options for more relevant results\n * const response = await model.invoke(\n * \"Find the most relevant information\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\"],\n * rankingOptions: {\n * scoreThreshold: 0.8,\n * ranker: \"auto\"\n * }\n * })]\n * }\n * );\n *\n * // Search multiple vector stores\n * const response = await model.invoke(\n * \"Search across all knowledge bases\",\n * {\n * tools: [tools.fileSearch({\n * vectorStoreIds: [\"vs_abc123\", \"vs_def456\"]\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Vector stores must be created and populated before using this tool\n * - The tool returns file citations in the response annotations\n * - Use `include: [\"file_search_call.results\"]` in the API call to get search results\n * - Supported file types include PDF, DOCX, TXT, MD, and many code file formats\n */\nexport function fileSearch(options: FileSearchOptions): ServerTool {\n return {\n type: \"file_search\",\n vector_store_ids: options.vectorStoreIds,\n max_num_results: options.maxNumResults,\n filters: options.filters as FileSearchTool[\"filters\"],\n ranking_options: convertRankingOptions(options.rankingOptions),\n } satisfies FileSearchTool;\n}\n"],"mappings":";;;;AAiIA,SAAS,sBACP,SACkE;AAClE,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO;EACL,QAAQ,QAAQ;EAChB,iBAAiB,QAAQ;EACzB,eAAe,QAAQ,eACnB;GACE,kBAAkB,QAAQ,aAAa;GACvC,aAAa,QAAQ,aAAa;GACnC,GACD;EACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GH,SAAgB,WAAW,SAAwC;AACjE,QAAO;EACL,MAAM;EACN,kBAAkB,QAAQ;EAC1B,iBAAiB,QAAQ;EACzB,SAAS,QAAQ;EACjB,iBAAiB,sBAAsB,QAAQ,eAAe;EAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"imageGeneration.cjs","names":["mask: ImageGenerationInputMask | undefined","options?: ImageGenerationOptions"],"sources":["../../src/tools/imageGeneration.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n\n/**\n * Converts input mask options to the API format.\n */\nfunction convertInputImageMask(\n mask: ImageGenerationInputMask | undefined\n): ImageGenerationTool[\"input_image_mask\"] {\n if (!mask) return undefined;\n return {\n image_url: mask.imageUrl,\n file_id: mask.fileId,\n };\n}\n\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport function imageGeneration(options?: ImageGenerationOptions): ServerTool {\n return {\n type: \"image_generation\",\n action: options?.action,\n background: options?.background,\n input_fidelity: options?.inputFidelity,\n input_image_mask: convertInputImageMask(options?.inputImageMask),\n model: options?.model,\n moderation: options?.moderation,\n output_compression: options?.outputCompression,\n output_format: options?.outputFormat,\n partial_images: options?.partialImages,\n quality: options?.quality,\n size: options?.size,\n } satisfies ImageGenerationTool;\n}\n"],"mappings":";;;;;AAwHA,SAAS,sBACPA,MACyC;AACzC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO;EACL,WAAW,KAAK;EAChB,SAAS,KAAK;CACf;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGD,SAAgB,gBAAgBC,SAA8C;AAC5E,QAAO;EACL,MAAM;EACN,QAAQ,SAAS;EACjB,YAAY,SAAS;EACrB,gBAAgB,SAAS;EACzB,kBAAkB,sBAAsB,SAAS,eAAe;EAChE,OAAO,SAAS;EAChB,YAAY,SAAS;EACrB,oBAAoB,SAAS;EAC7B,eAAe,SAAS;EACxB,gBAAgB,SAAS;EACzB,SAAS,SAAS;EAClB,MAAM,SAAS;CAChB;AACF"}
1
+ {"version":3,"file":"imageGeneration.cjs","names":[],"sources":["../../src/tools/imageGeneration.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n\n/**\n * Converts input mask options to the API format.\n */\nfunction convertInputImageMask(\n mask: ImageGenerationInputMask | undefined\n): ImageGenerationTool[\"input_image_mask\"] {\n if (!mask) return undefined;\n return {\n image_url: mask.imageUrl,\n file_id: mask.fileId,\n };\n}\n\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport function imageGeneration(options?: ImageGenerationOptions): ServerTool {\n return {\n type: \"image_generation\",\n action: options?.action,\n background: options?.background,\n input_fidelity: options?.inputFidelity,\n input_image_mask: convertInputImageMask(options?.inputImageMask),\n model: options?.model,\n moderation: options?.moderation,\n output_compression: options?.outputCompression,\n output_format: options?.outputFormat,\n partial_images: options?.partialImages,\n quality: options?.quality,\n size: options?.size,\n } satisfies ImageGenerationTool;\n}\n"],"mappings":";;;;;AAwHA,SAAS,sBACP,MACyC;AACzC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO;EACL,WAAW,KAAK;EAChB,SAAS,KAAK;EACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGH,SAAgB,gBAAgB,SAA8C;AAC5E,QAAO;EACL,MAAM;EACN,QAAQ,SAAS;EACjB,YAAY,SAAS;EACrB,gBAAgB,SAAS;EACzB,kBAAkB,sBAAsB,SAAS,eAAe;EAChE,OAAO,SAAS;EAChB,YAAY,SAAS;EACrB,oBAAoB,SAAS;EAC7B,eAAe,SAAS;EACxB,gBAAgB,SAAS;EACzB,SAAS,SAAS;EAClB,MAAM,SAAS;EAChB"}
@@ -2,7 +2,6 @@ import { OpenAI as OpenAI$1 } from "openai";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/imageGeneration.d.ts
5
-
6
5
  /**
7
6
  * Optional mask for inpainting. Allows you to specify areas of the image
8
7
  * that should be regenerated.
@@ -1 +1 @@
1
- {"version":3,"file":"imageGeneration.d.cts","names":["OpenAI","OpenAIClient","ServerTool","ImageGenerationInputMask","ImageGenerationOptions","ImageGenerationTool","Responses","Tool","ImageGeneration","imageGeneration"],"sources":["../../src/tools/imageGeneration.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport declare function imageGeneration(options?: ImageGenerationOptions): ServerTool;\n//# sourceMappingURL=imageGeneration.d.ts.map"],"mappings":";;;;;;;AAMA;AAaA;AAmFYK,UAhGKF,wBAAAA,CAgGiBF;EAkGVQ;;;;;;;;;;;;UArLPL,sBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA8BID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDTE,mBAAAA,GAAsBJ,QAAAA,CAAaK,SAAAA,CAAUC,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkGtCC,eAAAA,WAA0BL,yBAAyBF"}
1
+ {"version":3,"file":"imageGeneration.d.cts","names":[],"sources":["../../src/tools/imageGeneration.ts"],"mappings":";;;;;;AAOA;;UAAiB,wBAAA;EAIf;;AAUF;EAVE,QAAA;;;;EAIA,MAAA;AAAA;;;;UAMe,sBAAA;EAsDf;;;;;;;EA9CA,MAAA;EAsF6B;;;;;;;EA7E7B,UAAA;EA6E2E;AAgH7E;;;;;;;EAnLE,aAAA;EAmL2E;;;;EA7K3E,cAAA,GAAiB,wBAAA;;;;;EAMjB,KAAA;;;;;;;EAQA,UAAA;;;;;;EAOA,iBAAA;;;;;EAMA,YAAA;;;;;;;EAQA,aAAA;;;;;;;;;EAUA,OAAA;;;;;;;;;EAUA,IAAA;AAAA;;;;KAMU,mBAAA,GAAsB,QAAA,CAAa,SAAA,CAAU,IAAA,CAAK,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgH9C,eAAA,CAAgB,OAAA,GAAU,sBAAA,GAAyB,UAAA"}
@@ -2,7 +2,6 @@ import { OpenAI as OpenAI$1 } from "openai";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/imageGeneration.d.ts
5
-
6
5
  /**
7
6
  * Optional mask for inpainting. Allows you to specify areas of the image
8
7
  * that should be regenerated.
@@ -1 +1 @@
1
- {"version":3,"file":"imageGeneration.d.ts","names":["OpenAI","OpenAIClient","ServerTool","ImageGenerationInputMask","ImageGenerationOptions","ImageGenerationTool","Responses","Tool","ImageGeneration","imageGeneration"],"sources":["../../src/tools/imageGeneration.d.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport declare function imageGeneration(options?: ImageGenerationOptions): ServerTool;\n//# sourceMappingURL=imageGeneration.d.ts.map"],"mappings":";;;;;;;AAMA;AAaA;AAmFYK,UAhGKF,wBAAAA,CAgGiBF;EAkGVQ;;;;;;;;;;;;UArLPL,sBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA8BID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDTE,mBAAAA,GAAsBJ,QAAAA,CAAaK,SAAAA,CAAUC,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkGtCC,eAAAA,WAA0BL,yBAAyBF"}
1
+ {"version":3,"file":"imageGeneration.d.ts","names":[],"sources":["../../src/tools/imageGeneration.ts"],"mappings":";;;;;;AAOA;;UAAiB,wBAAA;EAIf;;AAUF;EAVE,QAAA;;;;EAIA,MAAA;AAAA;;;;UAMe,sBAAA;EAsDf;;;;;;;EA9CA,MAAA;EAsF6B;;;;;;;EA7E7B,UAAA;EA6E2E;AAgH7E;;;;;;;EAnLE,aAAA;EAmL2E;;;;EA7K3E,cAAA,GAAiB,wBAAA;;;;;EAMjB,KAAA;;;;;;;EAQA,UAAA;;;;;;EAOA,iBAAA;;;;;EAMA,YAAA;;;;;;;EAQA,aAAA;;;;;;;;;EAUA,OAAA;;;;;;;;;EAUA,IAAA;AAAA;;;;KAMU,mBAAA,GAAsB,QAAA,CAAa,SAAA,CAAU,IAAA,CAAK,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgH9C,eAAA,CAAgB,OAAA,GAAU,sBAAA,GAAyB,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"imageGeneration.js","names":["mask: ImageGenerationInputMask | undefined","options?: ImageGenerationOptions"],"sources":["../../src/tools/imageGeneration.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n\n/**\n * Converts input mask options to the API format.\n */\nfunction convertInputImageMask(\n mask: ImageGenerationInputMask | undefined\n): ImageGenerationTool[\"input_image_mask\"] {\n if (!mask) return undefined;\n return {\n image_url: mask.imageUrl,\n file_id: mask.fileId,\n };\n}\n\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport function imageGeneration(options?: ImageGenerationOptions): ServerTool {\n return {\n type: \"image_generation\",\n action: options?.action,\n background: options?.background,\n input_fidelity: options?.inputFidelity,\n input_image_mask: convertInputImageMask(options?.inputImageMask),\n model: options?.model,\n moderation: options?.moderation,\n output_compression: options?.outputCompression,\n output_format: options?.outputFormat,\n partial_images: options?.partialImages,\n quality: options?.quality,\n size: options?.size,\n } satisfies ImageGenerationTool;\n}\n"],"mappings":";;;;AAwHA,SAAS,sBACPA,MACyC;AACzC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO;EACL,WAAW,KAAK;EAChB,SAAS,KAAK;CACf;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGD,SAAgB,gBAAgBC,SAA8C;AAC5E,QAAO;EACL,MAAM;EACN,QAAQ,SAAS;EACjB,YAAY,SAAS;EACrB,gBAAgB,SAAS;EACzB,kBAAkB,sBAAsB,SAAS,eAAe;EAChE,OAAO,SAAS;EAChB,YAAY,SAAS;EACrB,oBAAoB,SAAS;EAC7B,eAAe,SAAS;EACxB,gBAAgB,SAAS;EACzB,SAAS,SAAS;EAClB,MAAM,SAAS;CAChB;AACF"}
1
+ {"version":3,"file":"imageGeneration.js","names":[],"sources":["../../src/tools/imageGeneration.ts"],"sourcesContent":["import { OpenAI as OpenAIClient } from \"openai\";\nimport type { ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Optional mask for inpainting. Allows you to specify areas of the image\n * that should be regenerated.\n */\nexport interface ImageGenerationInputMask {\n /**\n * Base64-encoded mask image URL.\n */\n imageUrl?: string;\n /**\n * File ID for the mask image (uploaded via OpenAI File API).\n */\n fileId?: string;\n}\n\n/**\n * Options for the Image Generation tool.\n */\nexport interface ImageGenerationOptions {\n /**\n * Whether to generate a new image or edit an existing image.\n * - `generate`: Generate a new image from scratch\n * - `edit`: Edit an existing image\n * - `auto`: Let the model decide based on the input\n * @default \"auto\"\n */\n action?: \"generate\" | \"edit\" | \"auto\";\n\n /**\n * Background type for the generated image.\n * - `transparent`: Generate image with transparent background\n * - `opaque`: Generate image with opaque background\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n background?: \"transparent\" | \"opaque\" | \"auto\";\n\n /**\n * Control how much effort the model will exert to match the style and features,\n * especially facial features, of input images. This parameter is only supported\n * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.\n * - `high`: Higher fidelity to input images\n * - `low`: Lower fidelity to input images\n * @default \"low\"\n */\n inputFidelity?: \"high\" | \"low\";\n\n /**\n * Optional mask for inpainting. Use this to specify areas of an image\n * that should be regenerated.\n */\n inputImageMask?: ImageGenerationInputMask;\n\n /**\n * The image generation model to use.\n * @default \"gpt-image-1\"\n */\n model?: \"gpt-image-1\" | \"gpt-image-1-mini\" | \"gpt-image-1.5\";\n\n /**\n * Moderation level for the generated image.\n * - `auto`: Standard moderation\n * - `low`: Less restrictive moderation\n * @default \"auto\"\n */\n moderation?: \"auto\" | \"low\";\n\n /**\n * Compression level for the output image (0-100).\n * Only applies to JPEG and WebP formats.\n * @default 100\n */\n outputCompression?: number;\n\n /**\n * The output format of the generated image.\n * @default \"png\"\n */\n outputFormat?: \"png\" | \"webp\" | \"jpeg\";\n\n /**\n * Number of partial images to generate in streaming mode (0-3).\n * When set, the model will return partial images as they are generated,\n * providing faster visual feedback.\n * @default 0\n */\n partialImages?: number;\n\n /**\n * The quality of the generated image.\n * - `low`: Faster generation, lower quality\n * - `medium`: Balanced generation time and quality\n * - `high`: Slower generation, higher quality\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n quality?: \"low\" | \"medium\" | \"high\" | \"auto\";\n\n /**\n * The size of the generated image.\n * - `1024x1024`: Square format\n * - `1024x1536`: Portrait format\n * - `1536x1024`: Landscape format\n * - `auto`: Let the model decide based on the prompt\n * @default \"auto\"\n */\n size?: \"1024x1024\" | \"1024x1536\" | \"1536x1024\" | \"auto\";\n}\n\n/**\n * OpenAI Image Generation tool type for the Responses API.\n */\nexport type ImageGenerationTool = OpenAIClient.Responses.Tool.ImageGeneration;\n\n/**\n * Converts input mask options to the API format.\n */\nfunction convertInputImageMask(\n mask: ImageGenerationInputMask | undefined\n): ImageGenerationTool[\"input_image_mask\"] {\n if (!mask) return undefined;\n return {\n image_url: mask.imageUrl,\n file_id: mask.fileId,\n };\n}\n\n/**\n * Creates an Image Generation tool that allows models to generate or edit images\n * using text prompts and optional image inputs.\n *\n * The image generation tool leverages the GPT Image model and automatically\n * optimizes text inputs for improved performance. When included in a request,\n * the model can decide when and how to generate images as part of the conversation.\n *\n * **Key Features**:\n * - Generate images from text descriptions\n * - Edit existing images with text instructions\n * - Multi-turn image editing by referencing previous responses\n * - Configurable output options (size, quality, format)\n * - Streaming support for partial image generation\n *\n * **Prompting Tips**:\n * - Use terms like \"draw\" or \"edit\" in your prompt for best results\n * - For combining images, say \"edit the first image by adding this element\" instead of \"combine\"\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}\n *\n * @param options - Configuration options for the Image Generation tool\n * @returns An Image Generation tool definition to be passed to the OpenAI Responses API\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o\" });\n *\n * // Basic usage - generate an image\n * const response = await model.invoke(\n * \"Generate an image of a gray tabby cat hugging an otter with an orange scarf\",\n * { tools: [tools.imageGeneration()] }\n * );\n *\n * // Access the generated image\n * const imageData = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"image_generation_call\"\n * );\n * if (imageData?.result) {\n * // imageData.result contains the base64-encoded image\n * const fs = await import(\"fs\");\n * fs.writeFileSync(\"output.png\", Buffer.from(imageData.result, \"base64\"));\n * }\n *\n * // With custom options\n * const response = await model.invoke(\n * \"Draw a beautiful sunset over mountains\",\n * {\n * tools: [tools.imageGeneration({\n * size: \"1536x1024\", // Landscape format\n * quality: \"high\", // Higher quality output\n * outputFormat: \"jpeg\", // JPEG format\n * outputCompression: 90, // 90% compression\n * })]\n * }\n * );\n *\n * // With transparent background\n * const response = await model.invoke(\n * \"Create a logo with a transparent background\",\n * {\n * tools: [tools.imageGeneration({\n * background: \"transparent\",\n * outputFormat: \"png\",\n * })]\n * }\n * );\n *\n * // Force the model to use image generation\n * const response = await model.invoke(\n * \"A serene lake at dawn\",\n * {\n * tools: [tools.imageGeneration()],\n * tool_choice: { type: \"image_generation\" },\n * }\n * );\n *\n * // Enable streaming with partial images\n * const response = await model.invoke(\n * \"Draw a detailed fantasy castle\",\n * {\n * tools: [tools.imageGeneration({\n * partialImages: 2, // Get 2 partial images during generation\n * })]\n * }\n * );\n * ```\n *\n * @remarks\n * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3\n * - The image generation process always uses `gpt-image-1` model internally\n * - The model will automatically revise prompts for improved performance\n * - Access the revised prompt via `revised_prompt` field in the output\n * - Multi-turn editing is supported by passing previous response messages\n */\nexport function imageGeneration(options?: ImageGenerationOptions): ServerTool {\n return {\n type: \"image_generation\",\n action: options?.action,\n background: options?.background,\n input_fidelity: options?.inputFidelity,\n input_image_mask: convertInputImageMask(options?.inputImageMask),\n model: options?.model,\n moderation: options?.moderation,\n output_compression: options?.outputCompression,\n output_format: options?.outputFormat,\n partial_images: options?.partialImages,\n quality: options?.quality,\n size: options?.size,\n } satisfies ImageGenerationTool;\n}\n"],"mappings":";;;;AAwHA,SAAS,sBACP,MACyC;AACzC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO;EACL,WAAW,KAAK;EAChB,SAAS,KAAK;EACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGH,SAAgB,gBAAgB,SAA8C;AAC5E,QAAO;EACL,MAAM;EACN,QAAQ,SAAS;EACjB,YAAY,SAAS;EACrB,gBAAgB,SAAS;EACzB,kBAAkB,sBAAsB,SAAS,eAAe;EAChE,OAAO,SAAS;EAChB,YAAY,SAAS;EACrB,oBAAoB,SAAS;EAC7B,eAAe,SAAS;EACxB,gBAAgB,SAAS;EACzB,SAAS,SAAS;EAClB,MAAM,SAAS;EAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["export * from \"./dalle.js\";\n\nimport { webSearch } from \"./webSearch.js\";\nexport type {\n WebSearchTool,\n WebSearchFilters,\n WebSearchOptions,\n} from \"./webSearch.js\";\n\nimport { mcp } from \"./mcp.js\";\nexport type {\n McpTool,\n McpConnectorId,\n McpToolFilter,\n McpApprovalFilter,\n McpRemoteServerOptions,\n McpConnectorOptions,\n} from \"./mcp.js\";\n\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type {\n CodeInterpreterTool,\n CodeInterpreterOptions,\n CodeInterpreterAutoContainer,\n CodeInterpreterMemoryLimit,\n} from \"./codeInterpreter.js\";\n\nimport { fileSearch } from \"./fileSearch.js\";\nexport type {\n FileSearchTool,\n FileSearchOptions,\n FileSearchFilter,\n FileSearchComparisonFilter,\n FileSearchCompoundFilter,\n FileSearchComparisonType,\n FileSearchRankingOptions,\n FileSearchHybridSearchWeights,\n} from \"./fileSearch.js\";\n\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type {\n ImageGenerationTool,\n ImageGenerationOptions,\n ImageGenerationInputMask,\n} from \"./imageGeneration.js\";\n\nimport { computerUse } from \"./computerUse.js\";\nexport type {\n ComputerUseTool,\n ComputerUseInput,\n ComputerUseOptions,\n ComputerUseEnvironment,\n ComputerUseAction,\n ComputerUseClickAction,\n ComputerUseDoubleClickAction,\n ComputerUseDragAction,\n ComputerUseKeypressAction,\n ComputerUseMoveAction,\n ComputerUseScreenshotAction,\n ComputerUseScrollAction,\n ComputerUseTypeAction,\n ComputerUseWaitAction,\n} from \"./computerUse.js\";\n\nimport { localShell } from \"./localShell.js\";\nexport type {\n LocalShellTool,\n LocalShellOptions,\n LocalShellAction,\n} from \"./localShell.js\";\n\nimport { shell } from \"./shell.js\";\nexport type {\n ShellTool,\n ShellOptions,\n ShellAction,\n ShellResult,\n ShellCommandOutput,\n ShellCallOutcome,\n} from \"./shell.js\";\n\nimport { applyPatch } from \"./applyPatch.js\";\nexport type {\n ApplyPatchTool,\n ApplyPatchOptions,\n ApplyPatchOperation,\n ApplyPatchCreateFileOperation,\n ApplyPatchUpdateFileOperation,\n ApplyPatchDeleteFileOperation,\n} from \"./applyPatch.js\";\n\nexport const tools = {\n webSearch,\n mcp,\n codeInterpreter,\n fileSearch,\n imageGeneration,\n computerUse,\n localShell,\n shell,\n applyPatch,\n};\n"],"mappings":";;;;;;;;;;;;AA2FA,MAAa,QAAQ;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["export * from \"./dalle.js\";\n\nimport { webSearch } from \"./webSearch.js\";\nexport type {\n WebSearchTool,\n WebSearchFilters,\n WebSearchOptions,\n} from \"./webSearch.js\";\n\nimport { mcp } from \"./mcp.js\";\nexport type {\n McpTool,\n McpConnectorId,\n McpToolFilter,\n McpApprovalFilter,\n McpRemoteServerOptions,\n McpConnectorOptions,\n} from \"./mcp.js\";\n\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type {\n CodeInterpreterTool,\n CodeInterpreterOptions,\n CodeInterpreterAutoContainer,\n CodeInterpreterMemoryLimit,\n} from \"./codeInterpreter.js\";\n\nimport { fileSearch } from \"./fileSearch.js\";\nexport type {\n FileSearchTool,\n FileSearchOptions,\n FileSearchFilter,\n FileSearchComparisonFilter,\n FileSearchCompoundFilter,\n FileSearchComparisonType,\n FileSearchRankingOptions,\n FileSearchHybridSearchWeights,\n} from \"./fileSearch.js\";\n\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type {\n ImageGenerationTool,\n ImageGenerationOptions,\n ImageGenerationInputMask,\n} from \"./imageGeneration.js\";\n\nimport { computerUse } from \"./computerUse.js\";\nexport type {\n ComputerUseTool,\n ComputerUseInput,\n ComputerUseOptions,\n ComputerUseEnvironment,\n ComputerUseAction,\n ComputerUseClickAction,\n ComputerUseDoubleClickAction,\n ComputerUseDragAction,\n ComputerUseKeypressAction,\n ComputerUseMoveAction,\n ComputerUseScreenshotAction,\n ComputerUseScrollAction,\n ComputerUseTypeAction,\n ComputerUseWaitAction,\n} from \"./computerUse.js\";\n\nimport { localShell } from \"./localShell.js\";\nexport type {\n LocalShellTool,\n LocalShellOptions,\n LocalShellAction,\n} from \"./localShell.js\";\n\nimport { shell } from \"./shell.js\";\nexport type {\n ShellTool,\n ShellOptions,\n ShellAction,\n ShellResult,\n ShellCommandOutput,\n ShellCallOutcome,\n} from \"./shell.js\";\n\nimport { applyPatch } from \"./applyPatch.js\";\nexport type {\n ApplyPatchTool,\n ApplyPatchOptions,\n ApplyPatchOperation,\n ApplyPatchCreateFileOperation,\n ApplyPatchUpdateFileOperation,\n ApplyPatchDeleteFileOperation,\n} from \"./applyPatch.js\";\n\nexport const tools = {\n webSearch,\n mcp,\n codeInterpreter,\n fileSearch,\n imageGeneration,\n computerUse,\n localShell,\n shell,\n applyPatch,\n};\n"],"mappings":";;;;;;;;;;;;AA2FA,MAAa,QAAQ;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -10,7 +10,6 @@ import { ShellAction, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellR
10
10
  import { ApplyPatchCreateFileOperation, ApplyPatchDeleteFileOperation, ApplyPatchOperation, ApplyPatchOptions, ApplyPatchTool, ApplyPatchUpdateFileOperation, applyPatch } from "./applyPatch.cjs";
11
11
 
12
12
  //#region src/tools/index.d.ts
13
-
14
13
  declare const tools: {
15
14
  webSearch: typeof webSearch;
16
15
  mcp: typeof mcp;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["webSearch","WebSearchTool","WebSearchFilters","WebSearchOptions","mcp","McpTool","McpConnectorId","McpToolFilter","McpApprovalFilter","McpRemoteServerOptions","McpConnectorOptions","codeInterpreter","CodeInterpreterTool","CodeInterpreterOptions","CodeInterpreterAutoContainer","CodeInterpreterMemoryLimit","fileSearch","FileSearchTool","FileSearchOptions","FileSearchFilter","FileSearchComparisonFilter","FileSearchCompoundFilter","FileSearchComparisonType","FileSearchRankingOptions","FileSearchHybridSearchWeights","imageGeneration","ImageGenerationTool","ImageGenerationOptions","ImageGenerationInputMask","computerUse","ComputerUseTool","ComputerUseInput","ComputerUseOptions","ComputerUseEnvironment","ComputerUseAction","ComputerUseClickAction","ComputerUseDoubleClickAction","ComputerUseDragAction","ComputerUseKeypressAction","ComputerUseMoveAction","ComputerUseScreenshotAction","ComputerUseScrollAction","ComputerUseTypeAction","ComputerUseWaitAction","localShell","LocalShellTool","LocalShellOptions","LocalShellAction","shell","ShellTool","ShellOptions","ShellAction","ShellResult","ShellCommandOutput","ShellCallOutcome","applyPatch","ApplyPatchTool","ApplyPatchOptions","ApplyPatchOperation","ApplyPatchCreateFileOperation","ApplyPatchUpdateFileOperation","ApplyPatchDeleteFileOperation","tools"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["export * from \"./dalle.js\";\nimport { webSearch } from \"./webSearch.js\";\nexport type { WebSearchTool, WebSearchFilters, WebSearchOptions, } from \"./webSearch.js\";\nimport { mcp } from \"./mcp.js\";\nexport type { McpTool, McpConnectorId, McpToolFilter, McpApprovalFilter, McpRemoteServerOptions, McpConnectorOptions, } from \"./mcp.js\";\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type { CodeInterpreterTool, CodeInterpreterOptions, CodeInterpreterAutoContainer, CodeInterpreterMemoryLimit, } from \"./codeInterpreter.js\";\nimport { fileSearch } from \"./fileSearch.js\";\nexport type { FileSearchTool, FileSearchOptions, FileSearchFilter, FileSearchComparisonFilter, FileSearchCompoundFilter, FileSearchComparisonType, FileSearchRankingOptions, FileSearchHybridSearchWeights, } from \"./fileSearch.js\";\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type { ImageGenerationTool, ImageGenerationOptions, ImageGenerationInputMask, } from \"./imageGeneration.js\";\nimport { computerUse } from \"./computerUse.js\";\nexport type { ComputerUseTool, ComputerUseInput, ComputerUseOptions, ComputerUseEnvironment, ComputerUseAction, ComputerUseClickAction, ComputerUseDoubleClickAction, ComputerUseDragAction, ComputerUseKeypressAction, ComputerUseMoveAction, ComputerUseScreenshotAction, ComputerUseScrollAction, ComputerUseTypeAction, ComputerUseWaitAction, } from \"./computerUse.js\";\nimport { localShell } from \"./localShell.js\";\nexport type { LocalShellTool, LocalShellOptions, LocalShellAction, } from \"./localShell.js\";\nimport { shell } from \"./shell.js\";\nexport type { ShellTool, ShellOptions, ShellAction, ShellResult, ShellCommandOutput, ShellCallOutcome, } from \"./shell.js\";\nimport { applyPatch } from \"./applyPatch.js\";\nexport type { ApplyPatchTool, ApplyPatchOptions, ApplyPatchOperation, ApplyPatchCreateFileOperation, ApplyPatchUpdateFileOperation, ApplyPatchDeleteFileOperation, } from \"./applyPatch.js\";\nexport declare const tools: {\n webSearch: typeof webSearch;\n mcp: typeof mcp;\n codeInterpreter: typeof codeInterpreter;\n fileSearch: typeof fileSearch;\n imageGeneration: typeof imageGeneration;\n computerUse: typeof computerUse;\n localShell: typeof localShell;\n shell: typeof shell;\n applyPatch: typeof applyPatch;\n};\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;AA0BuB4C,cAPFkB,KAOElB,EAAAA;EACLI,SAAAA,EAAAA,OAPIhD,SAOJgD;EACKO,GAAAA,EAAAA,OAPPnD,GAOOmD;EAAU,eAAA,EAAA,OANL5C,eAMK;qBALVK;0BACKS;sBACJI;qBACDe;gBACLI;qBACKO"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;cA2Fa,KAAA"}
@@ -10,7 +10,6 @@ import { ShellAction, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellR
10
10
  import { ApplyPatchCreateFileOperation, ApplyPatchDeleteFileOperation, ApplyPatchOperation, ApplyPatchOptions, ApplyPatchTool, ApplyPatchUpdateFileOperation, applyPatch } from "./applyPatch.js";
11
11
 
12
12
  //#region src/tools/index.d.ts
13
-
14
13
  declare const tools: {
15
14
  webSearch: typeof webSearch;
16
15
  mcp: typeof mcp;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["webSearch","WebSearchTool","WebSearchFilters","WebSearchOptions","mcp","McpTool","McpConnectorId","McpToolFilter","McpApprovalFilter","McpRemoteServerOptions","McpConnectorOptions","codeInterpreter","CodeInterpreterTool","CodeInterpreterOptions","CodeInterpreterAutoContainer","CodeInterpreterMemoryLimit","fileSearch","FileSearchTool","FileSearchOptions","FileSearchFilter","FileSearchComparisonFilter","FileSearchCompoundFilter","FileSearchComparisonType","FileSearchRankingOptions","FileSearchHybridSearchWeights","imageGeneration","ImageGenerationTool","ImageGenerationOptions","ImageGenerationInputMask","computerUse","ComputerUseTool","ComputerUseInput","ComputerUseOptions","ComputerUseEnvironment","ComputerUseAction","ComputerUseClickAction","ComputerUseDoubleClickAction","ComputerUseDragAction","ComputerUseKeypressAction","ComputerUseMoveAction","ComputerUseScreenshotAction","ComputerUseScrollAction","ComputerUseTypeAction","ComputerUseWaitAction","localShell","LocalShellTool","LocalShellOptions","LocalShellAction","shell","ShellTool","ShellOptions","ShellAction","ShellResult","ShellCommandOutput","ShellCallOutcome","applyPatch","ApplyPatchTool","ApplyPatchOptions","ApplyPatchOperation","ApplyPatchCreateFileOperation","ApplyPatchUpdateFileOperation","ApplyPatchDeleteFileOperation","tools"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["export * from \"./dalle.js\";\nimport { webSearch } from \"./webSearch.js\";\nexport type { WebSearchTool, WebSearchFilters, WebSearchOptions, } from \"./webSearch.js\";\nimport { mcp } from \"./mcp.js\";\nexport type { McpTool, McpConnectorId, McpToolFilter, McpApprovalFilter, McpRemoteServerOptions, McpConnectorOptions, } from \"./mcp.js\";\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type { CodeInterpreterTool, CodeInterpreterOptions, CodeInterpreterAutoContainer, CodeInterpreterMemoryLimit, } from \"./codeInterpreter.js\";\nimport { fileSearch } from \"./fileSearch.js\";\nexport type { FileSearchTool, FileSearchOptions, FileSearchFilter, FileSearchComparisonFilter, FileSearchCompoundFilter, FileSearchComparisonType, FileSearchRankingOptions, FileSearchHybridSearchWeights, } from \"./fileSearch.js\";\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type { ImageGenerationTool, ImageGenerationOptions, ImageGenerationInputMask, } from \"./imageGeneration.js\";\nimport { computerUse } from \"./computerUse.js\";\nexport type { ComputerUseTool, ComputerUseInput, ComputerUseOptions, ComputerUseEnvironment, ComputerUseAction, ComputerUseClickAction, ComputerUseDoubleClickAction, ComputerUseDragAction, ComputerUseKeypressAction, ComputerUseMoveAction, ComputerUseScreenshotAction, ComputerUseScrollAction, ComputerUseTypeAction, ComputerUseWaitAction, } from \"./computerUse.js\";\nimport { localShell } from \"./localShell.js\";\nexport type { LocalShellTool, LocalShellOptions, LocalShellAction, } from \"./localShell.js\";\nimport { shell } from \"./shell.js\";\nexport type { ShellTool, ShellOptions, ShellAction, ShellResult, ShellCommandOutput, ShellCallOutcome, } from \"./shell.js\";\nimport { applyPatch } from \"./applyPatch.js\";\nexport type { ApplyPatchTool, ApplyPatchOptions, ApplyPatchOperation, ApplyPatchCreateFileOperation, ApplyPatchUpdateFileOperation, ApplyPatchDeleteFileOperation, } from \"./applyPatch.js\";\nexport declare const tools: {\n webSearch: typeof webSearch;\n mcp: typeof mcp;\n codeInterpreter: typeof codeInterpreter;\n fileSearch: typeof fileSearch;\n imageGeneration: typeof imageGeneration;\n computerUse: typeof computerUse;\n localShell: typeof localShell;\n shell: typeof shell;\n applyPatch: typeof applyPatch;\n};\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;AA0BuB4C,cAPFkB,KAOElB,EAAAA;EACLI,SAAAA,EAAAA,OAPIhD,SAOJgD;EACKO,GAAAA,EAAAA,OAPPnD,GAOOmD;EAAU,eAAA,EAAA,OANL5C,eAMK;qBALVK;0BACKS;sBACJI;qBACDe;gBACLI;qBACKO"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;;;;;;cA2Fa,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["export * from \"./dalle.js\";\n\nimport { webSearch } from \"./webSearch.js\";\nexport type {\n WebSearchTool,\n WebSearchFilters,\n WebSearchOptions,\n} from \"./webSearch.js\";\n\nimport { mcp } from \"./mcp.js\";\nexport type {\n McpTool,\n McpConnectorId,\n McpToolFilter,\n McpApprovalFilter,\n McpRemoteServerOptions,\n McpConnectorOptions,\n} from \"./mcp.js\";\n\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type {\n CodeInterpreterTool,\n CodeInterpreterOptions,\n CodeInterpreterAutoContainer,\n CodeInterpreterMemoryLimit,\n} from \"./codeInterpreter.js\";\n\nimport { fileSearch } from \"./fileSearch.js\";\nexport type {\n FileSearchTool,\n FileSearchOptions,\n FileSearchFilter,\n FileSearchComparisonFilter,\n FileSearchCompoundFilter,\n FileSearchComparisonType,\n FileSearchRankingOptions,\n FileSearchHybridSearchWeights,\n} from \"./fileSearch.js\";\n\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type {\n ImageGenerationTool,\n ImageGenerationOptions,\n ImageGenerationInputMask,\n} from \"./imageGeneration.js\";\n\nimport { computerUse } from \"./computerUse.js\";\nexport type {\n ComputerUseTool,\n ComputerUseInput,\n ComputerUseOptions,\n ComputerUseEnvironment,\n ComputerUseAction,\n ComputerUseClickAction,\n ComputerUseDoubleClickAction,\n ComputerUseDragAction,\n ComputerUseKeypressAction,\n ComputerUseMoveAction,\n ComputerUseScreenshotAction,\n ComputerUseScrollAction,\n ComputerUseTypeAction,\n ComputerUseWaitAction,\n} from \"./computerUse.js\";\n\nimport { localShell } from \"./localShell.js\";\nexport type {\n LocalShellTool,\n LocalShellOptions,\n LocalShellAction,\n} from \"./localShell.js\";\n\nimport { shell } from \"./shell.js\";\nexport type {\n ShellTool,\n ShellOptions,\n ShellAction,\n ShellResult,\n ShellCommandOutput,\n ShellCallOutcome,\n} from \"./shell.js\";\n\nimport { applyPatch } from \"./applyPatch.js\";\nexport type {\n ApplyPatchTool,\n ApplyPatchOptions,\n ApplyPatchOperation,\n ApplyPatchCreateFileOperation,\n ApplyPatchUpdateFileOperation,\n ApplyPatchDeleteFileOperation,\n} from \"./applyPatch.js\";\n\nexport const tools = {\n webSearch,\n mcp,\n codeInterpreter,\n fileSearch,\n imageGeneration,\n computerUse,\n localShell,\n shell,\n applyPatch,\n};\n"],"mappings":";;;;;;;;;;;;AA2FA,MAAa,QAAQ;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["export * from \"./dalle.js\";\n\nimport { webSearch } from \"./webSearch.js\";\nexport type {\n WebSearchTool,\n WebSearchFilters,\n WebSearchOptions,\n} from \"./webSearch.js\";\n\nimport { mcp } from \"./mcp.js\";\nexport type {\n McpTool,\n McpConnectorId,\n McpToolFilter,\n McpApprovalFilter,\n McpRemoteServerOptions,\n McpConnectorOptions,\n} from \"./mcp.js\";\n\nimport { codeInterpreter } from \"./codeInterpreter.js\";\nexport type {\n CodeInterpreterTool,\n CodeInterpreterOptions,\n CodeInterpreterAutoContainer,\n CodeInterpreterMemoryLimit,\n} from \"./codeInterpreter.js\";\n\nimport { fileSearch } from \"./fileSearch.js\";\nexport type {\n FileSearchTool,\n FileSearchOptions,\n FileSearchFilter,\n FileSearchComparisonFilter,\n FileSearchCompoundFilter,\n FileSearchComparisonType,\n FileSearchRankingOptions,\n FileSearchHybridSearchWeights,\n} from \"./fileSearch.js\";\n\nimport { imageGeneration } from \"./imageGeneration.js\";\nexport type {\n ImageGenerationTool,\n ImageGenerationOptions,\n ImageGenerationInputMask,\n} from \"./imageGeneration.js\";\n\nimport { computerUse } from \"./computerUse.js\";\nexport type {\n ComputerUseTool,\n ComputerUseInput,\n ComputerUseOptions,\n ComputerUseEnvironment,\n ComputerUseAction,\n ComputerUseClickAction,\n ComputerUseDoubleClickAction,\n ComputerUseDragAction,\n ComputerUseKeypressAction,\n ComputerUseMoveAction,\n ComputerUseScreenshotAction,\n ComputerUseScrollAction,\n ComputerUseTypeAction,\n ComputerUseWaitAction,\n} from \"./computerUse.js\";\n\nimport { localShell } from \"./localShell.js\";\nexport type {\n LocalShellTool,\n LocalShellOptions,\n LocalShellAction,\n} from \"./localShell.js\";\n\nimport { shell } from \"./shell.js\";\nexport type {\n ShellTool,\n ShellOptions,\n ShellAction,\n ShellResult,\n ShellCommandOutput,\n ShellCallOutcome,\n} from \"./shell.js\";\n\nimport { applyPatch } from \"./applyPatch.js\";\nexport type {\n ApplyPatchTool,\n ApplyPatchOptions,\n ApplyPatchOperation,\n ApplyPatchCreateFileOperation,\n ApplyPatchUpdateFileOperation,\n ApplyPatchDeleteFileOperation,\n} from \"./applyPatch.js\";\n\nexport const tools = {\n webSearch,\n mcp,\n codeInterpreter,\n fileSearch,\n imageGeneration,\n computerUse,\n localShell,\n shell,\n applyPatch,\n};\n"],"mappings":";;;;;;;;;;;;AA2FA,MAAa,QAAQ;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1,6 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const __langchain_core_tools = require_rolldown_runtime.__toESM(require("@langchain/core/tools"));
3
- const zod_v4 = require_rolldown_runtime.__toESM(require("zod/v4"));
1
+ let _langchain_core_tools = require("@langchain/core/tools");
2
+ let zod_v4 = require("zod/v4");
4
3
 
5
4
  //#region src/tools/localShell.ts
6
5
  const LocalShellExecActionSchema = zod_v4.z.object({
@@ -128,7 +127,7 @@ const TOOL_NAME = "local_shell";
128
127
  * - The `timeout_ms` from the model is only a hint—enforce your own limits
129
128
  */
130
129
  function localShell(options) {
131
- const shellTool = (0, __langchain_core_tools.tool)(options.execute, {
130
+ const shellTool = (0, _langchain_core_tools.tool)(options.execute, {
132
131
  name: TOOL_NAME,
133
132
  description: "Execute shell commands locally on the machine. Commands are provided as argv tokens.",
134
133
  schema: LocalShellActionSchema
@@ -1 +1 @@
1
- {"version":3,"file":"localShell.cjs","names":["z","options: LocalShellOptions"],"sources":["../../src/tools/localShell.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport { OpenAI as OpenAIClient } from \"openai\";\nimport { tool, type DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * Re-export action type from OpenAI SDK for convenience.\n * The action contains command details like argv tokens, environment variables,\n * working directory, timeout, and user.\n */\nexport type LocalShellAction =\n OpenAIClient.Responses.ResponseOutputItem.LocalShellCall.Action;\n\n// Zod schema for local shell exec action\nexport const LocalShellExecActionSchema = z.object({\n type: z.literal(\"exec\"),\n command: z.array(z.string()),\n env: z.record(z.string(), z.string()).optional(),\n working_directory: z.string().optional(),\n timeout_ms: z.number().optional(),\n user: z.string().optional(),\n});\n\n// Schema for all local shell actions (currently only exec)\nexport const LocalShellActionSchema = z.union([LocalShellExecActionSchema]);\n\n/**\n * Options for the Local Shell tool.\n */\nexport interface LocalShellOptions {\n /**\n * Optional execute function that handles shell command execution.\n * This function receives the action input and should return the command output\n * (stdout + stderr combined).\n *\n * If not provided, you'll need to handle action execution manually by\n * checking `local_shell_call` outputs in the response.\n *\n * @example\n * ```typescript\n * execute: async (action) => {\n * const result = await exec(action.command.join(' '), {\n * cwd: action.working_directory,\n * env: { ...process.env, ...action.env },\n * timeout: action.timeout_ms,\n * });\n * return result.stdout + result.stderr;\n * }\n * ```\n */\n execute: (action: LocalShellAction) => string | Promise<string>;\n}\n\n/**\n * OpenAI Local Shell tool type for the Responses API.\n */\nexport type LocalShellTool = OpenAIClient.Responses.Tool.LocalShell;\n\nconst TOOL_NAME = \"local_shell\";\n\n/**\n * Creates a Local Shell tool that allows models to run shell commands locally\n * on a machine you provide. Commands are executed inside your own runtime—\n * the API only returns the instructions, but does not execute them on OpenAI infrastructure.\n *\n * **Important**: The local shell tool is designed to work with\n * [Codex CLI](https://github.com/openai/codex) and the `codex-mini-latest` model.\n *\n * **How it works**:\n * The tool operates in a continuous loop:\n * 1. Model sends shell commands (`local_shell_call` with `exec` action)\n * 2. Your code executes the command locally\n * 3. You return the output back to the model\n * 4. Repeat until the task is complete\n *\n * **Security Warning**: Running arbitrary shell commands can be dangerous.\n * Always sandbox execution or add strict allow/deny-lists before forwarding\n * a command to the system shell.\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-local-shell | OpenAI Local Shell Documentation}\n *\n * @param options - Optional configuration for the Local Shell tool\n * @returns A Local Shell tool that can be passed to `bindTools`\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n * import { exec } from \"child_process\";\n * import { promisify } from \"util\";\n *\n * const execAsync = promisify(exec);\n * const model = new ChatOpenAI({ model: \"codex-mini-latest\" });\n *\n * // With execute callback for automatic command handling\n * const shell = tools.localShell({\n * execute: async (action) => {\n * const { command, env, working_directory, timeout_ms } = action;\n * const result = await execAsync(command.join(' '), {\n * cwd: working_directory ?? process.cwd(),\n * env: { ...process.env, ...env },\n * timeout: timeout_ms ?? undefined,\n * });\n * return result.stdout + result.stderr;\n * },\n * });\n *\n * const llmWithShell = model.bindTools([shell]);\n * const response = await llmWithShell.invoke(\n * \"List files in the current directory\"\n * );\n * ```\n *\n * @example\n * ```typescript\n * // Without execute callback (manual handling)\n * const shell = tools.localShell();\n *\n * const response = await model.invoke(\"List files\", {\n * tools: [shell],\n * });\n *\n * // Access the shell call from the response\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n * if (shellCall) {\n * console.log(\"Command to execute:\", shellCall.action.command);\n * // Execute the command manually, then send back the output\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Full shell loop example\n * async function shellLoop(model, task) {\n * let response = await model.invoke(task, {\n * tools: [tools.localShell()],\n * });\n *\n * while (true) {\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n *\n * if (!shellCall) break;\n *\n * // Execute command (with proper sandboxing!)\n * const output = await executeCommand(shellCall.action);\n *\n * // Send output back to model\n * response = await model.invoke([\n * response,\n * {\n * type: \"local_shell_call_output\",\n * id: shellCall.call_id,\n * output: output,\n * },\n * ], {\n * tools: [tools.localShell()],\n * });\n * }\n *\n * return response;\n * }\n * ```\n *\n * @remarks\n * - Only available through the Responses API (not Chat Completions)\n * - Designed for use with `codex-mini-latest` model\n * - Commands are provided as argv tokens in `action.command`\n * - Action includes: `command`, `env`, `working_directory`, `timeout_ms`, `user`\n * - Always sandbox or validate commands before execution\n * - The `timeout_ms` from the model is only a hint—enforce your own limits\n */\nexport function localShell(options: LocalShellOptions) {\n const shellTool = tool(options.execute, {\n name: TOOL_NAME,\n description:\n \"Execute shell commands locally on the machine. Commands are provided as argv tokens.\",\n schema: LocalShellActionSchema,\n });\n\n shellTool.extras = {\n ...(shellTool.extras ?? {}),\n providerToolDefinition: {\n type: \"local_shell\",\n } satisfies LocalShellTool,\n };\n\n return shellTool as DynamicStructuredTool<\n typeof LocalShellActionSchema,\n LocalShellAction,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;;AAaA,MAAa,6BAA6BA,SAAE,OAAO;CACjD,MAAMA,SAAE,QAAQ,OAAO;CACvB,SAASA,SAAE,MAAMA,SAAE,QAAQ,CAAC;CAC5B,KAAKA,SAAE,OAAOA,SAAE,QAAQ,EAAEA,SAAE,QAAQ,CAAC,CAAC,UAAU;CAChD,mBAAmBA,SAAE,QAAQ,CAAC,UAAU;CACxC,YAAYA,SAAE,QAAQ,CAAC,UAAU;CACjC,MAAMA,SAAE,QAAQ,CAAC,UAAU;AAC5B,EAAC;AAGF,MAAa,yBAAyBA,SAAE,MAAM,CAAC,0BAA2B,EAAC;AAkC3E,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHlB,SAAgB,WAAWC,SAA4B;CACrD,MAAM,6CAAiB,QAAQ,SAAS;EACtC,MAAM;EACN,aACE;EACF,QAAQ;CACT,EAAC;CAEF,UAAU,SAAS;EACjB,GAAI,UAAU,UAAU,CAAE;EAC1B,wBAAwB,EACtB,MAAM,cACP;CACF;AAED,QAAO;AAMR"}
1
+ {"version":3,"file":"localShell.cjs","names":["z"],"sources":["../../src/tools/localShell.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport { OpenAI as OpenAIClient } from \"openai\";\nimport { tool, type DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * Re-export action type from OpenAI SDK for convenience.\n * The action contains command details like argv tokens, environment variables,\n * working directory, timeout, and user.\n */\nexport type LocalShellAction =\n OpenAIClient.Responses.ResponseOutputItem.LocalShellCall.Action;\n\n// Zod schema for local shell exec action\nexport const LocalShellExecActionSchema = z.object({\n type: z.literal(\"exec\"),\n command: z.array(z.string()),\n env: z.record(z.string(), z.string()).optional(),\n working_directory: z.string().optional(),\n timeout_ms: z.number().optional(),\n user: z.string().optional(),\n});\n\n// Schema for all local shell actions (currently only exec)\nexport const LocalShellActionSchema = z.union([LocalShellExecActionSchema]);\n\n/**\n * Options for the Local Shell tool.\n */\nexport interface LocalShellOptions {\n /**\n * Optional execute function that handles shell command execution.\n * This function receives the action input and should return the command output\n * (stdout + stderr combined).\n *\n * If not provided, you'll need to handle action execution manually by\n * checking `local_shell_call` outputs in the response.\n *\n * @example\n * ```typescript\n * execute: async (action) => {\n * const result = await exec(action.command.join(' '), {\n * cwd: action.working_directory,\n * env: { ...process.env, ...action.env },\n * timeout: action.timeout_ms,\n * });\n * return result.stdout + result.stderr;\n * }\n * ```\n */\n execute: (action: LocalShellAction) => string | Promise<string>;\n}\n\n/**\n * OpenAI Local Shell tool type for the Responses API.\n */\nexport type LocalShellTool = OpenAIClient.Responses.Tool.LocalShell;\n\nconst TOOL_NAME = \"local_shell\";\n\n/**\n * Creates a Local Shell tool that allows models to run shell commands locally\n * on a machine you provide. Commands are executed inside your own runtime—\n * the API only returns the instructions, but does not execute them on OpenAI infrastructure.\n *\n * **Important**: The local shell tool is designed to work with\n * [Codex CLI](https://github.com/openai/codex) and the `codex-mini-latest` model.\n *\n * **How it works**:\n * The tool operates in a continuous loop:\n * 1. Model sends shell commands (`local_shell_call` with `exec` action)\n * 2. Your code executes the command locally\n * 3. You return the output back to the model\n * 4. Repeat until the task is complete\n *\n * **Security Warning**: Running arbitrary shell commands can be dangerous.\n * Always sandbox execution or add strict allow/deny-lists before forwarding\n * a command to the system shell.\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-local-shell | OpenAI Local Shell Documentation}\n *\n * @param options - Optional configuration for the Local Shell tool\n * @returns A Local Shell tool that can be passed to `bindTools`\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n * import { exec } from \"child_process\";\n * import { promisify } from \"util\";\n *\n * const execAsync = promisify(exec);\n * const model = new ChatOpenAI({ model: \"codex-mini-latest\" });\n *\n * // With execute callback for automatic command handling\n * const shell = tools.localShell({\n * execute: async (action) => {\n * const { command, env, working_directory, timeout_ms } = action;\n * const result = await execAsync(command.join(' '), {\n * cwd: working_directory ?? process.cwd(),\n * env: { ...process.env, ...env },\n * timeout: timeout_ms ?? undefined,\n * });\n * return result.stdout + result.stderr;\n * },\n * });\n *\n * const llmWithShell = model.bindTools([shell]);\n * const response = await llmWithShell.invoke(\n * \"List files in the current directory\"\n * );\n * ```\n *\n * @example\n * ```typescript\n * // Without execute callback (manual handling)\n * const shell = tools.localShell();\n *\n * const response = await model.invoke(\"List files\", {\n * tools: [shell],\n * });\n *\n * // Access the shell call from the response\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n * if (shellCall) {\n * console.log(\"Command to execute:\", shellCall.action.command);\n * // Execute the command manually, then send back the output\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Full shell loop example\n * async function shellLoop(model, task) {\n * let response = await model.invoke(task, {\n * tools: [tools.localShell()],\n * });\n *\n * while (true) {\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n *\n * if (!shellCall) break;\n *\n * // Execute command (with proper sandboxing!)\n * const output = await executeCommand(shellCall.action);\n *\n * // Send output back to model\n * response = await model.invoke([\n * response,\n * {\n * type: \"local_shell_call_output\",\n * id: shellCall.call_id,\n * output: output,\n * },\n * ], {\n * tools: [tools.localShell()],\n * });\n * }\n *\n * return response;\n * }\n * ```\n *\n * @remarks\n * - Only available through the Responses API (not Chat Completions)\n * - Designed for use with `codex-mini-latest` model\n * - Commands are provided as argv tokens in `action.command`\n * - Action includes: `command`, `env`, `working_directory`, `timeout_ms`, `user`\n * - Always sandbox or validate commands before execution\n * - The `timeout_ms` from the model is only a hint—enforce your own limits\n */\nexport function localShell(options: LocalShellOptions) {\n const shellTool = tool(options.execute, {\n name: TOOL_NAME,\n description:\n \"Execute shell commands locally on the machine. Commands are provided as argv tokens.\",\n schema: LocalShellActionSchema,\n });\n\n shellTool.extras = {\n ...(shellTool.extras ?? {}),\n providerToolDefinition: {\n type: \"local_shell\",\n } satisfies LocalShellTool,\n };\n\n return shellTool as DynamicStructuredTool<\n typeof LocalShellActionSchema,\n LocalShellAction,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;AAaA,MAAa,6BAA6BA,SAAE,OAAO;CACjD,MAAMA,SAAE,QAAQ,OAAO;CACvB,SAASA,SAAE,MAAMA,SAAE,QAAQ,CAAC;CAC5B,KAAKA,SAAE,OAAOA,SAAE,QAAQ,EAAEA,SAAE,QAAQ,CAAC,CAAC,UAAU;CAChD,mBAAmBA,SAAE,QAAQ,CAAC,UAAU;CACxC,YAAYA,SAAE,QAAQ,CAAC,UAAU;CACjC,MAAMA,SAAE,QAAQ,CAAC,UAAU;CAC5B,CAAC;AAGF,MAAa,yBAAyBA,SAAE,MAAM,CAAC,2BAA2B,CAAC;AAkC3E,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHlB,SAAgB,WAAW,SAA4B;CACrD,MAAM,4CAAiB,QAAQ,SAAS;EACtC,MAAM;EACN,aACE;EACF,QAAQ;EACT,CAAC;AAEF,WAAU,SAAS;EACjB,GAAI,UAAU,UAAU,EAAE;EAC1B,wBAAwB,EACtB,MAAM,eACP;EACF;AAED,QAAO"}
@@ -3,7 +3,6 @@ import { DynamicStructuredTool } from "@langchain/core/tools";
3
3
  import { z } from "zod/v4";
4
4
 
5
5
  //#region src/tools/localShell.d.ts
6
-
7
6
  /**
8
7
  * Re-export action type from OpenAI SDK for convenience.
9
8
  * The action contains command details like argv tokens, environment variables,
@@ -1 +1 @@
1
- {"version":3,"file":"localShell.d.cts","names":["z","OpenAI","OpenAIClient","DynamicStructuredTool","LocalShellAction","Responses","ResponseOutputItem","LocalShellCall","Action","LocalShellExecActionSchema","ZodLiteral","ZodString","ZodArray","ZodRecord","ZodOptional","ZodNumber","core","$strip","ZodObject","LocalShellActionSchema","ZodUnion","LocalShellOptions","Promise","LocalShellTool","Tool","LocalShell","localShell"],"sources":["../../src/tools/localShell.d.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport { OpenAI as OpenAIClient } from \"openai\";\nimport { type DynamicStructuredTool } from \"@langchain/core/tools\";\n/**\n * Re-export action type from OpenAI SDK for convenience.\n * The action contains command details like argv tokens, environment variables,\n * working directory, timeout, and user.\n */\nexport type LocalShellAction = OpenAIClient.Responses.ResponseOutputItem.LocalShellCall.Action;\nexport declare const LocalShellExecActionSchema: z.ZodObject<{\n type: z.ZodLiteral<\"exec\">;\n command: z.ZodArray<z.ZodString>;\n env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;\n working_directory: z.ZodOptional<z.ZodString>;\n timeout_ms: z.ZodOptional<z.ZodNumber>;\n user: z.ZodOptional<z.ZodString>;\n}, z.core.$strip>;\nexport declare const LocalShellActionSchema: z.ZodUnion<readonly [z.ZodObject<{\n type: z.ZodLiteral<\"exec\">;\n command: z.ZodArray<z.ZodString>;\n env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;\n working_directory: z.ZodOptional<z.ZodString>;\n timeout_ms: z.ZodOptional<z.ZodNumber>;\n user: z.ZodOptional<z.ZodString>;\n}, z.core.$strip>]>;\n/**\n * Options for the Local Shell tool.\n */\nexport interface LocalShellOptions {\n /**\n * Optional execute function that handles shell command execution.\n * This function receives the action input and should return the command output\n * (stdout + stderr combined).\n *\n * If not provided, you'll need to handle action execution manually by\n * checking `local_shell_call` outputs in the response.\n *\n * @example\n * ```typescript\n * execute: async (action) => {\n * const result = await exec(action.command.join(' '), {\n * cwd: action.working_directory,\n * env: { ...process.env, ...action.env },\n * timeout: action.timeout_ms,\n * });\n * return result.stdout + result.stderr;\n * }\n * ```\n */\n execute: (action: LocalShellAction) => string | Promise<string>;\n}\n/**\n * OpenAI Local Shell tool type for the Responses API.\n */\nexport type LocalShellTool = OpenAIClient.Responses.Tool.LocalShell;\n/**\n * Creates a Local Shell tool that allows models to run shell commands locally\n * on a machine you provide. Commands are executed inside your own runtime—\n * the API only returns the instructions, but does not execute them on OpenAI infrastructure.\n *\n * **Important**: The local shell tool is designed to work with\n * [Codex CLI](https://github.com/openai/codex) and the `codex-mini-latest` model.\n *\n * **How it works**:\n * The tool operates in a continuous loop:\n * 1. Model sends shell commands (`local_shell_call` with `exec` action)\n * 2. Your code executes the command locally\n * 3. You return the output back to the model\n * 4. Repeat until the task is complete\n *\n * **Security Warning**: Running arbitrary shell commands can be dangerous.\n * Always sandbox execution or add strict allow/deny-lists before forwarding\n * a command to the system shell.\n *\n * @see {@link https://platform.openai.com/docs/guides/tools-local-shell | OpenAI Local Shell Documentation}\n *\n * @param options - Optional configuration for the Local Shell tool\n * @returns A Local Shell tool that can be passed to `bindTools`\n *\n * @example\n * ```typescript\n * import { ChatOpenAI, tools } from \"@langchain/openai\";\n * import { exec } from \"child_process\";\n * import { promisify } from \"util\";\n *\n * const execAsync = promisify(exec);\n * const model = new ChatOpenAI({ model: \"codex-mini-latest\" });\n *\n * // With execute callback for automatic command handling\n * const shell = tools.localShell({\n * execute: async (action) => {\n * const { command, env, working_directory, timeout_ms } = action;\n * const result = await execAsync(command.join(' '), {\n * cwd: working_directory ?? process.cwd(),\n * env: { ...process.env, ...env },\n * timeout: timeout_ms ?? undefined,\n * });\n * return result.stdout + result.stderr;\n * },\n * });\n *\n * const llmWithShell = model.bindTools([shell]);\n * const response = await llmWithShell.invoke(\n * \"List files in the current directory\"\n * );\n * ```\n *\n * @example\n * ```typescript\n * // Without execute callback (manual handling)\n * const shell = tools.localShell();\n *\n * const response = await model.invoke(\"List files\", {\n * tools: [shell],\n * });\n *\n * // Access the shell call from the response\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n * if (shellCall) {\n * console.log(\"Command to execute:\", shellCall.action.command);\n * // Execute the command manually, then send back the output\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Full shell loop example\n * async function shellLoop(model, task) {\n * let response = await model.invoke(task, {\n * tools: [tools.localShell()],\n * });\n *\n * while (true) {\n * const shellCall = response.additional_kwargs.tool_outputs?.find(\n * (output) => output.type === \"local_shell_call\"\n * );\n *\n * if (!shellCall) break;\n *\n * // Execute command (with proper sandboxing!)\n * const output = await executeCommand(shellCall.action);\n *\n * // Send output back to model\n * response = await model.invoke([\n * response,\n * {\n * type: \"local_shell_call_output\",\n * id: shellCall.call_id,\n * output: output,\n * },\n * ], {\n * tools: [tools.localShell()],\n * });\n * }\n *\n * return response;\n * }\n * ```\n *\n * @remarks\n * - Only available through the Responses API (not Chat Completions)\n * - Designed for use with `codex-mini-latest` model\n * - Commands are provided as argv tokens in `action.command`\n * - Action includes: `command`, `env`, `working_directory`, `timeout_ms`, `user`\n * - Always sandbox or validate commands before execution\n * - The `timeout_ms` from the model is only a hint—enforce your own limits\n */\nexport declare function localShell(options: LocalShellOptions): DynamicStructuredTool<z.ZodUnion<readonly [z.ZodObject<{\n type: z.ZodLiteral<\"exec\">;\n command: z.ZodArray<z.ZodString>;\n env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;\n working_directory: z.ZodOptional<z.ZodString>;\n timeout_ms: z.ZodOptional<z.ZodNumber>;\n user: z.ZodOptional<z.ZodString>;\n}, z.core.$strip>]>, OpenAIClient.Responses.ResponseOutputItem.LocalShellCall.Action, unknown, string, string>;\n//# sourceMappingURL=localShell.d.ts.map"],"mappings":";;;;;;;;AAQA;AAoBA;AA0BA;AAmHwB0B,KAjKZtB,gBAAAA,GAAmBF,QAAAA,CAAaG,SAAAA,CAAUC,kBAAAA,CAAmBC,cAAAA,CAAeC,MAiKtD;;;;AAAmD,UA7IpEa,iBAAAA,CA6IoE;;;;;;;;;;;;;;;;;;;;;oBAxH/DjB,8BAA8BkB;;;;;KAKxCC,cAAAA,GAAiBrB,QAAAA,CAAaG,SAAAA,CAAUmB,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmHjCC,UAAAA,UAAoBL,oBAAoBlB,sBAAsBH,CAAAA,CAAEoB,mBAAmBpB,CAAAA,CAAEkB;QACnGlB,CAAAA,CAAEU;WACCV,CAAAA,CAAEY,SAASZ,CAAAA,CAAEW;OACjBX,CAAAA,CAAEc,YAAYd,CAAAA,CAAEa,UAAUb,CAAAA,CAAEW,WAAWX,CAAAA,CAAEW;qBAC3BX,CAAAA,CAAEc,YAAYd,CAAAA,CAAEW;cACvBX,CAAAA,CAAEc,YAAYd,CAAAA,CAAEe;QACtBf,CAAAA,CAAEc,YAAYd,CAAAA,CAAEW;GACvBX,CAAAA,CAAEgB,IAAAA,CAAKC,WAAWf,QAAAA,CAAaG,SAAAA,CAAUC,kBAAAA,CAAmBC,cAAAA,CAAeC"}
1
+ {"version":3,"file":"localShell.d.cts","names":[],"sources":["../../src/tools/localShell.ts"],"mappings":";;;;;;;AASA;;;KAAY,gBAAA,GACV,QAAA,CAAa,SAAA,CAAU,kBAAA,CAAmB,cAAA,CAAe,MAAA;;AA6C3D;;UA3BiB,iBAAA;EA2BkD;;;;;;;AAsHnE;;;;;;;;;;;;;EA5HE,OAAA,GAAU,MAAA,EAAQ,gBAAA,cAA8B,OAAA;AAAA;;;;KAMtC,cAAA,GAAiB,QAAA,CAAa,SAAA,CAAU,IAAA,CAAK,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHzC,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAiB,qBAAA,CAAA,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA"}
@@ -3,7 +3,6 @@ import { DynamicStructuredTool } from "@langchain/core/tools";
3
3
  import { z } from "zod/v4";
4
4
 
5
5
  //#region src/tools/localShell.d.ts
6
-
7
6
  /**
8
7
  * Re-export action type from OpenAI SDK for convenience.
9
8
  * The action contains command details like argv tokens, environment variables,