@langchain/openai 1.1.2 → 1.2.0-dev-1765431816670

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 (207) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +583 -2
  3. package/dist/azure/chat_models/common.d.cts.map +1 -1
  4. package/dist/azure/chat_models/common.d.ts +1 -0
  5. package/dist/azure/chat_models/common.d.ts.map +1 -1
  6. package/dist/azure/chat_models/completions.d.cts.map +1 -1
  7. package/dist/azure/chat_models/completions.d.ts.map +1 -1
  8. package/dist/azure/chat_models/index.d.cts +1 -1
  9. package/dist/azure/chat_models/index.d.cts.map +1 -1
  10. package/dist/azure/chat_models/index.d.ts.map +1 -1
  11. package/dist/azure/chat_models/responses.d.cts.map +1 -1
  12. package/dist/azure/chat_models/responses.d.ts.map +1 -1
  13. package/dist/azure/embeddings.d.cts.map +1 -1
  14. package/dist/azure/embeddings.d.ts.map +1 -1
  15. package/dist/azure/llms.d.cts +0 -1
  16. package/dist/azure/llms.d.cts.map +1 -1
  17. package/dist/azure/llms.d.ts +0 -1
  18. package/dist/azure/llms.d.ts.map +1 -1
  19. package/dist/chat_models/base.cjs +5 -1
  20. package/dist/chat_models/base.cjs.map +1 -1
  21. package/dist/chat_models/base.d.cts +8 -22
  22. package/dist/chat_models/base.d.cts.map +1 -1
  23. package/dist/chat_models/base.d.ts +6 -20
  24. package/dist/chat_models/base.d.ts.map +1 -1
  25. package/dist/chat_models/base.js +6 -2
  26. package/dist/chat_models/base.js.map +1 -1
  27. package/dist/chat_models/completions.cjs.map +1 -1
  28. package/dist/chat_models/completions.d.cts +1 -3
  29. package/dist/chat_models/completions.d.cts.map +1 -1
  30. package/dist/chat_models/completions.d.ts +1 -3
  31. package/dist/chat_models/completions.d.ts.map +1 -1
  32. package/dist/chat_models/completions.js.map +1 -1
  33. package/dist/chat_models/index.d.cts +42 -4
  34. package/dist/chat_models/index.d.cts.map +1 -1
  35. package/dist/chat_models/index.d.ts +42 -4
  36. package/dist/chat_models/index.d.ts.map +1 -1
  37. package/dist/chat_models/responses.d.cts +2 -2
  38. package/dist/chat_models/responses.d.cts.map +1 -1
  39. package/dist/chat_models/responses.d.ts +2 -2
  40. package/dist/chat_models/responses.d.ts.map +1 -1
  41. package/dist/converters/completions.cjs +22 -12
  42. package/dist/converters/completions.cjs.map +1 -1
  43. package/dist/converters/completions.d.cts +0 -1
  44. package/dist/converters/completions.d.cts.map +1 -1
  45. package/dist/converters/completions.d.ts +0 -1
  46. package/dist/converters/completions.d.ts.map +1 -1
  47. package/dist/converters/completions.js +23 -13
  48. package/dist/converters/completions.js.map +1 -1
  49. package/dist/converters/index.d.ts +2 -0
  50. package/dist/converters/responses.cjs +37 -4
  51. package/dist/converters/responses.cjs.map +1 -1
  52. package/dist/converters/responses.d.cts.map +1 -1
  53. package/dist/converters/responses.d.ts.map +1 -1
  54. package/dist/converters/responses.js +39 -6
  55. package/dist/converters/responses.js.map +1 -1
  56. package/dist/embeddings.d.cts +0 -1
  57. package/dist/embeddings.d.cts.map +1 -1
  58. package/dist/embeddings.d.ts +0 -1
  59. package/dist/embeddings.d.ts.map +1 -1
  60. package/dist/index.cjs +2 -1
  61. package/dist/index.d.cts +12 -2
  62. package/dist/index.d.ts +13 -2
  63. package/dist/index.js +2 -2
  64. package/dist/llms.d.cts +0 -1
  65. package/dist/llms.d.cts.map +1 -1
  66. package/dist/llms.d.ts +0 -1
  67. package/dist/llms.d.ts.map +1 -1
  68. package/dist/tools/applyPatch.cjs +116 -0
  69. package/dist/tools/applyPatch.cjs.map +1 -0
  70. package/dist/tools/applyPatch.d.cts +148 -0
  71. package/dist/tools/applyPatch.d.cts.map +1 -0
  72. package/dist/tools/applyPatch.d.ts +148 -0
  73. package/dist/tools/applyPatch.d.ts.map +1 -0
  74. package/dist/tools/applyPatch.js +115 -0
  75. package/dist/tools/applyPatch.js.map +1 -0
  76. package/dist/tools/codeInterpreter.cjs +95 -0
  77. package/dist/tools/codeInterpreter.cjs.map +1 -0
  78. package/dist/tools/codeInterpreter.d.cts +125 -0
  79. package/dist/tools/codeInterpreter.d.cts.map +1 -0
  80. package/dist/tools/codeInterpreter.d.ts +125 -0
  81. package/dist/tools/codeInterpreter.d.ts.map +1 -0
  82. package/dist/tools/codeInterpreter.js +94 -0
  83. package/dist/tools/codeInterpreter.js.map +1 -0
  84. package/dist/tools/computerUse.cjs +240 -0
  85. package/dist/tools/computerUse.cjs.map +1 -0
  86. package/dist/tools/computerUse.d.cts +234 -0
  87. package/dist/tools/computerUse.d.cts.map +1 -0
  88. package/dist/tools/computerUse.d.ts +234 -0
  89. package/dist/tools/computerUse.d.ts.map +1 -0
  90. package/dist/tools/computerUse.js +239 -0
  91. package/dist/tools/computerUse.js.map +1 -0
  92. package/dist/tools/custom.d.cts +1 -1
  93. package/dist/tools/custom.d.cts.map +1 -1
  94. package/dist/tools/custom.d.ts.map +1 -1
  95. package/dist/tools/dalle.d.cts +1 -2
  96. package/dist/tools/dalle.d.cts.map +1 -1
  97. package/dist/tools/dalle.d.ts +1 -2
  98. package/dist/tools/dalle.d.ts.map +1 -1
  99. package/dist/tools/fileSearch.cjs +137 -0
  100. package/dist/tools/fileSearch.cjs.map +1 -0
  101. package/dist/tools/fileSearch.d.cts +224 -0
  102. package/dist/tools/fileSearch.d.cts.map +1 -0
  103. package/dist/tools/fileSearch.d.ts +224 -0
  104. package/dist/tools/fileSearch.d.ts.map +1 -0
  105. package/dist/tools/fileSearch.js +136 -0
  106. package/dist/tools/fileSearch.js.map +1 -0
  107. package/dist/tools/imageGeneration.cjs +128 -0
  108. package/dist/tools/imageGeneration.cjs.map +1 -0
  109. package/dist/tools/imageGeneration.d.cts +199 -0
  110. package/dist/tools/imageGeneration.d.cts.map +1 -0
  111. package/dist/tools/imageGeneration.d.ts +199 -0
  112. package/dist/tools/imageGeneration.d.ts.map +1 -0
  113. package/dist/tools/imageGeneration.js +127 -0
  114. package/dist/tools/imageGeneration.js.map +1 -0
  115. package/dist/tools/index.cjs +26 -0
  116. package/dist/tools/index.cjs.map +1 -0
  117. package/dist/tools/index.d.cts +27 -0
  118. package/dist/tools/index.d.cts.map +1 -0
  119. package/dist/tools/index.d.ts +27 -0
  120. package/dist/tools/index.d.ts.map +1 -0
  121. package/dist/tools/index.js +26 -0
  122. package/dist/tools/index.js.map +1 -0
  123. package/dist/tools/localShell.cjs +145 -0
  124. package/dist/tools/localShell.cjs.map +1 -0
  125. package/dist/tools/localShell.d.cts +167 -0
  126. package/dist/tools/localShell.d.cts.map +1 -0
  127. package/dist/tools/localShell.d.ts +167 -0
  128. package/dist/tools/localShell.d.ts.map +1 -0
  129. package/dist/tools/localShell.js +144 -0
  130. package/dist/tools/localShell.js.map +1 -0
  131. package/dist/tools/mcp.cjs +53 -0
  132. package/dist/tools/mcp.cjs.map +1 -0
  133. package/dist/tools/mcp.d.cts +177 -0
  134. package/dist/tools/mcp.d.cts.map +1 -0
  135. package/dist/tools/mcp.d.ts +177 -0
  136. package/dist/tools/mcp.d.ts.map +1 -0
  137. package/dist/tools/mcp.js +52 -0
  138. package/dist/tools/mcp.js.map +1 -0
  139. package/dist/tools/shell.cjs +163 -0
  140. package/dist/tools/shell.cjs.map +1 -0
  141. package/dist/tools/shell.d.cts +221 -0
  142. package/dist/tools/shell.d.cts.map +1 -0
  143. package/dist/tools/shell.d.ts +221 -0
  144. package/dist/tools/shell.d.ts.map +1 -0
  145. package/dist/tools/shell.js +162 -0
  146. package/dist/tools/shell.js.map +1 -0
  147. package/dist/tools/webSearch.cjs +73 -0
  148. package/dist/tools/webSearch.cjs.map +1 -0
  149. package/dist/tools/webSearch.d.cts +130 -0
  150. package/dist/tools/webSearch.d.cts.map +1 -0
  151. package/dist/tools/webSearch.d.ts +130 -0
  152. package/dist/tools/webSearch.d.ts.map +1 -0
  153. package/dist/tools/webSearch.js +72 -0
  154. package/dist/tools/webSearch.js.map +1 -0
  155. package/dist/types.d.cts +2 -4
  156. package/dist/types.d.cts.map +1 -1
  157. package/dist/types.d.ts +1 -3
  158. package/dist/types.d.ts.map +1 -1
  159. package/dist/utils/azure.d.cts +1 -5
  160. package/dist/utils/azure.d.cts.map +1 -1
  161. package/dist/utils/azure.d.ts +1 -5
  162. package/dist/utils/azure.d.ts.map +1 -1
  163. package/dist/utils/client.d.cts.map +1 -1
  164. package/dist/utils/client.d.ts.map +1 -1
  165. package/dist/utils/misc.cjs +6 -0
  166. package/dist/utils/misc.cjs.map +1 -1
  167. package/dist/utils/misc.d.cts +1 -1
  168. package/dist/utils/misc.d.cts.map +1 -1
  169. package/dist/utils/misc.d.ts +1 -1
  170. package/dist/utils/misc.d.ts.map +1 -1
  171. package/dist/utils/misc.js +6 -1
  172. package/dist/utils/misc.js.map +1 -1
  173. package/dist/utils/prompts.d.cts +0 -1
  174. package/dist/utils/prompts.d.cts.map +1 -1
  175. package/dist/utils/prompts.d.ts +0 -1
  176. package/dist/utils/prompts.d.ts.map +1 -1
  177. package/dist/utils/tools.cjs +39 -1
  178. package/dist/utils/tools.cjs.map +1 -1
  179. package/dist/utils/tools.d.cts.map +1 -1
  180. package/dist/utils/tools.d.ts.map +1 -1
  181. package/dist/utils/tools.js +37 -2
  182. package/dist/utils/tools.js.map +1 -1
  183. package/package.json +18 -15
  184. package/dist/langchain-core/dist/callbacks/base.d.ts +0 -1
  185. package/dist/langchain-core/dist/callbacks/manager.d.ts +0 -2
  186. package/dist/langchain-core/dist/language_models/base.d.ts +0 -5
  187. package/dist/langchain-core/dist/language_models/chat_models.d.cts +0 -13
  188. package/dist/langchain-core/dist/language_models/chat_models.d.cts.map +0 -1
  189. package/dist/langchain-core/dist/language_models/chat_models.d.ts +0 -20
  190. package/dist/langchain-core/dist/language_models/chat_models.d.ts.map +0 -1
  191. package/dist/langchain-core/dist/runnables/base.d.ts +0 -7
  192. package/dist/langchain-core/dist/runnables/graph.d.ts +0 -1
  193. package/dist/langchain-core/dist/runnables/types.d.ts +0 -2
  194. package/dist/langchain-core/dist/tools/types.d.ts +0 -5
  195. package/dist/langchain-core/dist/tracers/base.d.ts +0 -2
  196. package/dist/langchain-core/dist/tracers/event_stream.d.ts +0 -1
  197. package/dist/langchain-core/dist/tracers/log_stream.d.ts +0 -3
  198. package/dist/langchain-core/dist/types/_internal.d.cts +0 -11
  199. package/dist/langchain-core/dist/types/_internal.d.cts.map +0 -1
  200. package/dist/langchain-core/dist/types/_internal.d.ts +0 -11
  201. package/dist/langchain-core/dist/types/_internal.d.ts.map +0 -1
  202. package/dist/langchain-core/dist/utils/stream.d.cts +0 -26
  203. package/dist/langchain-core/dist/utils/stream.d.cts.map +0 -1
  204. package/dist/langchain-core/dist/utils/stream.d.ts +0 -26
  205. package/dist/langchain-core/dist/utils/stream.d.ts.map +0 -1
  206. package/dist/langchain-core/dist/utils/types/index.d.ts +0 -1
  207. package/dist/langchain-core/dist/utils/types/zod.d.ts +0 -1
