@mastra/server 0.0.0-fix-message-list-args-missing-20250807205055 → 0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441

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 (253) hide show
  1. package/CHANGELOG.md +3569 -0
  2. package/dist/chunk-2JEDATG5.cjs +15707 -0
  3. package/dist/chunk-2JEDATG5.cjs.map +1 -0
  4. package/dist/{chunk-GASWM5HJ.cjs → chunk-3THIIWWW.cjs} +108 -138
  5. package/dist/chunk-3THIIWWW.cjs.map +1 -0
  6. package/dist/{chunk-OW4FX5TS.js → chunk-4QCXUEAT.js} +10 -3
  7. package/dist/chunk-4QCXUEAT.js.map +1 -0
  8. package/dist/chunk-4RRMWXQ2.js +3522 -0
  9. package/dist/chunk-4RRMWXQ2.js.map +1 -0
  10. package/dist/chunk-5DP5XZH6.cjs +928 -0
  11. package/dist/chunk-5DP5XZH6.cjs.map +1 -0
  12. package/dist/{chunk-TRWPUPGD.js → chunk-5QUKZCEF.js} +107 -137
  13. package/dist/chunk-5QUKZCEF.js.map +1 -0
  14. package/dist/chunk-66YYHFGF.js +761 -0
  15. package/dist/chunk-66YYHFGF.js.map +1 -0
  16. package/dist/chunk-6GMFZ5LK.js +2774 -0
  17. package/dist/chunk-6GMFZ5LK.js.map +1 -0
  18. package/dist/{chunk-S37KCGOR.cjs → chunk-6LUKYSWE.cjs} +119 -55
  19. package/dist/chunk-6LUKYSWE.cjs.map +1 -0
  20. package/dist/chunk-743UIDHI.cjs +2013 -0
  21. package/dist/chunk-743UIDHI.cjs.map +1 -0
  22. package/dist/{chunk-TXAQU2XN.js → chunk-7QEJ5QG5.js} +5 -5
  23. package/dist/chunk-7QEJ5QG5.js.map +1 -0
  24. package/dist/{chunk-4MQU6AJN.js → chunk-A3AL7EWJ.js} +4 -4
  25. package/dist/{chunk-4MQU6AJN.js.map → chunk-A3AL7EWJ.js.map} +1 -1
  26. package/dist/{chunk-HWHKM67I.js → chunk-A75S4TDD.js} +4 -4
  27. package/dist/{chunk-HWHKM67I.js.map → chunk-A75S4TDD.js.map} +1 -1
  28. package/dist/chunk-AK2FXLLB.cjs +849 -0
  29. package/dist/chunk-AK2FXLLB.cjs.map +1 -0
  30. package/dist/{chunk-BUOJL3MN.js → chunk-B2V3PUB7.js} +117 -55
  31. package/dist/chunk-B2V3PUB7.js.map +1 -0
  32. package/dist/chunk-EMMSS5I5.cjs +37 -0
  33. package/dist/{chunk-Q7SFCCGT.cjs.map → chunk-EMMSS5I5.cjs.map} +1 -1
  34. package/dist/chunk-EMNGA4R4.js +845 -0
  35. package/dist/chunk-EMNGA4R4.js.map +1 -0
  36. package/dist/chunk-FALVL2VV.cjs +3525 -0
  37. package/dist/chunk-FALVL2VV.cjs.map +1 -0
  38. package/dist/chunk-FQNT7PI4.js +937 -0
  39. package/dist/chunk-FQNT7PI4.js.map +1 -0
  40. package/dist/chunk-G3PMV62Z.js +33 -0
  41. package/dist/{chunk-PZ5AY32C.js.map → chunk-G3PMV62Z.js.map} +1 -1
  42. package/dist/{chunk-4QSNRCOT.cjs → chunk-G4PUALCE.cjs} +10 -2
  43. package/dist/chunk-G4PUALCE.cjs.map +1 -0
  44. package/dist/chunk-GU4EWMZB.cjs +769 -0
  45. package/dist/chunk-GU4EWMZB.cjs.map +1 -0
  46. package/dist/{chunk-VIGPWTDA.cjs → chunk-GUI3CROV.cjs} +6 -6
  47. package/dist/chunk-GUI3CROV.cjs.map +1 -0
  48. package/dist/chunk-HJQKWRKQ.cjs +764 -0
  49. package/dist/chunk-HJQKWRKQ.cjs.map +1 -0
  50. package/dist/{chunk-LRUH33B4.cjs → chunk-HVBBFCDH.cjs} +1004 -727
  51. package/dist/chunk-HVBBFCDH.cjs.map +1 -0
  52. package/dist/chunk-HZJRQ5L3.cjs +1411 -0
  53. package/dist/chunk-HZJRQ5L3.cjs.map +1 -0
  54. package/dist/chunk-IGFMAZZ5.cjs +1150 -0
  55. package/dist/chunk-IGFMAZZ5.cjs.map +1 -0
  56. package/dist/chunk-IOQGI4ML.js +931 -0
  57. package/dist/chunk-IOQGI4ML.js.map +1 -0
  58. package/dist/{chunk-4CEZIJWJ.cjs → chunk-IY34NOLA.cjs} +7 -7
  59. package/dist/{chunk-4CEZIJWJ.cjs.map → chunk-IY34NOLA.cjs.map} +1 -1
  60. package/dist/{chunk-O4I563YW.cjs → chunk-J7BPKKOG.cjs} +46 -13
  61. package/dist/chunk-J7BPKKOG.cjs.map +1 -0
  62. package/dist/{chunk-JGVY3KWV.cjs → chunk-KNGXRN26.cjs} +12 -11
  63. package/dist/chunk-KNGXRN26.cjs.map +1 -0
  64. package/dist/{chunk-SQ7KKIH3.js → chunk-KV6VHX4V.js} +22 -5
  65. package/dist/chunk-KV6VHX4V.js.map +1 -0
  66. package/dist/chunk-L265APUD.cjs +69 -0
  67. package/dist/chunk-L265APUD.cjs.map +1 -0
  68. package/dist/chunk-LF2ZLOFP.js +767 -0
  69. package/dist/chunk-LF2ZLOFP.js.map +1 -0
  70. package/dist/{chunk-VOY6MGKA.js → chunk-LJFXFCUH.js} +184 -30
  71. package/dist/chunk-LJFXFCUH.js.map +1 -0
  72. package/dist/chunk-LYPU75T6.js +1147 -0
  73. package/dist/chunk-LYPU75T6.js.map +1 -0
  74. package/dist/{chunk-7FHF55WA.js → chunk-N7F33WAD.js} +976 -727
  75. package/dist/chunk-N7F33WAD.js.map +1 -0
  76. package/dist/chunk-NG5IVLEZ.js +1012 -0
  77. package/dist/chunk-NG5IVLEZ.js.map +1 -0
  78. package/dist/chunk-OGW6HHVI.js +1408 -0
  79. package/dist/chunk-OGW6HHVI.js.map +1 -0
  80. package/dist/chunk-OTU37YZO.js +15671 -0
  81. package/dist/chunk-OTU37YZO.js.map +1 -0
  82. package/dist/{chunk-GX25CWC7.cjs → chunk-OZLRIVC4.cjs} +18 -18
  83. package/dist/chunk-OZLRIVC4.cjs.map +1 -0
  84. package/dist/chunk-P7CIEIJ3.js +925 -0
  85. package/dist/chunk-P7CIEIJ3.js.map +1 -0
  86. package/dist/chunk-P7RBMCBE.cjs +934 -0
  87. package/dist/chunk-P7RBMCBE.cjs.map +1 -0
  88. package/dist/chunk-PPYGWINI.cjs +2777 -0
  89. package/dist/chunk-PPYGWINI.cjs.map +1 -0
  90. package/dist/{chunk-ILCWPBYQ.cjs → chunk-PWTXZZTR.cjs} +23 -5
  91. package/dist/chunk-PWTXZZTR.cjs.map +1 -0
  92. package/dist/{chunk-2XIJW7SV.cjs → chunk-QZT4RDHB.cjs} +193 -33
  93. package/dist/chunk-QZT4RDHB.cjs.map +1 -0
  94. package/dist/chunk-R7NOGUZG.js +65 -0
  95. package/dist/chunk-R7NOGUZG.js.map +1 -0
  96. package/dist/chunk-RCHEPTZZ.js +2006 -0
  97. package/dist/chunk-RCHEPTZZ.js.map +1 -0
  98. package/dist/chunk-SIGXR3JT.cjs +1043 -0
  99. package/dist/chunk-SIGXR3JT.cjs.map +1 -0
  100. package/dist/{chunk-BED2O446.cjs → chunk-SPLSYTYW.cjs} +7 -7
  101. package/dist/{chunk-BED2O446.cjs.map → chunk-SPLSYTYW.cjs.map} +1 -1
  102. package/dist/{chunk-ZKJZQN24.js → chunk-SQY4T6EJ.js} +5 -5
  103. package/dist/chunk-SQY4T6EJ.js.map +1 -0
  104. package/dist/{chunk-YS66MFDY.js → chunk-SYRRSBGL.js} +44 -12
  105. package/dist/chunk-SYRRSBGL.js.map +1 -0
  106. package/dist/{chunk-NCS2OXX6.cjs → chunk-T3TIA3O6.cjs} +4 -4
  107. package/dist/{chunk-NCS2OXX6.cjs.map → chunk-T3TIA3O6.cjs.map} +1 -1
  108. package/dist/{chunk-UVOSITKU.js → chunk-TTHEEIZ3.js} +11 -10
  109. package/dist/chunk-TTHEEIZ3.js.map +1 -0
  110. package/dist/chunk-TVSIG4JE.cjs +940 -0
  111. package/dist/chunk-TVSIG4JE.cjs.map +1 -0
  112. package/dist/{chunk-Y3J45CVZ.js → chunk-U46VIX2V.js} +4 -4
  113. package/dist/{chunk-Y3J45CVZ.js.map → chunk-U46VIX2V.js.map} +1 -1
  114. package/dist/{chunk-G7NVCO5M.js → chunk-WHN4VX55.js} +3 -3
  115. package/dist/{chunk-G7NVCO5M.js.map → chunk-WHN4VX55.js.map} +1 -1
  116. package/dist/{chunk-4US5W7PH.cjs → chunk-WZC6CIVD.cjs} +6 -6
  117. package/dist/{chunk-4US5W7PH.cjs.map → chunk-WZC6CIVD.cjs.map} +1 -1
  118. package/dist/dist-26HWEQY6.js +3 -0
  119. package/dist/dist-26HWEQY6.js.map +1 -0
  120. package/dist/dist-3A5DXB37.cjs +20 -0
  121. package/dist/dist-3A5DXB37.cjs.map +1 -0
  122. package/dist/dist-3SJKQJGY.cjs +16 -0
  123. package/dist/dist-3SJKQJGY.cjs.map +1 -0
  124. package/dist/dist-4ZQSPE5K.js +3 -0
  125. package/dist/dist-4ZQSPE5K.js.map +1 -0
  126. package/dist/dist-5W5QNRTD.js +3 -0
  127. package/dist/dist-5W5QNRTD.js.map +1 -0
  128. package/dist/dist-653SRMPL.js +3 -0
  129. package/dist/dist-653SRMPL.js.map +1 -0
  130. package/dist/dist-6U6EFC5C.cjs +16 -0
  131. package/dist/dist-6U6EFC5C.cjs.map +1 -0
  132. package/dist/dist-7IHNNYMF.cjs +16 -0
  133. package/dist/dist-7IHNNYMF.cjs.map +1 -0
  134. package/dist/dist-B5IPRF6W.js +3 -0
  135. package/dist/dist-B5IPRF6W.js.map +1 -0
  136. package/dist/dist-EOMYFT4Y.cjs +16 -0
  137. package/dist/dist-EOMYFT4Y.cjs.map +1 -0
  138. package/dist/dist-EZZMMMNT.cjs +16 -0
  139. package/dist/dist-EZZMMMNT.cjs.map +1 -0
  140. package/dist/dist-F2ET4MNO.cjs +16 -0
  141. package/dist/dist-F2ET4MNO.cjs.map +1 -0
  142. package/dist/dist-H64VX6DE.js +3 -0
  143. package/dist/dist-H64VX6DE.js.map +1 -0
  144. package/dist/dist-HY7RMLJQ.cjs +16 -0
  145. package/dist/dist-HY7RMLJQ.cjs.map +1 -0
  146. package/dist/dist-M6S4P3FJ.js +3 -0
  147. package/dist/dist-M6S4P3FJ.js.map +1 -0
  148. package/dist/dist-NR7QSCQT.js +3 -0
  149. package/dist/dist-NR7QSCQT.js.map +1 -0
  150. package/dist/dist-QLFMCMCX.js +3 -0
  151. package/dist/dist-QLFMCMCX.js.map +1 -0
  152. package/dist/dist-UY46BFRP.js +3 -0
  153. package/dist/dist-UY46BFRP.js.map +1 -0
  154. package/dist/dist-WCQDRTIV.cjs +16 -0
  155. package/dist/dist-WCQDRTIV.cjs.map +1 -0
  156. package/dist/dist-WKYB3LTJ.cjs +16 -0
  157. package/dist/dist-WKYB3LTJ.cjs.map +1 -0
  158. package/dist/server/a2a/store.cjs +25 -0
  159. package/dist/server/a2a/store.cjs.map +1 -0
  160. package/dist/server/a2a/store.d.ts +3 -3
  161. package/dist/server/a2a/store.d.ts.map +1 -1
  162. package/dist/server/a2a/store.js +23 -0
  163. package/dist/server/a2a/store.js.map +1 -0
  164. package/dist/server/a2a/tasks.d.ts +6 -6
  165. package/dist/server/a2a/tasks.d.ts.map +1 -1
  166. package/dist/server/handlers/a2a.cjs +11 -11
  167. package/dist/server/handlers/a2a.d.ts +16 -14
  168. package/dist/server/handlers/a2a.d.ts.map +1 -1
  169. package/dist/server/handlers/a2a.js +1 -1
  170. package/dist/server/handlers/agent-builder.cjs +68 -0
  171. package/dist/server/handlers/agent-builder.cjs.map +1 -0
  172. package/dist/server/handlers/agent-builder.d.ts +87 -0
  173. package/dist/server/handlers/agent-builder.d.ts.map +1 -0
  174. package/dist/server/handlers/agent-builder.js +3 -0
  175. package/dist/server/handlers/agent-builder.js.map +1 -0
  176. package/dist/server/handlers/agents.cjs +32 -8
  177. package/dist/server/handlers/agents.d.ts +50 -2
  178. package/dist/server/handlers/agents.d.ts.map +1 -1
  179. package/dist/server/handlers/agents.js +1 -1
  180. package/dist/server/handlers/legacyWorkflows.cjs +11 -11
  181. package/dist/server/handlers/legacyWorkflows.d.ts.map +1 -1
  182. package/dist/server/handlers/legacyWorkflows.js +1 -1
  183. package/dist/server/handlers/logs.cjs +4 -4
  184. package/dist/server/handlers/logs.js +1 -1
  185. package/dist/server/handlers/memory.cjs +16 -16
  186. package/dist/server/handlers/memory.d.ts +1 -2
  187. package/dist/server/handlers/memory.d.ts.map +1 -1
  188. package/dist/server/handlers/memory.js +1 -1
  189. package/dist/server/handlers/network.cjs +5 -5
  190. package/dist/server/handlers/network.js +1 -1
  191. package/dist/server/handlers/observability.cjs +16 -0
  192. package/dist/server/handlers/observability.cjs.map +1 -0
  193. package/dist/server/handlers/observability.d.ts +23 -0
  194. package/dist/server/handlers/observability.d.ts.map +1 -0
  195. package/dist/server/handlers/observability.js +3 -0
  196. package/dist/server/handlers/observability.js.map +1 -0
  197. package/dist/server/handlers/scores.cjs +7 -7
  198. package/dist/server/handlers/scores.js +1 -1
  199. package/dist/server/handlers/telemetry.cjs +7 -3
  200. package/dist/server/handlers/telemetry.d.ts +1 -0
  201. package/dist/server/handlers/telemetry.d.ts.map +1 -1
  202. package/dist/server/handlers/telemetry.js +1 -1
  203. package/dist/server/handlers/tools.cjs +9 -5
  204. package/dist/server/handlers/tools.d.ts +4 -0
  205. package/dist/server/handlers/tools.d.ts.map +1 -1
  206. package/dist/server/handlers/tools.js +1 -1
  207. package/dist/server/handlers/utils.cjs +6 -2
  208. package/dist/server/handlers/utils.d.ts +6 -0
  209. package/dist/server/handlers/utils.d.ts.map +1 -1
  210. package/dist/server/handlers/utils.js +1 -1
  211. package/dist/server/handlers/vNextNetwork.cjs +11 -11
  212. package/dist/server/handlers/vNextNetwork.cjs.map +1 -1
  213. package/dist/server/handlers/vNextNetwork.d.ts +9 -9
  214. package/dist/server/handlers/vNextNetwork.d.ts.map +1 -1
  215. package/dist/server/handlers/vNextNetwork.js +7 -7
  216. package/dist/server/handlers/vNextNetwork.js.map +1 -1
  217. package/dist/server/handlers/vector.cjs +7 -7
  218. package/dist/server/handlers/vector.js +1 -1
  219. package/dist/server/handlers/voice.cjs +5 -5
  220. package/dist/server/handlers/voice.js +1 -1
  221. package/dist/server/handlers/workflows.cjs +16 -16
  222. package/dist/server/handlers/workflows.d.ts +7 -22
  223. package/dist/server/handlers/workflows.d.ts.map +1 -1
  224. package/dist/server/handlers/workflows.js +1 -1
  225. package/dist/server/handlers.cjs +44 -34
  226. package/dist/server/handlers.d.ts +2 -0
  227. package/dist/server/handlers.d.ts.map +1 -1
  228. package/dist/server/handlers.js +14 -12
  229. package/dist/server/utils.d.ts +42 -0
  230. package/dist/server/utils.d.ts.map +1 -0
  231. package/package.json +40 -11
  232. package/dist/chunk-2XIJW7SV.cjs.map +0 -1
  233. package/dist/chunk-4QSNRCOT.cjs.map +0 -1
  234. package/dist/chunk-7FHF55WA.js.map +0 -1
  235. package/dist/chunk-BUOJL3MN.js.map +0 -1
  236. package/dist/chunk-GASWM5HJ.cjs.map +0 -1
  237. package/dist/chunk-GX25CWC7.cjs.map +0 -1
  238. package/dist/chunk-ILCWPBYQ.cjs.map +0 -1
  239. package/dist/chunk-JGVY3KWV.cjs.map +0 -1
  240. package/dist/chunk-LRUH33B4.cjs.map +0 -1
  241. package/dist/chunk-O4I563YW.cjs.map +0 -1
  242. package/dist/chunk-OW4FX5TS.js.map +0 -1
  243. package/dist/chunk-PZ5AY32C.js +0 -9
  244. package/dist/chunk-Q7SFCCGT.cjs +0 -11
  245. package/dist/chunk-S37KCGOR.cjs.map +0 -1
  246. package/dist/chunk-SQ7KKIH3.js.map +0 -1
  247. package/dist/chunk-TRWPUPGD.js.map +0 -1
  248. package/dist/chunk-TXAQU2XN.js.map +0 -1
  249. package/dist/chunk-UVOSITKU.js.map +0 -1
  250. package/dist/chunk-VIGPWTDA.cjs.map +0 -1
  251. package/dist/chunk-VOY6MGKA.js.map +0 -1
  252. package/dist/chunk-YS66MFDY.js.map +0 -1
  253. package/dist/chunk-ZKJZQN24.js.map +0 -1