@@ -0,0 +1,199 @@
1
+ import { OpenAI as OpenAI$1 } from "openai";
2
+ import { ServerTool } from "@langchain/core/tools";
3
+
4
+ //#region src/tools/imageGeneration.d.ts
5
+
6
+ /**
7
+ * Optional mask for inpainting. Allows you to specify areas of the image
8
+ * that should be regenerated.
9
+ */
10
+ interface ImageGenerationInputMask {
11
+ /**
12
+ * Base64-encoded mask image URL.
13
+ */
14
+ imageUrl?: string;
15
+ /**
16
+ * File ID for the mask image (uploaded via OpenAI File API).
17
+ */
18
+ fileId?: string;
19
+ }
20
+ /**
21
+ * Options for the Image Generation tool.
22
+ */
23
+ interface ImageGenerationOptions {
24
+ /**
25
+ * Background type for the generated image.
26
+ * - `transparent`: Generate image with transparent background
27
+ * - `opaque`: Generate image with opaque background
28
+ * - `auto`: Let the model decide based on the prompt
29
+ * @default "auto"
30
+ */
31
+ background?: "transparent" | "opaque" | "auto";
32
+ /**
33
+ * Control how much effort the model will exert to match the style and features,
34
+ * especially facial features, of input images. This parameter is only supported
35
+ * for `gpt-image-1`. Unsupported for `gpt-image-1-mini`.
36
+ * - `high`: Higher fidelity to input images
37
+ * - `low`: Lower fidelity to input images
38
+ * @default "low"
39
+ */
40
+ inputFidelity?: "high" | "low";
41
+ /**
42
+ * Optional mask for inpainting. Use this to specify areas of an image
43
+ * that should be regenerated.
44
+ */
45
+ inputImageMask?: ImageGenerationInputMask;
46
+ /**
47
+ * The image generation model to use.
48
+ * @default "gpt-image-1"
49
+ */
50
+ model?: "gpt-image-1" | "gpt-image-1-mini";
51
+ /**
52
+ * Moderation level for the generated image.
53
+ * - `auto`: Standard moderation
54
+ * - `low`: Less restrictive moderation
55
+ * @default "auto"
56
+ */
57
+ moderation?: "auto" | "low";
58
+ /**
59
+ * Compression level for the output image (0-100).
60
+ * Only applies to JPEG and WebP formats.
61
+ * @default 100
62
+ */
63
+ outputCompression?: number;
64
+ /**
65
+ * The output format of the generated image.
66
+ * @default "png"
67
+ */
68
+ outputFormat?: "png" | "webp" | "jpeg";
69
+ /**
70
+ * Number of partial images to generate in streaming mode (0-3).
71
+ * When set, the model will return partial images as they are generated,
72
+ * providing faster visual feedback.
73
+ * @default 0
74
+ */
75
+ partialImages?: number;
76
+ /**
77
+ * The quality of the generated image.
78
+ * - `low`: Faster generation, lower quality
79
+ * - `medium`: Balanced generation time and quality
80
+ * - `high`: Slower generation, higher quality
81
+ * - `auto`: Let the model decide based on the prompt
82
+ * @default "auto"
83
+ */
84
+ quality?: "low" | "medium" | "high" | "auto";
85
+ /**
86
+ * The size of the generated image.
87
+ * - `1024x1024`: Square format
88
+ * - `1024x1536`: Portrait format
89
+ * - `1536x1024`: Landscape format
90
+ * - `auto`: Let the model decide based on the prompt
91
+ * @default "auto"
92
+ */
93
+ size?: "1024x1024" | "1024x1536" | "1536x1024" | "auto";
94
+ }
95
+ /**
96
+ * OpenAI Image Generation tool type for the Responses API.
97
+ */
98
+ type ImageGenerationTool = OpenAI$1.Responses.Tool.ImageGeneration;
99
+ /**
100
+ * Creates an Image Generation tool that allows models to generate or edit images
101
+ * using text prompts and optional image inputs.
102
+ *
103
+ * The image generation tool leverages the GPT Image model and automatically
104
+ * optimizes text inputs for improved performance. When included in a request,
105
+ * the model can decide when and how to generate images as part of the conversation.
106
+ *
107
+ * **Key Features**:
108
+ * - Generate images from text descriptions
109
+ * - Edit existing images with text instructions
110
+ * - Multi-turn image editing by referencing previous responses
111
+ * - Configurable output options (size, quality, format)
112
+ * - Streaming support for partial image generation
113
+ *
114
+ * **Prompting Tips**:
115
+ * - Use terms like "draw" or "edit" in your prompt for best results
116
+ * - For combining images, say "edit the first image by adding this element" instead of "combine"
117
+ *
118
+ * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}
119
+ *
120
+ * @param options - Configuration options for the Image Generation tool
121
+ * @returns An Image Generation tool definition to be passed to the OpenAI Responses API
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * import { ChatOpenAI, tools } from "@langchain/openai";
126
+ *
127
+ * const model = new ChatOpenAI({ model: "gpt-4o" });
128
+ *
129
+ * // Basic usage - generate an image
130
+ * const response = await model.invoke(
131
+ * "Generate an image of a gray tabby cat hugging an otter with an orange scarf",
132
+ * { tools: [tools.imageGeneration()] }
133
+ * );
134
+ *
135
+ * // Access the generated image
136
+ * const imageData = response.additional_kwargs.tool_outputs?.find(
137
+ * (output) => output.type === "image_generation_call"
138
+ * );
139
+ * if (imageData?.result) {
140
+ * // imageData.result contains the base64-encoded image
141
+ * const fs = await import("fs");
142
+ * fs.writeFileSync("output.png", Buffer.from(imageData.result, "base64"));
143
+ * }
144
+ *
145
+ * // With custom options
146
+ * const response = await model.invoke(
147
+ * "Draw a beautiful sunset over mountains",
148
+ * {
149
+ * tools: [tools.imageGeneration({
150
+ * size: "1536x1024", // Landscape format
151
+ * quality: "high", // Higher quality output
152
+ * outputFormat: "jpeg", // JPEG format
153
+ * outputCompression: 90, // 90% compression
154
+ * })]
155
+ * }
156
+ * );
157
+ *
158
+ * // With transparent background
159
+ * const response = await model.invoke(
160
+ * "Create a logo with a transparent background",
161
+ * {
162
+ * tools: [tools.imageGeneration({
163
+ * background: "transparent",
164
+ * outputFormat: "png",
165
+ * })]
166
+ * }
167
+ * );
168
+ *
169
+ * // Force the model to use image generation
170
+ * const response = await model.invoke(
171
+ * "A serene lake at dawn",
172
+ * {
173
+ * tools: [tools.imageGeneration()],
174
+ * tool_choice: { type: "image_generation" },
175
+ * }
176
+ * );
177
+ *
178
+ * // Enable streaming with partial images
179
+ * const response = await model.invoke(
180
+ * "Draw a detailed fantasy castle",
181
+ * {
182
+ * tools: [tools.imageGeneration({
183
+ * partialImages: 2, // Get 2 partial images during generation
184
+ * })]
185
+ * }
186
+ * );
187
+ * ```
188
+ *
189
+ * @remarks
190
+ * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3
191
+ * - The image generation process always uses `gpt-image-1` model internally
192
+ * - The model will automatically revise prompts for improved performance
193
+ * - Access the revised prompt via `revised_prompt` field in the output
194
+ * - Multi-turn editing is supported by passing previous response messages
195
+ */
196
+ declare function imageGeneration(options?: ImageGenerationOptions): ServerTool;
197
+ //#endregion
198
+ export { ImageGenerationInputMask, ImageGenerationOptions, ImageGenerationTool, imageGeneration };
199
+ //# sourceMappingURL=imageGeneration.d.ts.map
@@ -0,0 +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 * 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\";\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;AA2EYK,UAxFKF,wBAAAA,CAwFiBF;EAkGVQ;;;;;;;;;;;;UA7KPL,sBAAAA;;;;;;;;;;;;;;;;;;;;;;mBAsBID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDTE,mBAAAA,GAAsBJ,QAAAA,CAAaK,SAAAA,CAAUC,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkGtCC,eAAAA,WAA0BL,yBAAyBF"}
@@ -0,0 +1,127 @@
1
+ //#region src/tools/imageGeneration.ts
2
+ /**
3
+ * Converts input mask options to the API format.
4
+ */
5
+ function convertInputImageMask(mask) {
6
+ if (!mask) return void 0;
7
+ return {
8
+ image_url: mask.imageUrl,
9
+ file_id: mask.fileId
10
+ };
11
+ }
12
+ /**
13
+ * Creates an Image Generation tool that allows models to generate or edit images
14
+ * using text prompts and optional image inputs.
15
+ *
16
+ * The image generation tool leverages the GPT Image model and automatically
17
+ * optimizes text inputs for improved performance. When included in a request,
18
+ * the model can decide when and how to generate images as part of the conversation.
19
+ *
20
+ * **Key Features**:
21
+ * - Generate images from text descriptions
22
+ * - Edit existing images with text instructions
23
+ * - Multi-turn image editing by referencing previous responses
24
+ * - Configurable output options (size, quality, format)
25
+ * - Streaming support for partial image generation
26
+ *
27
+ * **Prompting Tips**:
28
+ * - Use terms like "draw" or "edit" in your prompt for best results
29
+ * - For combining images, say "edit the first image by adding this element" instead of "combine"
30
+ *
31
+ * @see {@link https://platform.openai.com/docs/guides/tools-image-generation | OpenAI Image Generation Documentation}
32
+ *
33
+ * @param options - Configuration options for the Image Generation tool
34
+ * @returns An Image Generation tool definition to be passed to the OpenAI Responses API
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * import { ChatOpenAI, tools } from "@langchain/openai";
39
+ *
40
+ * const model = new ChatOpenAI({ model: "gpt-4o" });
41
+ *
42
+ * // Basic usage - generate an image
43
+ * const response = await model.invoke(
44
+ * "Generate an image of a gray tabby cat hugging an otter with an orange scarf",
45
+ * { tools: [tools.imageGeneration()] }
46
+ * );
47
+ *
48
+ * // Access the generated image
49
+ * const imageData = response.additional_kwargs.tool_outputs?.find(
50
+ * (output) => output.type === "image_generation_call"
51
+ * );
52
+ * if (imageData?.result) {
53
+ * // imageData.result contains the base64-encoded image
54
+ * const fs = await import("fs");
55
+ * fs.writeFileSync("output.png", Buffer.from(imageData.result, "base64"));
56
+ * }
57
+ *
58
+ * // With custom options
59
+ * const response = await model.invoke(
60
+ * "Draw a beautiful sunset over mountains",
61
+ * {
62
+ * tools: [tools.imageGeneration({
63
+ * size: "1536x1024", // Landscape format
64
+ * quality: "high", // Higher quality output
65
+ * outputFormat: "jpeg", // JPEG format
66
+ * outputCompression: 90, // 90% compression
67
+ * })]
68
+ * }
69
+ * );
70
+ *
71
+ * // With transparent background
72
+ * const response = await model.invoke(
73
+ * "Create a logo with a transparent background",
74
+ * {
75
+ * tools: [tools.imageGeneration({
76
+ * background: "transparent",
77
+ * outputFormat: "png",
78
+ * })]
79
+ * }
80
+ * );
81
+ *
82
+ * // Force the model to use image generation
83
+ * const response = await model.invoke(
84
+ * "A serene lake at dawn",
85
+ * {
86
+ * tools: [tools.imageGeneration()],
87
+ * tool_choice: { type: "image_generation" },
88
+ * }
89
+ * );
90
+ *
91
+ * // Enable streaming with partial images
92
+ * const response = await model.invoke(
93
+ * "Draw a detailed fantasy castle",
94
+ * {
95
+ * tools: [tools.imageGeneration({
96
+ * partialImages: 2, // Get 2 partial images during generation
97
+ * })]
98
+ * }
99
+ * );
100
+ * ```
101
+ *
102
+ * @remarks
103
+ * - Supported models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3
104
+ * - The image generation process always uses `gpt-image-1` model internally
105
+ * - The model will automatically revise prompts for improved performance
106
+ * - Access the revised prompt via `revised_prompt` field in the output
107
+ * - Multi-turn editing is supported by passing previous response messages
108
+ */
109
+ function imageGeneration(options) {
110
+ return {
111
+ type: "image_generation",
112
+ background: options?.background,
113
+ input_fidelity: options?.inputFidelity,
114
+ input_image_mask: convertInputImageMask(options?.inputImageMask),
115
+ model: options?.model,
116
+ moderation: options?.moderation,
117
+ output_compression: options?.outputCompression,
118
+ output_format: options?.outputFormat,
119
+ partial_images: options?.partialImages,
120
+ quality: options?.quality,
121
+ size: options?.size
122
+ };
123
+ }
124
+
125
+ //#endregion
126
+ export { imageGeneration };
127
+ //# sourceMappingURL=imageGeneration.js.map
@@ -0,0 +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 * 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\";\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 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":";;;;AA+GA,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,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 +1,27 @@
1
1
  const require_dalle = require('./dalle.cjs');
2
+ const require_webSearch = require('./webSearch.cjs');
3
+ const require_mcp = require('./mcp.cjs');
4
+ const require_codeInterpreter = require('./codeInterpreter.cjs');
5
+ const require_fileSearch = require('./fileSearch.cjs');
6
+ const require_imageGeneration = require('./imageGeneration.cjs');
7
+ const require_computerUse = require('./computerUse.cjs');
8
+ const require_localShell = require('./localShell.cjs');
9
+ const require_shell = require('./shell.cjs');
10
+ const require_applyPatch = require('./applyPatch.cjs');
11
+
12
+ //#region src/tools/index.ts
13
+ const tools = {
14
+ webSearch: require_webSearch.webSearch,
15
+ mcp: require_mcp.mcp,
16
+ codeInterpreter: require_codeInterpreter.codeInterpreter,
17
+ fileSearch: require_fileSearch.fileSearch,
18
+ imageGeneration: require_imageGeneration.imageGeneration,
19
+ computerUse: require_computerUse.computerUse,
20
+ localShell: require_localShell.localShell,
21
+ shell: require_shell.shell,
22
+ applyPatch: require_applyPatch.applyPatch
23
+ };
24
+
25
+ //#endregion
26
+ exports.tools = tools;
27
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +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"}
@@ -0,0 +1,27 @@
1
+ import { DallEAPIWrapper, DallEAPIWrapperParams, OpenAIImageModelId } from "./dalle.cjs";
2
+ import { WebSearchFilters, WebSearchOptions, WebSearchTool, webSearch } from "./webSearch.cjs";
3
+ import { McpApprovalFilter, McpConnectorId, McpConnectorOptions, McpRemoteServerOptions, McpTool, McpToolFilter, mcp } from "./mcp.cjs";
4
+ import { CodeInterpreterAutoContainer, CodeInterpreterMemoryLimit, CodeInterpreterOptions, CodeInterpreterTool, codeInterpreter } from "./codeInterpreter.cjs";
5
+ import { FileSearchComparisonFilter, FileSearchComparisonType, FileSearchCompoundFilter, FileSearchFilter, FileSearchHybridSearchWeights, FileSearchOptions, FileSearchRankingOptions, FileSearchTool, fileSearch } from "./fileSearch.cjs";
6
+ import { ImageGenerationInputMask, ImageGenerationOptions, ImageGenerationTool, imageGeneration } from "./imageGeneration.cjs";
7
+ import { ComputerUseAction, ComputerUseClickAction, ComputerUseDoubleClickAction, ComputerUseDragAction, ComputerUseEnvironment, ComputerUseInput, ComputerUseKeypressAction, ComputerUseMoveAction, ComputerUseOptions, ComputerUseScreenshotAction, ComputerUseScrollAction, ComputerUseTool, ComputerUseTypeAction, ComputerUseWaitAction, computerUse } from "./computerUse.cjs";
8
+ import { LocalShellAction, LocalShellOptions, LocalShellTool, localShell } from "./localShell.cjs";
9
+ import { ShellAction, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellResult, ShellTool, shell } from "./shell.cjs";
10
+ import { ApplyPatchCreateFileOperation, ApplyPatchDeleteFileOperation, ApplyPatchOperation, ApplyPatchOptions, ApplyPatchTool, ApplyPatchUpdateFileOperation, applyPatch } from "./applyPatch.cjs";
11
+
12
+ //#region src/tools/index.d.ts
13
+
14
+ declare const tools: {
15
+ webSearch: typeof webSearch;
16
+ mcp: typeof mcp;
17
+ codeInterpreter: typeof codeInterpreter;
18
+ fileSearch: typeof fileSearch;
19
+ imageGeneration: typeof imageGeneration;
20
+ computerUse: typeof computerUse;
21
+ localShell: typeof localShell;
22
+ shell: typeof shell;
23
+ applyPatch: typeof applyPatch;
24
+ };
25
+ //#endregion
26
+ export { tools };
27
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +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"}
@@ -0,0 +1,27 @@
1
+ import { DallEAPIWrapper, DallEAPIWrapperParams, OpenAIImageModelId } from "./dalle.js";
2
+ import { WebSearchFilters, WebSearchOptions, WebSearchTool, webSearch } from "./webSearch.js";
3
+ import { McpApprovalFilter, McpConnectorId, McpConnectorOptions, McpRemoteServerOptions, McpTool, McpToolFilter, mcp } from "./mcp.js";
4
+ import { CodeInterpreterAutoContainer, CodeInterpreterMemoryLimit, CodeInterpreterOptions, CodeInterpreterTool, codeInterpreter } from "./codeInterpreter.js";
5
+ import { FileSearchComparisonFilter, FileSearchComparisonType, FileSearchCompoundFilter, FileSearchFilter, FileSearchHybridSearchWeights, FileSearchOptions, FileSearchRankingOptions, FileSearchTool, fileSearch } from "./fileSearch.js";
6
+ import { ImageGenerationInputMask, ImageGenerationOptions, ImageGenerationTool, imageGeneration } from "./imageGeneration.js";
7
+ import { ComputerUseAction, ComputerUseClickAction, ComputerUseDoubleClickAction, ComputerUseDragAction, ComputerUseEnvironment, ComputerUseInput, ComputerUseKeypressAction, ComputerUseMoveAction, ComputerUseOptions, ComputerUseScreenshotAction, ComputerUseScrollAction, ComputerUseTool, ComputerUseTypeAction, ComputerUseWaitAction, computerUse } from "./computerUse.js";
8
+ import { LocalShellAction, LocalShellOptions, LocalShellTool, localShell } from "./localShell.js";
9
+ import { ShellAction, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellResult, ShellTool, shell } from "./shell.js";
10
+ import { ApplyPatchCreateFileOperation, ApplyPatchDeleteFileOperation, ApplyPatchOperation, ApplyPatchOptions, ApplyPatchTool, ApplyPatchUpdateFileOperation, applyPatch } from "./applyPatch.js";
11
+
12
+ //#region src/tools/index.d.ts
13
+
14
+ declare const tools: {
15
+ webSearch: typeof webSearch;
16
+ mcp: typeof mcp;
17
+ codeInterpreter: typeof codeInterpreter;
18
+ fileSearch: typeof fileSearch;
19
+ imageGeneration: typeof imageGeneration;
20
+ computerUse: typeof computerUse;
21
+ localShell: typeof localShell;
22
+ shell: typeof shell;
23
+ applyPatch: typeof applyPatch;
24
+ };
25
+ //#endregion
26
+ export { tools };
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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 +1,27 @@
1
1
  import { DallEAPIWrapper } from "./dalle.js";
2
+ import { webSearch } from "./webSearch.js";
3
+ import { mcp } from "./mcp.js";
4
+ import { codeInterpreter } from "./codeInterpreter.js";
5
+ import { fileSearch } from "./fileSearch.js";
6
+ import { imageGeneration } from "./imageGeneration.js";
7
+ import { computerUse } from "./computerUse.js";
8
+ import { localShell } from "./localShell.js";
9
+ import { shell } from "./shell.js";
10
+ import { applyPatch } from "./applyPatch.js";
11
+
12
+ //#region src/tools/index.ts
13
+ const tools = {
14
+ webSearch,
15
+ mcp,
16
+ codeInterpreter,
17
+ fileSearch,
18
+ imageGeneration,
19
+ computerUse,
20
+ localShell,
21
+ shell,
22
+ applyPatch
23
+ };
24
+
25
+ //#endregion
26
+ export { tools };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}