@@ -0,0 +1,845 @@
1
+ import { createJsonErrorResponseHandler, createProviderDefinedToolFactory, withoutTrailingSlash, loadApiKey, parseProviderOptions, postJsonToApi, createJsonResponseHandler, combineHeaders, generateId, createEventSourceResponseHandler, InvalidResponseDataError, isParsableJson, UnsupportedFunctionalityError, convertToBase64, NoSuchModelError, convertBase64ToUint8Array, postFormDataToApi } from './chunk-N7F33WAD.js';
2
+ import { z } from 'zod/v4';
3
+
4
+ function convertToGroqChatMessages(prompt) {
5
+ const messages = [];
6
+ for (const { role, content } of prompt) {
7
+ switch (role) {
8
+ case "system": {
9
+ messages.push({ role: "system", content });
10
+ break;
11
+ }
12
+ case "user": {
13
+ if (content.length === 1 && content[0].type === "text") {
14
+ messages.push({ role: "user", content: content[0].text });
15
+ break;
16
+ }
17
+ messages.push({
18
+ role: "user",
19
+ content: content.map((part) => {
20
+ switch (part.type) {
21
+ case "text": {
22
+ return { type: "text", text: part.text };
23
+ }
24
+ case "file": {
25
+ if (!part.mediaType.startsWith("image/")) {
26
+ throw new UnsupportedFunctionalityError({
27
+ functionality: "Non-image file content parts"
28
+ });
29
+ }
30
+ const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
31
+ return {
32
+ type: "image_url",
33
+ image_url: {
34
+ url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`
35
+ }
36
+ };
37
+ }
38
+ }
39
+ })
40
+ });
41
+ break;
42
+ }
43
+ case "assistant": {
44
+ let text = "";
45
+ let reasoning = "";
46
+ const toolCalls = [];
47
+ for (const part of content) {
48
+ switch (part.type) {
49
+ // groq supports reasoning for tool-calls in multi-turn conversations
50
+ // https://github.com/vercel/ai/issues/7860
51
+ case "reasoning": {
52
+ reasoning += part.text;
53
+ break;
54
+ }
55
+ case "text": {
56
+ text += part.text;
57
+ break;
58
+ }
59
+ case "tool-call": {
60
+ toolCalls.push({
61
+ id: part.toolCallId,
62
+ type: "function",
63
+ function: {
64
+ name: part.toolName,
65
+ arguments: JSON.stringify(part.input)
66
+ }
67
+ });
68
+ break;
69
+ }
70
+ }
71
+ }
72
+ messages.push({
73
+ role: "assistant",
74
+ content: text,
75
+ ...reasoning.length > 0 ? { reasoning } : null,
76
+ ...toolCalls.length > 0 ? { tool_calls: toolCalls } : null
77
+ });
78
+ break;
79
+ }
80
+ case "tool": {
81
+ for (const toolResponse of content) {
82
+ const output = toolResponse.output;
83
+ let contentValue;
84
+ switch (output.type) {
85
+ case "text":
86
+ case "error-text":
87
+ contentValue = output.value;
88
+ break;
89
+ case "content":
90
+ case "json":
91
+ case "error-json":
92
+ contentValue = JSON.stringify(output.value);
93
+ break;
94
+ }
95
+ messages.push({
96
+ role: "tool",
97
+ tool_call_id: toolResponse.toolCallId,
98
+ content: contentValue
99
+ });
100
+ }
101
+ break;
102
+ }
103
+ default: {
104
+ const _exhaustiveCheck = role;
105
+ throw new Error(`Unsupported role: ${_exhaustiveCheck}`);
106
+ }
107
+ }
108
+ }
109
+ return messages;
110
+ }
111
+ function getResponseMetadata({
112
+ id,
113
+ model,
114
+ created
115
+ }) {
116
+ return {
117
+ id: id != null ? id : void 0,
118
+ modelId: model != null ? model : void 0,
119
+ timestamp: created != null ? new Date(created * 1e3) : void 0
120
+ };
121
+ }
122
+ var groqProviderOptions = z.object({
123
+ reasoningFormat: z.enum(["parsed", "raw", "hidden"]).optional(),
124
+ reasoningEffort: z.string().optional(),
125
+ /**
126
+ * Whether to enable parallel function calling during tool use. Default to true.
127
+ */
128
+ parallelToolCalls: z.boolean().optional(),
129
+ /**
130
+ * A unique identifier representing your end-user, which can help OpenAI to
131
+ * monitor and detect abuse. Learn more.
132
+ */
133
+ user: z.string().optional(),
134
+ /**
135
+ * Whether to use structured outputs.
136
+ *
137
+ * @default true
138
+ */
139
+ structuredOutputs: z.boolean().optional()
140
+ });
141
+ var groqErrorDataSchema = z.object({
142
+ error: z.object({
143
+ message: z.string(),
144
+ type: z.string()
145
+ })
146
+ });
147
+ var groqFailedResponseHandler = createJsonErrorResponseHandler({
148
+ errorSchema: groqErrorDataSchema,
149
+ errorToMessage: (data) => data.error.message
150
+ });
151
+ var BROWSER_SEARCH_SUPPORTED_MODELS = [
152
+ "openai/gpt-oss-20b",
153
+ "openai/gpt-oss-120b"
154
+ ];
155
+ function isBrowserSearchSupportedModel(modelId) {
156
+ return BROWSER_SEARCH_SUPPORTED_MODELS.includes(modelId);
157
+ }
158
+ function getSupportedModelsString() {
159
+ return BROWSER_SEARCH_SUPPORTED_MODELS.join(", ");
160
+ }
161
+ function prepareTools({
162
+ tools,
163
+ toolChoice,
164
+ modelId
165
+ }) {
166
+ tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
167
+ const toolWarnings = [];
168
+ if (tools == null) {
169
+ return { tools: void 0, toolChoice: void 0, toolWarnings };
170
+ }
171
+ const groqTools2 = [];
172
+ for (const tool of tools) {
173
+ if (tool.type === "provider-defined") {
174
+ if (tool.id === "groq.browser_search") {
175
+ if (!isBrowserSearchSupportedModel(modelId)) {
176
+ toolWarnings.push({
177
+ type: "unsupported-tool",
178
+ tool,
179
+ details: `Browser search is only supported on the following models: ${getSupportedModelsString()}. Current model: ${modelId}`
180
+ });
181
+ } else {
182
+ groqTools2.push({
183
+ type: "browser_search"
184
+ });
185
+ }
186
+ } else {
187
+ toolWarnings.push({ type: "unsupported-tool", tool });
188
+ }
189
+ } else {
190
+ groqTools2.push({
191
+ type: "function",
192
+ function: {
193
+ name: tool.name,
194
+ description: tool.description,
195
+ parameters: tool.inputSchema
196
+ }
197
+ });
198
+ }
199
+ }
200
+ if (toolChoice == null) {
201
+ return { tools: groqTools2, toolChoice: void 0, toolWarnings };
202
+ }
203
+ const type = toolChoice.type;
204
+ switch (type) {
205
+ case "auto":
206
+ case "none":
207
+ case "required":
208
+ return { tools: groqTools2, toolChoice: type, toolWarnings };
209
+ case "tool":
210
+ return {
211
+ tools: groqTools2,
212
+ toolChoice: {
213
+ type: "function",
214
+ function: {
215
+ name: toolChoice.toolName
216
+ }
217
+ },
218
+ toolWarnings
219
+ };
220
+ default: {
221
+ const _exhaustiveCheck = type;
222
+ throw new UnsupportedFunctionalityError({
223
+ functionality: `tool choice type: ${_exhaustiveCheck}`
224
+ });
225
+ }
226
+ }
227
+ }
228
+ function mapGroqFinishReason(finishReason) {
229
+ switch (finishReason) {
230
+ case "stop":
231
+ return "stop";
232
+ case "length":
233
+ return "length";
234
+ case "content_filter":
235
+ return "content-filter";
236
+ case "function_call":
237
+ case "tool_calls":
238
+ return "tool-calls";
239
+ default:
240
+ return "unknown";
241
+ }
242
+ }
243
+ var GroqChatLanguageModel = class {
244
+ constructor(modelId, config) {
245
+ this.specificationVersion = "v2";
246
+ this.supportedUrls = {
247
+ "image/*": [/^https?:\/\/.*$/]
248
+ };
249
+ this.modelId = modelId;
250
+ this.config = config;
251
+ }
252
+ get provider() {
253
+ return this.config.provider;
254
+ }
255
+ async getArgs({
256
+ prompt,
257
+ maxOutputTokens,
258
+ temperature,
259
+ topP,
260
+ topK,
261
+ frequencyPenalty,
262
+ presencePenalty,
263
+ stopSequences,
264
+ responseFormat,
265
+ seed,
266
+ stream,
267
+ tools,
268
+ toolChoice,
269
+ providerOptions
270
+ }) {
271
+ var _a, _b;
272
+ const warnings = [];
273
+ const groqOptions = await parseProviderOptions({
274
+ provider: "groq",
275
+ providerOptions,
276
+ schema: groqProviderOptions
277
+ });
278
+ const structuredOutputs = (_a = groqOptions == null ? void 0 : groqOptions.structuredOutputs) != null ? _a : true;
279
+ if (topK != null) {
280
+ warnings.push({
281
+ type: "unsupported-setting",
282
+ setting: "topK"
283
+ });
284
+ }
285
+ if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
286
+ warnings.push({
287
+ type: "unsupported-setting",
288
+ setting: "responseFormat",
289
+ details: "JSON response format schema is only supported with structuredOutputs"
290
+ });
291
+ }
292
+ const {
293
+ tools: groqTools2,
294
+ toolChoice: groqToolChoice,
295
+ toolWarnings
296
+ } = prepareTools({ tools, toolChoice, modelId: this.modelId });
297
+ return {
298
+ args: {
299
+ // model id:
300
+ model: this.modelId,
301
+ // model specific settings:
302
+ user: groqOptions == null ? void 0 : groqOptions.user,
303
+ parallel_tool_calls: groqOptions == null ? void 0 : groqOptions.parallelToolCalls,
304
+ // standardized settings:
305
+ max_tokens: maxOutputTokens,
306
+ temperature,
307
+ top_p: topP,
308
+ frequency_penalty: frequencyPenalty,
309
+ presence_penalty: presencePenalty,
310
+ stop: stopSequences,
311
+ seed,
312
+ // response format:
313
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? structuredOutputs && responseFormat.schema != null ? {
314
+ type: "json_schema",
315
+ json_schema: {
316
+ schema: responseFormat.schema,
317
+ name: (_b = responseFormat.name) != null ? _b : "response",
318
+ description: responseFormat.description
319
+ }
320
+ } : { type: "json_object" } : void 0,
321
+ // provider options:
322
+ reasoning_format: groqOptions == null ? void 0 : groqOptions.reasoningFormat,
323
+ reasoning_effort: groqOptions == null ? void 0 : groqOptions.reasoningEffort,
324
+ // messages:
325
+ messages: convertToGroqChatMessages(prompt),
326
+ // tools:
327
+ tools: groqTools2,
328
+ tool_choice: groqToolChoice
329
+ },
330
+ warnings: [...warnings, ...toolWarnings]
331
+ };
332
+ }
333
+ async doGenerate(options) {
334
+ var _a, _b, _c, _d, _e, _f, _g;
335
+ const { args, warnings } = await this.getArgs({
336
+ ...options,
337
+ stream: false
338
+ });
339
+ const body = JSON.stringify(args);
340
+ const {
341
+ responseHeaders,
342
+ value: response,
343
+ rawValue: rawResponse
344
+ } = await postJsonToApi({
345
+ url: this.config.url({
346
+ path: "/chat/completions",
347
+ modelId: this.modelId
348
+ }),
349
+ headers: combineHeaders(this.config.headers(), options.headers),
350
+ body: args,
351
+ failedResponseHandler: groqFailedResponseHandler,
352
+ successfulResponseHandler: createJsonResponseHandler(
353
+ groqChatResponseSchema
354
+ ),
355
+ abortSignal: options.abortSignal,
356
+ fetch: this.config.fetch
357
+ });
358
+ const choice = response.choices[0];
359
+ const content = [];
360
+ const text = choice.message.content;
361
+ if (text != null && text.length > 0) {
362
+ content.push({ type: "text", text });
363
+ }
364
+ const reasoning = choice.message.reasoning;
365
+ if (reasoning != null && reasoning.length > 0) {
366
+ content.push({
367
+ type: "reasoning",
368
+ text: reasoning
369
+ });
370
+ }
371
+ if (choice.message.tool_calls != null) {
372
+ for (const toolCall of choice.message.tool_calls) {
373
+ content.push({
374
+ type: "tool-call",
375
+ toolCallId: (_a = toolCall.id) != null ? _a : generateId(),
376
+ toolName: toolCall.function.name,
377
+ input: toolCall.function.arguments
378
+ });
379
+ }
380
+ }
381
+ return {
382
+ content,
383
+ finishReason: mapGroqFinishReason(choice.finish_reason),
384
+ usage: {
385
+ inputTokens: (_c = (_b = response.usage) == null ? void 0 : _b.prompt_tokens) != null ? _c : void 0,
386
+ outputTokens: (_e = (_d = response.usage) == null ? void 0 : _d.completion_tokens) != null ? _e : void 0,
387
+ totalTokens: (_g = (_f = response.usage) == null ? void 0 : _f.total_tokens) != null ? _g : void 0
388
+ },
389
+ response: {
390
+ ...getResponseMetadata(response),
391
+ headers: responseHeaders,
392
+ body: rawResponse
393
+ },
394
+ warnings,
395
+ request: { body }
396
+ };
397
+ }
398
+ async doStream(options) {
399
+ const { args, warnings } = await this.getArgs({ ...options, stream: true });
400
+ const body = JSON.stringify({ ...args, stream: true });
401
+ const { responseHeaders, value: response } = await postJsonToApi({
402
+ url: this.config.url({
403
+ path: "/chat/completions",
404
+ modelId: this.modelId
405
+ }),
406
+ headers: combineHeaders(this.config.headers(), options.headers),
407
+ body: {
408
+ ...args,
409
+ stream: true
410
+ },
411
+ failedResponseHandler: groqFailedResponseHandler,
412
+ successfulResponseHandler: createEventSourceResponseHandler(groqChatChunkSchema),
413
+ abortSignal: options.abortSignal,
414
+ fetch: this.config.fetch
415
+ });
416
+ const toolCalls = [];
417
+ let finishReason = "unknown";
418
+ const usage = {
419
+ inputTokens: void 0,
420
+ outputTokens: void 0,
421
+ totalTokens: void 0
422
+ };
423
+ let isFirstChunk = true;
424
+ let isActiveText = false;
425
+ let isActiveReasoning = false;
426
+ return {
427
+ stream: response.pipeThrough(
428
+ new TransformStream({
429
+ start(controller) {
430
+ controller.enqueue({ type: "stream-start", warnings });
431
+ },
432
+ transform(chunk, controller) {
433
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
434
+ if (options.includeRawChunks) {
435
+ controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
436
+ }
437
+ if (!chunk.success) {
438
+ finishReason = "error";
439
+ controller.enqueue({ type: "error", error: chunk.error });
440
+ return;
441
+ }
442
+ const value = chunk.value;
443
+ if ("error" in value) {
444
+ finishReason = "error";
445
+ controller.enqueue({ type: "error", error: value.error });
446
+ return;
447
+ }
448
+ if (isFirstChunk) {
449
+ isFirstChunk = false;
450
+ controller.enqueue({
451
+ type: "response-metadata",
452
+ ...getResponseMetadata(value)
453
+ });
454
+ }
455
+ if (((_a = value.x_groq) == null ? void 0 : _a.usage) != null) {
456
+ usage.inputTokens = (_b = value.x_groq.usage.prompt_tokens) != null ? _b : void 0;
457
+ usage.outputTokens = (_c = value.x_groq.usage.completion_tokens) != null ? _c : void 0;
458
+ usage.totalTokens = (_d = value.x_groq.usage.total_tokens) != null ? _d : void 0;
459
+ }
460
+ const choice = value.choices[0];
461
+ if ((choice == null ? void 0 : choice.finish_reason) != null) {
462
+ finishReason = mapGroqFinishReason(choice.finish_reason);
463
+ }
464
+ if ((choice == null ? void 0 : choice.delta) == null) {
465
+ return;
466
+ }
467
+ const delta = choice.delta;
468
+ if (delta.reasoning != null && delta.reasoning.length > 0) {
469
+ if (!isActiveReasoning) {
470
+ controller.enqueue({
471
+ type: "reasoning-start",
472
+ id: "reasoning-0"
473
+ });
474
+ isActiveReasoning = true;
475
+ }
476
+ controller.enqueue({
477
+ type: "reasoning-delta",
478
+ id: "reasoning-0",
479
+ delta: delta.reasoning
480
+ });
481
+ }
482
+ if (delta.content != null && delta.content.length > 0) {
483
+ if (!isActiveText) {
484
+ controller.enqueue({ type: "text-start", id: "txt-0" });
485
+ isActiveText = true;
486
+ }
487
+ controller.enqueue({
488
+ type: "text-delta",
489
+ id: "txt-0",
490
+ delta: delta.content
491
+ });
492
+ }
493
+ if (delta.tool_calls != null) {
494
+ for (const toolCallDelta of delta.tool_calls) {
495
+ const index = toolCallDelta.index;
496
+ if (toolCalls[index] == null) {
497
+ if (toolCallDelta.type !== "function") {
498
+ throw new InvalidResponseDataError({
499
+ data: toolCallDelta,
500
+ message: `Expected 'function' type.`
501
+ });
502
+ }
503
+ if (toolCallDelta.id == null) {
504
+ throw new InvalidResponseDataError({
505
+ data: toolCallDelta,
506
+ message: `Expected 'id' to be a string.`
507
+ });
508
+ }
509
+ if (((_e = toolCallDelta.function) == null ? void 0 : _e.name) == null) {
510
+ throw new InvalidResponseDataError({
511
+ data: toolCallDelta,
512
+ message: `Expected 'function.name' to be a string.`
513
+ });
514
+ }
515
+ controller.enqueue({
516
+ type: "tool-input-start",
517
+ id: toolCallDelta.id,
518
+ toolName: toolCallDelta.function.name
519
+ });
520
+ toolCalls[index] = {
521
+ id: toolCallDelta.id,
522
+ type: "function",
523
+ function: {
524
+ name: toolCallDelta.function.name,
525
+ arguments: (_f = toolCallDelta.function.arguments) != null ? _f : ""
526
+ },
527
+ hasFinished: false
528
+ };
529
+ const toolCall2 = toolCalls[index];
530
+ if (((_g = toolCall2.function) == null ? void 0 : _g.name) != null && ((_h = toolCall2.function) == null ? void 0 : _h.arguments) != null) {
531
+ if (toolCall2.function.arguments.length > 0) {
532
+ controller.enqueue({
533
+ type: "tool-input-delta",
534
+ id: toolCall2.id,
535
+ delta: toolCall2.function.arguments
536
+ });
537
+ }
538
+ if (isParsableJson(toolCall2.function.arguments)) {
539
+ controller.enqueue({
540
+ type: "tool-input-end",
541
+ id: toolCall2.id
542
+ });
543
+ controller.enqueue({
544
+ type: "tool-call",
545
+ toolCallId: (_i = toolCall2.id) != null ? _i : generateId(),
546
+ toolName: toolCall2.function.name,
547
+ input: toolCall2.function.arguments
548
+ });
549
+ toolCall2.hasFinished = true;
550
+ }
551
+ }
552
+ continue;
553
+ }
554
+ const toolCall = toolCalls[index];
555
+ if (toolCall.hasFinished) {
556
+ continue;
557
+ }
558
+ if (((_j = toolCallDelta.function) == null ? void 0 : _j.arguments) != null) {
559
+ toolCall.function.arguments += (_l = (_k = toolCallDelta.function) == null ? void 0 : _k.arguments) != null ? _l : "";
560
+ }
561
+ controller.enqueue({
562
+ type: "tool-input-delta",
563
+ id: toolCall.id,
564
+ delta: (_m = toolCallDelta.function.arguments) != null ? _m : ""
565
+ });
566
+ if (((_n = toolCall.function) == null ? void 0 : _n.name) != null && ((_o = toolCall.function) == null ? void 0 : _o.arguments) != null && isParsableJson(toolCall.function.arguments)) {
567
+ controller.enqueue({
568
+ type: "tool-input-end",
569
+ id: toolCall.id
570
+ });
571
+ controller.enqueue({
572
+ type: "tool-call",
573
+ toolCallId: (_p = toolCall.id) != null ? _p : generateId(),
574
+ toolName: toolCall.function.name,
575
+ input: toolCall.function.arguments
576
+ });
577
+ toolCall.hasFinished = true;
578
+ }
579
+ }
580
+ }
581
+ },
582
+ flush(controller) {
583
+ if (isActiveReasoning) {
584
+ controller.enqueue({ type: "reasoning-end", id: "reasoning-0" });
585
+ }
586
+ if (isActiveText) {
587
+ controller.enqueue({ type: "text-end", id: "txt-0" });
588
+ }
589
+ controller.enqueue({
590
+ type: "finish",
591
+ finishReason,
592
+ usage,
593
+ ...{}
594
+ });
595
+ }
596
+ })
597
+ ),
598
+ request: { body },
599
+ response: { headers: responseHeaders }
600
+ };
601
+ }
602
+ };
603
+ var groqChatResponseSchema = z.object({
604
+ id: z.string().nullish(),
605
+ created: z.number().nullish(),
606
+ model: z.string().nullish(),
607
+ choices: z.array(
608
+ z.object({
609
+ message: z.object({
610
+ content: z.string().nullish(),
611
+ reasoning: z.string().nullish(),
612
+ tool_calls: z.array(
613
+ z.object({
614
+ id: z.string().nullish(),
615
+ type: z.literal("function"),
616
+ function: z.object({
617
+ name: z.string(),
618
+ arguments: z.string()
619
+ })
620
+ })
621
+ ).nullish()
622
+ }),
623
+ index: z.number(),
624
+ finish_reason: z.string().nullish()
625
+ })
626
+ ),
627
+ usage: z.object({
628
+ prompt_tokens: z.number().nullish(),
629
+ completion_tokens: z.number().nullish(),
630
+ total_tokens: z.number().nullish()
631
+ }).nullish()
632
+ });
633
+ var groqChatChunkSchema = z.union([
634
+ z.object({
635
+ id: z.string().nullish(),
636
+ created: z.number().nullish(),
637
+ model: z.string().nullish(),
638
+ choices: z.array(
639
+ z.object({
640
+ delta: z.object({
641
+ content: z.string().nullish(),
642
+ reasoning: z.string().nullish(),
643
+ tool_calls: z.array(
644
+ z.object({
645
+ index: z.number(),
646
+ id: z.string().nullish(),
647
+ type: z.literal("function").optional(),
648
+ function: z.object({
649
+ name: z.string().nullish(),
650
+ arguments: z.string().nullish()
651
+ })
652
+ })
653
+ ).nullish()
654
+ }).nullish(),
655
+ finish_reason: z.string().nullable().optional(),
656
+ index: z.number()
657
+ })
658
+ ),
659
+ x_groq: z.object({
660
+ usage: z.object({
661
+ prompt_tokens: z.number().nullish(),
662
+ completion_tokens: z.number().nullish(),
663
+ total_tokens: z.number().nullish()
664
+ }).nullish()
665
+ }).nullish()
666
+ }),
667
+ groqErrorDataSchema
668
+ ]);
669
+ var groqProviderOptionsSchema = z.object({
670
+ language: z.string().nullish(),
671
+ prompt: z.string().nullish(),
672
+ responseFormat: z.string().nullish(),
673
+ temperature: z.number().min(0).max(1).nullish(),
674
+ timestampGranularities: z.array(z.string()).nullish()
675
+ });
676
+ var GroqTranscriptionModel = class {
677
+ constructor(modelId, config) {
678
+ this.modelId = modelId;
679
+ this.config = config;
680
+ this.specificationVersion = "v2";
681
+ }
682
+ get provider() {
683
+ return this.config.provider;
684
+ }
685
+ async getArgs({
686
+ audio,
687
+ mediaType,
688
+ providerOptions
689
+ }) {
690
+ var _a, _b, _c, _d, _e;
691
+ const warnings = [];
692
+ const groqOptions = await parseProviderOptions({
693
+ provider: "groq",
694
+ providerOptions,
695
+ schema: groqProviderOptionsSchema
696
+ });
697
+ const formData = new FormData();
698
+ const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array(audio)]);
699
+ formData.append("model", this.modelId);
700
+ formData.append("file", new File([blob], "audio", { type: mediaType }));
701
+ if (groqOptions) {
702
+ const transcriptionModelOptions = {
703
+ language: (_a = groqOptions.language) != null ? _a : void 0,
704
+ prompt: (_b = groqOptions.prompt) != null ? _b : void 0,
705
+ response_format: (_c = groqOptions.responseFormat) != null ? _c : void 0,
706
+ temperature: (_d = groqOptions.temperature) != null ? _d : void 0,
707
+ timestamp_granularities: (_e = groqOptions.timestampGranularities) != null ? _e : void 0
708
+ };
709
+ for (const key in transcriptionModelOptions) {
710
+ const value = transcriptionModelOptions[key];
711
+ if (value !== void 0) {
712
+ formData.append(key, String(value));
713
+ }
714
+ }
715
+ }
716
+ return {
717
+ formData,
718
+ warnings
719
+ };
720
+ }
721
+ async doGenerate(options) {
722
+ var _a, _b, _c, _d, _e;
723
+ const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
724
+ const { formData, warnings } = await this.getArgs(options);
725
+ const {
726
+ value: response,
727
+ responseHeaders,
728
+ rawValue: rawResponse
729
+ } = await postFormDataToApi({
730
+ url: this.config.url({
731
+ path: "/audio/transcriptions",
732
+ modelId: this.modelId
733
+ }),
734
+ headers: combineHeaders(this.config.headers(), options.headers),
735
+ formData,
736
+ failedResponseHandler: groqFailedResponseHandler,
737
+ successfulResponseHandler: createJsonResponseHandler(
738
+ groqTranscriptionResponseSchema
739
+ ),
740
+ abortSignal: options.abortSignal,
741
+ fetch: this.config.fetch
742
+ });
743
+ return {
744
+ text: response.text,
745
+ segments: (_e = (_d = response.segments) == null ? void 0 : _d.map((segment) => ({
746
+ text: segment.text,
747
+ startSecond: segment.start,
748
+ endSecond: segment.end
749
+ }))) != null ? _e : [],
750
+ language: response.language,
751
+ durationInSeconds: response.duration,
752
+ warnings,
753
+ response: {
754
+ timestamp: currentDate,
755
+ modelId: this.modelId,
756
+ headers: responseHeaders,
757
+ body: rawResponse
758
+ }
759
+ };
760
+ }
761
+ };
762
+ var groqTranscriptionResponseSchema = z.object({
763
+ task: z.string(),
764
+ language: z.string(),
765
+ duration: z.number(),
766
+ text: z.string(),
767
+ segments: z.array(
768
+ z.object({
769
+ id: z.number(),
770
+ seek: z.number(),
771
+ start: z.number(),
772
+ end: z.number(),
773
+ text: z.string(),
774
+ tokens: z.array(z.number()),
775
+ temperature: z.number(),
776
+ avg_logprob: z.number(),
777
+ compression_ratio: z.number(),
778
+ no_speech_prob: z.number()
779
+ })
780
+ ),
781
+ x_groq: z.object({
782
+ id: z.string()
783
+ })
784
+ });
785
+ var browserSearch = createProviderDefinedToolFactory({
786
+ id: "groq.browser_search",
787
+ name: "browser_search",
788
+ inputSchema: z.object({})
789
+ });
790
+ var groqTools = {
791
+ browserSearch
792
+ };
793
+ function createGroq(options = {}) {
794
+ var _a;
795
+ const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a : "https://api.groq.com/openai/v1";
796
+ const getHeaders = () => ({
797
+ Authorization: `Bearer ${loadApiKey({
798
+ apiKey: options.apiKey,
799
+ environmentVariableName: "GROQ_API_KEY",
800
+ description: "Groq"
801
+ })}`,
802
+ ...options.headers
803
+ });
804
+ const createChatModel = (modelId) => new GroqChatLanguageModel(modelId, {
805
+ provider: "groq.chat",
806
+ url: ({ path }) => `${baseURL}${path}`,
807
+ headers: getHeaders,
808
+ fetch: options.fetch
809
+ });
810
+ const createLanguageModel = (modelId) => {
811
+ if (new.target) {
812
+ throw new Error(
813
+ "The Groq model function cannot be called with the new keyword."
814
+ );
815
+ }
816
+ return createChatModel(modelId);
817
+ };
818
+ const createTranscriptionModel = (modelId) => {
819
+ return new GroqTranscriptionModel(modelId, {
820
+ provider: "groq.transcription",
821
+ url: ({ path }) => `${baseURL}${path}`,
822
+ headers: getHeaders,
823
+ fetch: options.fetch
824
+ });
825
+ };
826
+ const provider = function(modelId) {
827
+ return createLanguageModel(modelId);
828
+ };
829
+ provider.languageModel = createLanguageModel;
830
+ provider.chat = createChatModel;
831
+ provider.textEmbeddingModel = (modelId) => {
832
+ throw new NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
833
+ };
834
+ provider.imageModel = (modelId) => {
835
+ throw new NoSuchModelError({ modelId, modelType: "imageModel" });
836
+ };
837
+ provider.transcription = createTranscriptionModel;
838
+ provider.tools = groqTools;
839
+ return provider;
840
+ }
841
+ var groq = createGroq();
842
+
843
+ export { browserSearch, createGroq, groq };
844
+ //# sourceMappingURL=chunk-EMNGA4R4.js.map
845
+ //# sourceMappingURL=chunk-EMNGA4R4.js.map