@anthropic-ai/claude-code 0.2.29 → 0.2.30

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 (415) hide show
  1. package/cli.mjs +442 -690
  2. package/package.json +1 -5
  3. package/vendor/sdk/CHANGELOG.md +0 -1421
  4. package/vendor/sdk/LICENSE +0 -8
  5. package/vendor/sdk/README.md +0 -536
  6. package/vendor/sdk/_shims/MultipartBody.d.ts +0 -9
  7. package/vendor/sdk/_shims/MultipartBody.d.ts.map +0 -1
  8. package/vendor/sdk/_shims/MultipartBody.js +0 -16
  9. package/vendor/sdk/_shims/MultipartBody.js.map +0 -1
  10. package/vendor/sdk/_shims/MultipartBody.mjs +0 -12
  11. package/vendor/sdk/_shims/MultipartBody.mjs.map +0 -1
  12. package/vendor/sdk/_shims/README.md +0 -46
  13. package/vendor/sdk/_shims/auto/runtime-bun.d.ts +0 -5
  14. package/vendor/sdk/_shims/auto/runtime-bun.d.ts.map +0 -1
  15. package/vendor/sdk/_shims/auto/runtime-bun.js +0 -21
  16. package/vendor/sdk/_shims/auto/runtime-bun.js.map +0 -1
  17. package/vendor/sdk/_shims/auto/runtime-bun.mjs +0 -2
  18. package/vendor/sdk/_shims/auto/runtime-bun.mjs.map +0 -1
  19. package/vendor/sdk/_shims/auto/runtime-node.d.ts +0 -5
  20. package/vendor/sdk/_shims/auto/runtime-node.d.ts.map +0 -1
  21. package/vendor/sdk/_shims/auto/runtime-node.js +0 -21
  22. package/vendor/sdk/_shims/auto/runtime-node.js.map +0 -1
  23. package/vendor/sdk/_shims/auto/runtime-node.mjs +0 -2
  24. package/vendor/sdk/_shims/auto/runtime-node.mjs.map +0 -1
  25. package/vendor/sdk/_shims/auto/runtime.d.ts +0 -5
  26. package/vendor/sdk/_shims/auto/runtime.d.ts.map +0 -1
  27. package/vendor/sdk/_shims/auto/runtime.js +0 -21
  28. package/vendor/sdk/_shims/auto/runtime.js.map +0 -1
  29. package/vendor/sdk/_shims/auto/runtime.mjs +0 -2
  30. package/vendor/sdk/_shims/auto/runtime.mjs.map +0 -1
  31. package/vendor/sdk/_shims/auto/types-node.d.ts +0 -5
  32. package/vendor/sdk/_shims/auto/types-node.d.ts.map +0 -1
  33. package/vendor/sdk/_shims/auto/types-node.js +0 -21
  34. package/vendor/sdk/_shims/auto/types-node.js.map +0 -1
  35. package/vendor/sdk/_shims/auto/types-node.mjs +0 -2
  36. package/vendor/sdk/_shims/auto/types-node.mjs.map +0 -1
  37. package/vendor/sdk/_shims/auto/types.d.ts +0 -101
  38. package/vendor/sdk/_shims/auto/types.js +0 -3
  39. package/vendor/sdk/_shims/auto/types.mjs +0 -3
  40. package/vendor/sdk/_shims/bun-runtime.d.ts +0 -6
  41. package/vendor/sdk/_shims/bun-runtime.d.ts.map +0 -1
  42. package/vendor/sdk/_shims/bun-runtime.js +0 -14
  43. package/vendor/sdk/_shims/bun-runtime.js.map +0 -1
  44. package/vendor/sdk/_shims/bun-runtime.mjs +0 -10
  45. package/vendor/sdk/_shims/bun-runtime.mjs.map +0 -1
  46. package/vendor/sdk/_shims/index.d.ts +0 -81
  47. package/vendor/sdk/_shims/index.js +0 -13
  48. package/vendor/sdk/_shims/index.mjs +0 -7
  49. package/vendor/sdk/_shims/manual-types.d.ts +0 -12
  50. package/vendor/sdk/_shims/manual-types.js +0 -3
  51. package/vendor/sdk/_shims/manual-types.mjs +0 -3
  52. package/vendor/sdk/_shims/node-runtime.d.ts +0 -3
  53. package/vendor/sdk/_shims/node-runtime.d.ts.map +0 -1
  54. package/vendor/sdk/_shims/node-runtime.js +0 -89
  55. package/vendor/sdk/_shims/node-runtime.js.map +0 -1
  56. package/vendor/sdk/_shims/node-runtime.mjs +0 -56
  57. package/vendor/sdk/_shims/node-runtime.mjs.map +0 -1
  58. package/vendor/sdk/_shims/node-types.d.ts +0 -42
  59. package/vendor/sdk/_shims/node-types.js +0 -3
  60. package/vendor/sdk/_shims/node-types.mjs +0 -3
  61. package/vendor/sdk/_shims/registry.d.ts +0 -37
  62. package/vendor/sdk/_shims/registry.d.ts.map +0 -1
  63. package/vendor/sdk/_shims/registry.js +0 -41
  64. package/vendor/sdk/_shims/registry.js.map +0 -1
  65. package/vendor/sdk/_shims/registry.mjs +0 -37
  66. package/vendor/sdk/_shims/registry.mjs.map +0 -1
  67. package/vendor/sdk/_shims/web-runtime.d.ts +0 -5
  68. package/vendor/sdk/_shims/web-runtime.d.ts.map +0 -1
  69. package/vendor/sdk/_shims/web-runtime.js +0 -78
  70. package/vendor/sdk/_shims/web-runtime.js.map +0 -1
  71. package/vendor/sdk/_shims/web-runtime.mjs +0 -71
  72. package/vendor/sdk/_shims/web-runtime.mjs.map +0 -1
  73. package/vendor/sdk/_shims/web-types.d.ts +0 -83
  74. package/vendor/sdk/_shims/web-types.js +0 -3
  75. package/vendor/sdk/_shims/web-types.mjs +0 -3
  76. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts +0 -3
  77. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts.map +0 -1
  78. package/vendor/sdk/_vendor/partial-json-parser/parser.js +0 -226
  79. package/vendor/sdk/_vendor/partial-json-parser/parser.js.map +0 -1
  80. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs +0 -223
  81. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs.map +0 -1
  82. package/vendor/sdk/core.d.ts +0 -248
  83. package/vendor/sdk/core.d.ts.map +0 -1
  84. package/vendor/sdk/core.js +0 -935
  85. package/vendor/sdk/core.js.map +0 -1
  86. package/vendor/sdk/core.mjs +0 -903
  87. package/vendor/sdk/core.mjs.map +0 -1
  88. package/vendor/sdk/error.d.ts +0 -48
  89. package/vendor/sdk/error.d.ts.map +0 -1
  90. package/vendor/sdk/error.js +0 -114
  91. package/vendor/sdk/error.js.map +0 -1
  92. package/vendor/sdk/error.mjs +0 -98
  93. package/vendor/sdk/error.mjs.map +0 -1
  94. package/vendor/sdk/index.d.mts +0 -152
  95. package/vendor/sdk/index.d.ts +0 -152
  96. package/vendor/sdk/index.d.ts.map +0 -1
  97. package/vendor/sdk/index.js +0 -179
  98. package/vendor/sdk/index.js.map +0 -1
  99. package/vendor/sdk/index.mjs +0 -136
  100. package/vendor/sdk/index.mjs.map +0 -1
  101. package/vendor/sdk/internal/decoders/jsonl.d.ts +0 -12
  102. package/vendor/sdk/internal/decoders/jsonl.d.ts.map +0 -1
  103. package/vendor/sdk/internal/decoders/jsonl.js +0 -35
  104. package/vendor/sdk/internal/decoders/jsonl.js.map +0 -1
  105. package/vendor/sdk/internal/decoders/jsonl.mjs +0 -31
  106. package/vendor/sdk/internal/decoders/jsonl.mjs.map +0 -1
  107. package/vendor/sdk/internal/decoders/line.d.ts +0 -20
  108. package/vendor/sdk/internal/decoders/line.d.ts.map +0 -1
  109. package/vendor/sdk/internal/decoders/line.js +0 -123
  110. package/vendor/sdk/internal/decoders/line.js.map +0 -1
  111. package/vendor/sdk/internal/decoders/line.mjs +0 -119
  112. package/vendor/sdk/internal/decoders/line.mjs.map +0 -1
  113. package/vendor/sdk/internal/stream-utils.d.ts +0 -8
  114. package/vendor/sdk/internal/stream-utils.d.ts.map +0 -1
  115. package/vendor/sdk/internal/stream-utils.js +0 -39
  116. package/vendor/sdk/internal/stream-utils.js.map +0 -1
  117. package/vendor/sdk/internal/stream-utils.mjs +0 -35
  118. package/vendor/sdk/internal/stream-utils.mjs.map +0 -1
  119. package/vendor/sdk/lib/BetaMessageStream.d.ts +0 -114
  120. package/vendor/sdk/lib/BetaMessageStream.d.ts.map +0 -1
  121. package/vendor/sdk/lib/BetaMessageStream.js +0 -547
  122. package/vendor/sdk/lib/BetaMessageStream.js.map +0 -1
  123. package/vendor/sdk/lib/BetaMessageStream.mjs +0 -543
  124. package/vendor/sdk/lib/BetaMessageStream.mjs.map +0 -1
  125. package/vendor/sdk/lib/MessageStream.d.ts +0 -114
  126. package/vendor/sdk/lib/MessageStream.d.ts.map +0 -1
  127. package/vendor/sdk/lib/MessageStream.js +0 -547
  128. package/vendor/sdk/lib/MessageStream.js.map +0 -1
  129. package/vendor/sdk/lib/MessageStream.mjs +0 -543
  130. package/vendor/sdk/lib/MessageStream.mjs.map +0 -1
  131. package/vendor/sdk/node_modules/@types/node/LICENSE +0 -21
  132. package/vendor/sdk/node_modules/@types/node/README.md +0 -15
  133. package/vendor/sdk/node_modules/@types/node/assert/strict.d.ts +0 -8
  134. package/vendor/sdk/node_modules/@types/node/assert.d.ts +0 -985
  135. package/vendor/sdk/node_modules/@types/node/async_hooks.d.ts +0 -522
  136. package/vendor/sdk/node_modules/@types/node/buffer.buffer.d.ts +0 -385
  137. package/vendor/sdk/node_modules/@types/node/buffer.d.ts +0 -1903
  138. package/vendor/sdk/node_modules/@types/node/child_process.d.ts +0 -1549
  139. package/vendor/sdk/node_modules/@types/node/cluster.d.ts +0 -578
  140. package/vendor/sdk/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  141. package/vendor/sdk/node_modules/@types/node/compatibility/index.d.ts +0 -9
  142. package/vendor/sdk/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  143. package/vendor/sdk/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  144. package/vendor/sdk/node_modules/@types/node/console.d.ts +0 -452
  145. package/vendor/sdk/node_modules/@types/node/constants.d.ts +0 -19
  146. package/vendor/sdk/node_modules/@types/node/crypto.d.ts +0 -4453
  147. package/vendor/sdk/node_modules/@types/node/dgram.d.ts +0 -596
  148. package/vendor/sdk/node_modules/@types/node/diagnostics_channel.d.ts +0 -546
  149. package/vendor/sdk/node_modules/@types/node/dns/promises.d.ts +0 -475
  150. package/vendor/sdk/node_modules/@types/node/dns.d.ts +0 -853
  151. package/vendor/sdk/node_modules/@types/node/dom-events.d.ts +0 -124
  152. package/vendor/sdk/node_modules/@types/node/domain.d.ts +0 -170
  153. package/vendor/sdk/node_modules/@types/node/events.d.ts +0 -819
  154. package/vendor/sdk/node_modules/@types/node/fs/promises.d.ts +0 -1205
  155. package/vendor/sdk/node_modules/@types/node/fs.d.ts +0 -4237
  156. package/vendor/sdk/node_modules/@types/node/globals.d.ts +0 -442
  157. package/vendor/sdk/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  158. package/vendor/sdk/node_modules/@types/node/http.d.ts +0 -1839
  159. package/vendor/sdk/node_modules/@types/node/http2.d.ts +0 -2517
  160. package/vendor/sdk/node_modules/@types/node/https.d.ts +0 -544
  161. package/vendor/sdk/node_modules/@types/node/index.d.ts +0 -90
  162. package/vendor/sdk/node_modules/@types/node/inspector.d.ts +0 -2775
  163. package/vendor/sdk/node_modules/@types/node/module.d.ts +0 -291
  164. package/vendor/sdk/node_modules/@types/node/net.d.ts +0 -924
  165. package/vendor/sdk/node_modules/@types/node/os.d.ts +0 -473
  166. package/vendor/sdk/node_modules/@types/node/package.json +0 -225
  167. package/vendor/sdk/node_modules/@types/node/path.d.ts +0 -191
  168. package/vendor/sdk/node_modules/@types/node/perf_hooks.d.ts +0 -753
  169. package/vendor/sdk/node_modules/@types/node/process.d.ts +0 -1553
  170. package/vendor/sdk/node_modules/@types/node/punycode.d.ts +0 -117
  171. package/vendor/sdk/node_modules/@types/node/querystring.d.ts +0 -141
  172. package/vendor/sdk/node_modules/@types/node/readline/promises.d.ts +0 -154
  173. package/vendor/sdk/node_modules/@types/node/readline.d.ts +0 -715
  174. package/vendor/sdk/node_modules/@types/node/repl.d.ts +0 -430
  175. package/vendor/sdk/node_modules/@types/node/stream/consumers.d.ts +0 -12
  176. package/vendor/sdk/node_modules/@types/node/stream/promises.d.ts +0 -90
  177. package/vendor/sdk/node_modules/@types/node/stream/web.d.ts +0 -523
  178. package/vendor/sdk/node_modules/@types/node/stream.d.ts +0 -1731
  179. package/vendor/sdk/node_modules/@types/node/string_decoder.d.ts +0 -67
  180. package/vendor/sdk/node_modules/@types/node/test.d.ts +0 -1245
  181. package/vendor/sdk/node_modules/@types/node/timers/promises.d.ts +0 -93
  182. package/vendor/sdk/node_modules/@types/node/timers.d.ts +0 -126
  183. package/vendor/sdk/node_modules/@types/node/tls.d.ts +0 -1203
  184. package/vendor/sdk/node_modules/@types/node/trace_events.d.ts +0 -171
  185. package/vendor/sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -385
  186. package/vendor/sdk/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  187. package/vendor/sdk/node_modules/@types/node/ts5.6/index.d.ts +0 -90
  188. package/vendor/sdk/node_modules/@types/node/tty.d.ts +0 -206
  189. package/vendor/sdk/node_modules/@types/node/url.d.ts +0 -957
  190. package/vendor/sdk/node_modules/@types/node/util.d.ts +0 -2083
  191. package/vendor/sdk/node_modules/@types/node/v8.d.ts +0 -753
  192. package/vendor/sdk/node_modules/@types/node/vm.d.ts +0 -666
  193. package/vendor/sdk/node_modules/@types/node/wasi.d.ts +0 -160
  194. package/vendor/sdk/node_modules/@types/node/worker_threads.d.ts +0 -695
  195. package/vendor/sdk/node_modules/@types/node/zlib.d.ts +0 -517
  196. package/vendor/sdk/node_modules/undici-types/README.md +0 -6
  197. package/vendor/sdk/node_modules/undici-types/agent.d.ts +0 -31
  198. package/vendor/sdk/node_modules/undici-types/api.d.ts +0 -43
  199. package/vendor/sdk/node_modules/undici-types/balanced-pool.d.ts +0 -18
  200. package/vendor/sdk/node_modules/undici-types/cache.d.ts +0 -36
  201. package/vendor/sdk/node_modules/undici-types/client.d.ts +0 -97
  202. package/vendor/sdk/node_modules/undici-types/connector.d.ts +0 -34
  203. package/vendor/sdk/node_modules/undici-types/content-type.d.ts +0 -21
  204. package/vendor/sdk/node_modules/undici-types/cookies.d.ts +0 -28
  205. package/vendor/sdk/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  206. package/vendor/sdk/node_modules/undici-types/dispatcher.d.ts +0 -241
  207. package/vendor/sdk/node_modules/undici-types/errors.d.ts +0 -128
  208. package/vendor/sdk/node_modules/undici-types/fetch.d.ts +0 -209
  209. package/vendor/sdk/node_modules/undici-types/file.d.ts +0 -39
  210. package/vendor/sdk/node_modules/undici-types/filereader.d.ts +0 -54
  211. package/vendor/sdk/node_modules/undici-types/formdata.d.ts +0 -108
  212. package/vendor/sdk/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  213. package/vendor/sdk/node_modules/undici-types/global-origin.d.ts +0 -7
  214. package/vendor/sdk/node_modules/undici-types/handlers.d.ts +0 -9
  215. package/vendor/sdk/node_modules/undici-types/header.d.ts +0 -4
  216. package/vendor/sdk/node_modules/undici-types/index.d.ts +0 -63
  217. package/vendor/sdk/node_modules/undici-types/interceptors.d.ts +0 -5
  218. package/vendor/sdk/node_modules/undici-types/mock-agent.d.ts +0 -50
  219. package/vendor/sdk/node_modules/undici-types/mock-client.d.ts +0 -25
  220. package/vendor/sdk/node_modules/undici-types/mock-errors.d.ts +0 -12
  221. package/vendor/sdk/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  222. package/vendor/sdk/node_modules/undici-types/mock-pool.d.ts +0 -25
  223. package/vendor/sdk/node_modules/undici-types/package.json +0 -55
  224. package/vendor/sdk/node_modules/undici-types/patch.d.ts +0 -71
  225. package/vendor/sdk/node_modules/undici-types/pool-stats.d.ts +0 -19
  226. package/vendor/sdk/node_modules/undici-types/pool.d.ts +0 -28
  227. package/vendor/sdk/node_modules/undici-types/proxy-agent.d.ts +0 -30
  228. package/vendor/sdk/node_modules/undici-types/readable.d.ts +0 -61
  229. package/vendor/sdk/node_modules/undici-types/webidl.d.ts +0 -220
  230. package/vendor/sdk/node_modules/undici-types/websocket.d.ts +0 -131
  231. package/vendor/sdk/package.json +0 -124
  232. package/vendor/sdk/pagination.d.ts +0 -27
  233. package/vendor/sdk/pagination.d.ts.map +0 -1
  234. package/vendor/sdk/pagination.js +0 -60
  235. package/vendor/sdk/pagination.js.map +0 -1
  236. package/vendor/sdk/pagination.mjs +0 -56
  237. package/vendor/sdk/pagination.mjs.map +0 -1
  238. package/vendor/sdk/resource.d.ts +0 -6
  239. package/vendor/sdk/resource.d.ts.map +0 -1
  240. package/vendor/sdk/resource.js +0 -11
  241. package/vendor/sdk/resource.js.map +0 -1
  242. package/vendor/sdk/resource.mjs +0 -7
  243. package/vendor/sdk/resource.mjs.map +0 -1
  244. package/vendor/sdk/resources/beta/beta.d.ts +0 -57
  245. package/vendor/sdk/resources/beta/beta.d.ts.map +0 -1
  246. package/vendor/sdk/resources/beta/beta.js +0 -44
  247. package/vendor/sdk/resources/beta/beta.js.map +0 -1
  248. package/vendor/sdk/resources/beta/beta.mjs +0 -17
  249. package/vendor/sdk/resources/beta/beta.mjs.map +0 -1
  250. package/vendor/sdk/resources/beta/index.d.ts +0 -4
  251. package/vendor/sdk/resources/beta/index.d.ts.map +0 -1
  252. package/vendor/sdk/resources/beta/index.js +0 -12
  253. package/vendor/sdk/resources/beta/index.js.map +0 -1
  254. package/vendor/sdk/resources/beta/index.mjs +0 -5
  255. package/vendor/sdk/resources/beta/index.mjs.map +0 -1
  256. package/vendor/sdk/resources/beta/messages/batches.d.ts +0 -289
  257. package/vendor/sdk/resources/beta/messages/batches.d.ts.map +0 -1
  258. package/vendor/sdk/resources/beta/messages/batches.js +0 -112
  259. package/vendor/sdk/resources/beta/messages/batches.js.map +0 -1
  260. package/vendor/sdk/resources/beta/messages/batches.mjs +0 -107
  261. package/vendor/sdk/resources/beta/messages/batches.mjs.map +0 -1
  262. package/vendor/sdk/resources/beta/messages/index.d.ts +0 -3
  263. package/vendor/sdk/resources/beta/messages/index.d.ts.map +0 -1
  264. package/vendor/sdk/resources/beta/messages/index.js +0 -10
  265. package/vendor/sdk/resources/beta/messages/index.js.map +0 -1
  266. package/vendor/sdk/resources/beta/messages/index.mjs +0 -4
  267. package/vendor/sdk/resources/beta/messages/index.mjs.map +0 -1
  268. package/vendor/sdk/resources/beta/messages/messages.d.ts +0 -1038
  269. package/vendor/sdk/resources/beta/messages/messages.d.ts.map +0 -1
  270. package/vendor/sdk/resources/beta/messages/messages.js +0 -93
  271. package/vendor/sdk/resources/beta/messages/messages.js.map +0 -1
  272. package/vendor/sdk/resources/beta/messages/messages.mjs +0 -66
  273. package/vendor/sdk/resources/beta/messages/messages.mjs.map +0 -1
  274. package/vendor/sdk/resources/beta/models.d.ts +0 -49
  275. package/vendor/sdk/resources/beta/models.d.ts.map +0 -1
  276. package/vendor/sdk/resources/beta/models.js +0 -30
  277. package/vendor/sdk/resources/beta/models.js.map +0 -1
  278. package/vendor/sdk/resources/beta/models.mjs +0 -25
  279. package/vendor/sdk/resources/beta/models.mjs.map +0 -1
  280. package/vendor/sdk/resources/completions.d.ts +0 -166
  281. package/vendor/sdk/resources/completions.d.ts.map +0 -1
  282. package/vendor/sdk/resources/completions.js +0 -17
  283. package/vendor/sdk/resources/completions.js.map +0 -1
  284. package/vendor/sdk/resources/completions.mjs +0 -13
  285. package/vendor/sdk/resources/completions.mjs.map +0 -1
  286. package/vendor/sdk/resources/index.d.ts +0 -6
  287. package/vendor/sdk/resources/index.d.ts.map +0 -1
  288. package/vendor/sdk/resources/index.js +0 -29
  289. package/vendor/sdk/resources/index.js.map +0 -1
  290. package/vendor/sdk/resources/index.mjs +0 -7
  291. package/vendor/sdk/resources/index.mjs.map +0 -1
  292. package/vendor/sdk/resources/messages/batches.d.ts +0 -253
  293. package/vendor/sdk/resources/messages/batches.d.ts.map +0 -1
  294. package/vendor/sdk/resources/messages/batches.js +0 -102
  295. package/vendor/sdk/resources/messages/batches.js.map +0 -1
  296. package/vendor/sdk/resources/messages/batches.mjs +0 -97
  297. package/vendor/sdk/resources/messages/batches.mjs.map +0 -1
  298. package/vendor/sdk/resources/messages/index.d.ts +0 -3
  299. package/vendor/sdk/resources/messages/index.d.ts.map +0 -1
  300. package/vendor/sdk/resources/messages/index.js +0 -10
  301. package/vendor/sdk/resources/messages/index.js.map +0 -1
  302. package/vendor/sdk/resources/messages/index.mjs +0 -4
  303. package/vendor/sdk/resources/messages/index.mjs.map +0 -1
  304. package/vendor/sdk/resources/messages/messages.d.ts +0 -1028
  305. package/vendor/sdk/resources/messages/messages.d.ts.map +0 -1
  306. package/vendor/sdk/resources/messages/messages.js +0 -82
  307. package/vendor/sdk/resources/messages/messages.js.map +0 -1
  308. package/vendor/sdk/resources/messages/messages.mjs +0 -54
  309. package/vendor/sdk/resources/messages/messages.mjs.map +0 -1
  310. package/vendor/sdk/resources/models.d.ts +0 -49
  311. package/vendor/sdk/resources/models.d.ts.map +0 -1
  312. package/vendor/sdk/resources/models.js +0 -30
  313. package/vendor/sdk/resources/models.js.map +0 -1
  314. package/vendor/sdk/resources/models.mjs +0 -25
  315. package/vendor/sdk/resources/models.mjs.map +0 -1
  316. package/vendor/sdk/resources/shared.d.ts +0 -42
  317. package/vendor/sdk/resources/shared.d.ts.map +0 -1
  318. package/vendor/sdk/resources/shared.js +0 -4
  319. package/vendor/sdk/resources/shared.js.map +0 -1
  320. package/vendor/sdk/resources/shared.mjs +0 -3
  321. package/vendor/sdk/resources/shared.mjs.map +0 -1
  322. package/vendor/sdk/resources/top-level.d.ts +0 -2
  323. package/vendor/sdk/resources/top-level.d.ts.map +0 -1
  324. package/vendor/sdk/resources/top-level.js +0 -4
  325. package/vendor/sdk/resources/top-level.js.map +0 -1
  326. package/vendor/sdk/resources/top-level.mjs +0 -3
  327. package/vendor/sdk/resources/top-level.mjs.map +0 -1
  328. package/vendor/sdk/shims/node.d.ts +0 -30
  329. package/vendor/sdk/shims/node.d.ts.map +0 -1
  330. package/vendor/sdk/shims/node.js +0 -31
  331. package/vendor/sdk/shims/node.js.map +0 -1
  332. package/vendor/sdk/shims/node.mjs +0 -5
  333. package/vendor/sdk/shims/node.mjs.map +0 -1
  334. package/vendor/sdk/shims/web.d.ts +0 -26
  335. package/vendor/sdk/shims/web.d.ts.map +0 -1
  336. package/vendor/sdk/shims/web.js +0 -31
  337. package/vendor/sdk/shims/web.js.map +0 -1
  338. package/vendor/sdk/shims/web.mjs +0 -5
  339. package/vendor/sdk/shims/web.mjs.map +0 -1
  340. package/vendor/sdk/src/_shims/MultipartBody.ts +0 -9
  341. package/vendor/sdk/src/_shims/README.md +0 -46
  342. package/vendor/sdk/src/_shims/auto/runtime-bun.ts +0 -4
  343. package/vendor/sdk/src/_shims/auto/runtime-node.ts +0 -4
  344. package/vendor/sdk/src/_shims/auto/runtime.ts +0 -4
  345. package/vendor/sdk/src/_shims/auto/types-node.ts +0 -4
  346. package/vendor/sdk/src/_shims/auto/types.d.ts +0 -101
  347. package/vendor/sdk/src/_shims/auto/types.js +0 -3
  348. package/vendor/sdk/src/_shims/auto/types.mjs +0 -3
  349. package/vendor/sdk/src/_shims/bun-runtime.ts +0 -14
  350. package/vendor/sdk/src/_shims/index.d.ts +0 -81
  351. package/vendor/sdk/src/_shims/index.js +0 -13
  352. package/vendor/sdk/src/_shims/index.mjs +0 -7
  353. package/vendor/sdk/src/_shims/manual-types.d.ts +0 -12
  354. package/vendor/sdk/src/_shims/manual-types.js +0 -3
  355. package/vendor/sdk/src/_shims/manual-types.mjs +0 -3
  356. package/vendor/sdk/src/_shims/node-runtime.ts +0 -81
  357. package/vendor/sdk/src/_shims/node-types.d.ts +0 -42
  358. package/vendor/sdk/src/_shims/node-types.js +0 -3
  359. package/vendor/sdk/src/_shims/node-types.mjs +0 -3
  360. package/vendor/sdk/src/_shims/registry.ts +0 -67
  361. package/vendor/sdk/src/_shims/web-runtime.ts +0 -103
  362. package/vendor/sdk/src/_shims/web-types.d.ts +0 -83
  363. package/vendor/sdk/src/_shims/web-types.js +0 -3
  364. package/vendor/sdk/src/_shims/web-types.mjs +0 -3
  365. package/vendor/sdk/src/_vendor/partial-json-parser/README.md +0 -3
  366. package/vendor/sdk/src/_vendor/partial-json-parser/parser.ts +0 -264
  367. package/vendor/sdk/src/core.ts +0 -1250
  368. package/vendor/sdk/src/error.ts +0 -133
  369. package/vendor/sdk/src/index.ts +0 -465
  370. package/vendor/sdk/src/internal/decoders/jsonl.ts +0 -41
  371. package/vendor/sdk/src/internal/decoders/line.ts +0 -145
  372. package/vendor/sdk/src/internal/stream-utils.ts +0 -32
  373. package/vendor/sdk/src/lib/.keep +0 -4
  374. package/vendor/sdk/src/lib/BetaMessageStream.ts +0 -661
  375. package/vendor/sdk/src/lib/MessageStream.ts +0 -662
  376. package/vendor/sdk/src/pagination.ts +0 -92
  377. package/vendor/sdk/src/resource.ts +0 -11
  378. package/vendor/sdk/src/resources/beta/beta.ts +0 -249
  379. package/vendor/sdk/src/resources/beta/index.ts +0 -83
  380. package/vendor/sdk/src/resources/beta/messages/batches.ts +0 -486
  381. package/vendor/sdk/src/resources/beta/messages/index.ts +0 -87
  382. package/vendor/sdk/src/resources/beta/messages/messages.ts +0 -1444
  383. package/vendor/sdk/src/resources/beta/models.ts +0 -78
  384. package/vendor/sdk/src/resources/completions.ts +0 -210
  385. package/vendor/sdk/src/resources/index.ts +0 -95
  386. package/vendor/sdk/src/resources/messages/batches.ts +0 -352
  387. package/vendor/sdk/src/resources/messages/index.ts +0 -85
  388. package/vendor/sdk/src/resources/messages/messages.ts +0 -1412
  389. package/vendor/sdk/src/resources/models.ts +0 -75
  390. package/vendor/sdk/src/resources/shared.ts +0 -72
  391. package/vendor/sdk/src/resources/top-level.ts +0 -3
  392. package/vendor/sdk/src/shims/node.ts +0 -50
  393. package/vendor/sdk/src/shims/web.ts +0 -50
  394. package/vendor/sdk/src/streaming.ts +0 -372
  395. package/vendor/sdk/src/tsconfig.json +0 -11
  396. package/vendor/sdk/src/uploads.ts +0 -255
  397. package/vendor/sdk/src/version.ts +0 -1
  398. package/vendor/sdk/streaming.d.ts +0 -36
  399. package/vendor/sdk/streaming.d.ts.map +0 -1
  400. package/vendor/sdk/streaming.js +0 -316
  401. package/vendor/sdk/streaming.js.map +0 -1
  402. package/vendor/sdk/streaming.mjs +0 -310
  403. package/vendor/sdk/streaming.mjs.map +0 -1
  404. package/vendor/sdk/uploads.d.ts +0 -75
  405. package/vendor/sdk/uploads.d.ts.map +0 -1
  406. package/vendor/sdk/uploads.js +0 -171
  407. package/vendor/sdk/uploads.js.map +0 -1
  408. package/vendor/sdk/uploads.mjs +0 -158
  409. package/vendor/sdk/uploads.mjs.map +0 -1
  410. package/vendor/sdk/version.d.ts +0 -2
  411. package/vendor/sdk/version.d.ts.map +0 -1
  412. package/vendor/sdk/version.js +0 -5
  413. package/vendor/sdk/version.js.map +0 -1
  414. package/vendor/sdk/version.mjs +0 -2
  415. package/vendor/sdk/version.mjs.map +0 -1
@@ -1,1444 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from "../../../resource.js";
4
- import { APIPromise } from "../../../core.js";
5
- import * as Core from "../../../core.js";
6
- import * as MessagesMessagesAPI from "./messages.js";
7
- import * as BetaAPI from "../beta.js";
8
- import * as MessagesAPI from "../../messages/messages.js";
9
- import * as BatchesAPI from "./batches.js";
10
- import {
11
- BatchCancelParams,
12
- BatchCreateParams,
13
- BatchDeleteParams,
14
- BatchListParams,
15
- BatchResultsParams,
16
- BatchRetrieveParams,
17
- Batches,
18
- BetaDeletedMessageBatch,
19
- BetaMessageBatch,
20
- BetaMessageBatchCanceledResult,
21
- BetaMessageBatchErroredResult,
22
- BetaMessageBatchExpiredResult,
23
- BetaMessageBatchIndividualResponse,
24
- BetaMessageBatchRequestCounts,
25
- BetaMessageBatchResult,
26
- BetaMessageBatchSucceededResult,
27
- BetaMessageBatchesPage,
28
- } from "./batches.js";
29
- import { Stream } from "../../../streaming.js";
30
- import { BetaMessageStream } from "../../../lib/BetaMessageStream.js";
31
- import type { Model } from "../../messages/messages.js";
32
-
33
- const DEPRECATED_MODELS: {
34
- [K in Model]?: string;
35
- } = {
36
- 'claude-1.3': 'November 6th, 2024',
37
- 'claude-1.3-100k': 'November 6th, 2024',
38
- 'claude-instant-1.1': 'November 6th, 2024',
39
- 'claude-instant-1.1-100k': 'November 6th, 2024',
40
- 'claude-instant-1.2': 'November 6th, 2024',
41
- 'claude-3-sonnet-20240229': 'July 21st, 2025',
42
- 'claude-2.1': 'July 21st, 2025',
43
- 'claude-2.0': 'July 21st, 2025',
44
- };
45
-
46
- export class Messages extends APIResource {
47
- batches: BatchesAPI.Batches = new BatchesAPI.Batches(this._client);
48
-
49
- /**
50
- * Send a structured list of input messages with text and/or image content, and the
51
- * model will generate the next message in the conversation.
52
- *
53
- * The Messages API can be used for either single queries or stateless multi-turn
54
- * conversations.
55
- *
56
- * Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
57
- */
58
- create(params: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<BetaMessage>;
59
- create(
60
- params: MessageCreateParamsStreaming,
61
- options?: Core.RequestOptions,
62
- ): APIPromise<Stream<BetaRawMessageStreamEvent>>;
63
- create(
64
- params: MessageCreateParamsBase,
65
- options?: Core.RequestOptions,
66
- ): APIPromise<Stream<BetaRawMessageStreamEvent> | BetaMessage>;
67
- create(
68
- params: MessageCreateParams,
69
- options?: Core.RequestOptions,
70
- ): APIPromise<BetaMessage> | APIPromise<Stream<BetaRawMessageStreamEvent>> {
71
- const { betas, ...body } = params;
72
-
73
- if (body.model in DEPRECATED_MODELS) {
74
- console.warn(
75
- `The model '${body.model}' is deprecated and will reach end-of-life on ${
76
- DEPRECATED_MODELS[body.model]
77
- }\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`,
78
- );
79
- }
80
-
81
- return this._client.post('/v1/messages?beta=true', {
82
- body,
83
- timeout: (this._client as any)._options.timeout ?? 600000,
84
- ...options,
85
- headers: {
86
- ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
87
- ...options?.headers,
88
- },
89
- stream: params.stream ?? false,
90
- }) as APIPromise<BetaMessage> | APIPromise<Stream<BetaRawMessageStreamEvent>>;
91
- }
92
-
93
- /**
94
- * Create a Message stream
95
- */
96
- stream(body: BetaMessageStreamParams, options?: Core.RequestOptions): BetaMessageStream {
97
- return BetaMessageStream.createMessage(this, body, options);
98
- }
99
-
100
- /**
101
- * Count the number of tokens in a Message.
102
- *
103
- * The Token Count API can be used to count the number of tokens in a Message,
104
- * including tools, images, and documents, without creating it.
105
- *
106
- * Learn more about token counting in our
107
- * [user guide](/en/docs/build-with-claude/token-counting)
108
- */
109
- countTokens(
110
- params: MessageCountTokensParams,
111
- options?: Core.RequestOptions,
112
- ): Core.APIPromise<BetaMessageTokensCount> {
113
- const { betas, ...body } = params;
114
- return this._client.post('/v1/messages/count_tokens?beta=true', {
115
- body,
116
- ...options,
117
- headers: {
118
- 'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString(),
119
- ...options?.headers,
120
- },
121
- });
122
- }
123
- }
124
-
125
- export type BetaMessageStreamParams = MessageCreateParamsBase;
126
-
127
- export interface BetaBase64PDFBlock {
128
- source: BetaBase64PDFSource | BetaPlainTextSource | BetaContentBlockSource;
129
-
130
- type: 'document';
131
-
132
- cache_control?: BetaCacheControlEphemeral | null;
133
-
134
- citations?: BetaCitationsConfigParam;
135
-
136
- context?: string | null;
137
-
138
- title?: string | null;
139
- }
140
-
141
- export interface BetaBase64PDFSource {
142
- data: string;
143
-
144
- media_type: 'application/pdf';
145
-
146
- type: 'base64';
147
- }
148
-
149
- export interface BetaCacheControlEphemeral {
150
- type: 'ephemeral';
151
- }
152
-
153
- export interface BetaCitationCharLocation {
154
- cited_text: string;
155
-
156
- document_index: number;
157
-
158
- document_title: string | null;
159
-
160
- end_char_index: number;
161
-
162
- start_char_index: number;
163
-
164
- type: 'char_location';
165
- }
166
-
167
- export interface BetaCitationCharLocationParam {
168
- cited_text: string;
169
-
170
- document_index: number;
171
-
172
- document_title: string | null;
173
-
174
- end_char_index: number;
175
-
176
- start_char_index: number;
177
-
178
- type: 'char_location';
179
- }
180
-
181
- export interface BetaCitationContentBlockLocation {
182
- cited_text: string;
183
-
184
- document_index: number;
185
-
186
- document_title: string | null;
187
-
188
- end_block_index: number;
189
-
190
- start_block_index: number;
191
-
192
- type: 'content_block_location';
193
- }
194
-
195
- export interface BetaCitationContentBlockLocationParam {
196
- cited_text: string;
197
-
198
- document_index: number;
199
-
200
- document_title: string | null;
201
-
202
- end_block_index: number;
203
-
204
- start_block_index: number;
205
-
206
- type: 'content_block_location';
207
- }
208
-
209
- export interface BetaCitationPageLocation {
210
- cited_text: string;
211
-
212
- document_index: number;
213
-
214
- document_title: string | null;
215
-
216
- end_page_number: number;
217
-
218
- start_page_number: number;
219
-
220
- type: 'page_location';
221
- }
222
-
223
- export interface BetaCitationPageLocationParam {
224
- cited_text: string;
225
-
226
- document_index: number;
227
-
228
- document_title: string | null;
229
-
230
- end_page_number: number;
231
-
232
- start_page_number: number;
233
-
234
- type: 'page_location';
235
- }
236
-
237
- export interface BetaCitationsConfigParam {
238
- enabled?: boolean;
239
- }
240
-
241
- export interface BetaCitationsDelta {
242
- citation: BetaCitationCharLocation | BetaCitationPageLocation | BetaCitationContentBlockLocation;
243
-
244
- type: 'citations_delta';
245
- }
246
-
247
- export type BetaContentBlock =
248
- | BetaTextBlock
249
- | BetaToolUseBlock
250
- | BetaThinkingBlock
251
- | BetaRedactedThinkingBlock;
252
-
253
- export type BetaContentBlockParam =
254
- | BetaTextBlockParam
255
- | BetaImageBlockParam
256
- | BetaToolUseBlockParam
257
- | BetaToolResultBlockParam
258
- | BetaBase64PDFBlock
259
- | BetaThinkingBlockParam
260
- | BetaRedactedThinkingBlockParam;
261
-
262
- export interface BetaContentBlockSource {
263
- content: string | Array<BetaContentBlockSourceContent>;
264
-
265
- type: 'content';
266
- }
267
-
268
- export type BetaContentBlockSourceContent = BetaTextBlockParam | BetaImageBlockParam;
269
-
270
- export interface BetaImageBlockParam {
271
- source: BetaImageBlockParam.Source;
272
-
273
- type: 'image';
274
-
275
- cache_control?: BetaCacheControlEphemeral | null;
276
- }
277
-
278
- export namespace BetaImageBlockParam {
279
- export interface Source {
280
- data: string;
281
-
282
- media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
283
-
284
- type: 'base64';
285
- }
286
- }
287
-
288
- export interface BetaInputJSONDelta {
289
- partial_json: string;
290
-
291
- type: 'input_json_delta';
292
- }
293
-
294
- export interface BetaMessage {
295
- /**
296
- * Unique object identifier.
297
- *
298
- * The format and length of IDs may change over time.
299
- */
300
- id: string;
301
-
302
- /**
303
- * Content generated by the model.
304
- *
305
- * This is an array of content blocks, each of which has a `type` that determines
306
- * its shape.
307
- *
308
- * Example:
309
- *
310
- * ```json
311
- * [{ "type": "text", "text": "Hi, I'm Claude." }]
312
- * ```
313
- *
314
- * If the request input `messages` ended with an `assistant` turn, then the
315
- * response `content` will continue directly from that last turn. You can use this
316
- * to constrain the model's output.
317
- *
318
- * For example, if the input `messages` were:
319
- *
320
- * ```json
321
- * [
322
- * {
323
- * "role": "user",
324
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
325
- * },
326
- * { "role": "assistant", "content": "The best answer is (" }
327
- * ]
328
- * ```
329
- *
330
- * Then the response `content` might be:
331
- *
332
- * ```json
333
- * [{ "type": "text", "text": "B)" }]
334
- * ```
335
- */
336
- content: Array<BetaContentBlock>;
337
-
338
- /**
339
- * The model that will complete your prompt.\n\nSee
340
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
341
- * details and options.
342
- */
343
- model: MessagesAPI.Model;
344
-
345
- /**
346
- * Conversational role of the generated message.
347
- *
348
- * This will always be `"assistant"`.
349
- */
350
- role: 'assistant';
351
-
352
- /**
353
- * The reason that we stopped.
354
- *
355
- * This may be one the following values:
356
- *
357
- * - `"end_turn"`: the model reached a natural stopping point
358
- * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
359
- * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
360
- * - `"tool_use"`: the model invoked one or more tools
361
- *
362
- * In non-streaming mode this value is always non-null. In streaming mode, it is
363
- * null in the `message_start` event and non-null otherwise.
364
- */
365
- stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
366
-
367
- /**
368
- * Which custom stop sequence was generated, if any.
369
- *
370
- * This value will be a non-null string if one of your custom stop sequences was
371
- * generated.
372
- */
373
- stop_sequence: string | null;
374
-
375
- /**
376
- * Object type.
377
- *
378
- * For Messages, this is always `"message"`.
379
- */
380
- type: 'message';
381
-
382
- /**
383
- * Billing and rate-limit usage.
384
- *
385
- * Anthropic's API bills and rate-limits by token counts, as tokens represent the
386
- * underlying cost to our systems.
387
- *
388
- * Under the hood, the API transforms requests into a format suitable for the
389
- * model. The model's output then goes through a parsing stage before becoming an
390
- * API response. As a result, the token counts in `usage` will not match one-to-one
391
- * with the exact visible content of an API request or response.
392
- *
393
- * For example, `output_tokens` will be non-zero, even for an empty string response
394
- * from Claude.
395
- *
396
- * Total input tokens in a request is the summation of `input_tokens`,
397
- * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
398
- */
399
- usage: BetaUsage;
400
- }
401
-
402
- export interface BetaMessageDeltaUsage {
403
- /**
404
- * The cumulative number of output tokens which were used.
405
- */
406
- output_tokens: number;
407
- }
408
-
409
- export interface BetaMessageParam {
410
- content: string | Array<BetaContentBlockParam>;
411
-
412
- role: 'user' | 'assistant';
413
- }
414
-
415
- export interface BetaMessageTokensCount {
416
- /**
417
- * The total number of tokens across the provided list of messages, system prompt,
418
- * and tools.
419
- */
420
- input_tokens: number;
421
- }
422
-
423
- export interface BetaMetadata {
424
- /**
425
- * An external identifier for the user who is associated with the request.
426
- *
427
- * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
428
- * this id to help detect abuse. Do not include any identifying information such as
429
- * name, email address, or phone number.
430
- */
431
- user_id?: string | null;
432
- }
433
-
434
- export interface BetaPlainTextSource {
435
- data: string;
436
-
437
- media_type: 'text/plain';
438
-
439
- type: 'text';
440
- }
441
-
442
- export interface BetaRawContentBlockDeltaEvent {
443
- delta: BetaTextDelta | BetaInputJSONDelta | BetaCitationsDelta | BetaThinkingDelta | BetaSignatureDelta;
444
-
445
- index: number;
446
-
447
- type: 'content_block_delta';
448
- }
449
-
450
- export interface BetaRawContentBlockStartEvent {
451
- content_block: BetaTextBlock | BetaToolUseBlock | BetaThinkingBlock | BetaRedactedThinkingBlock;
452
-
453
- index: number;
454
-
455
- type: 'content_block_start';
456
- }
457
-
458
- export interface BetaRawContentBlockStopEvent {
459
- index: number;
460
-
461
- type: 'content_block_stop';
462
- }
463
-
464
- export interface BetaRawMessageDeltaEvent {
465
- delta: BetaRawMessageDeltaEvent.Delta;
466
-
467
- type: 'message_delta';
468
-
469
- /**
470
- * Billing and rate-limit usage.
471
- *
472
- * Anthropic's API bills and rate-limits by token counts, as tokens represent the
473
- * underlying cost to our systems.
474
- *
475
- * Under the hood, the API transforms requests into a format suitable for the
476
- * model. The model's output then goes through a parsing stage before becoming an
477
- * API response. As a result, the token counts in `usage` will not match one-to-one
478
- * with the exact visible content of an API request or response.
479
- *
480
- * For example, `output_tokens` will be non-zero, even for an empty string response
481
- * from Claude.
482
- *
483
- * Total input tokens in a request is the summation of `input_tokens`,
484
- * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
485
- */
486
- usage: BetaMessageDeltaUsage;
487
- }
488
-
489
- export namespace BetaRawMessageDeltaEvent {
490
- export interface Delta {
491
- stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
492
-
493
- stop_sequence: string | null;
494
- }
495
- }
496
-
497
- export interface BetaRawMessageStartEvent {
498
- message: BetaMessage;
499
-
500
- type: 'message_start';
501
- }
502
-
503
- export interface BetaRawMessageStopEvent {
504
- type: 'message_stop';
505
- }
506
-
507
- export type BetaRawMessageStreamEvent =
508
- | BetaRawMessageStartEvent
509
- | BetaRawMessageDeltaEvent
510
- | BetaRawMessageStopEvent
511
- | BetaRawContentBlockStartEvent
512
- | BetaRawContentBlockDeltaEvent
513
- | BetaRawContentBlockStopEvent;
514
-
515
- export interface BetaRedactedThinkingBlock {
516
- data: string;
517
-
518
- type: 'redacted_thinking';
519
- }
520
-
521
- export interface BetaRedactedThinkingBlockParam {
522
- data: string;
523
-
524
- type: 'redacted_thinking';
525
- }
526
-
527
- export interface BetaSignatureDelta {
528
- signature: string;
529
-
530
- type: 'signature_delta';
531
- }
532
-
533
- export interface BetaTextBlock {
534
- /**
535
- * Citations supporting the text block.
536
- *
537
- * The type of citation returned will depend on the type of document being cited.
538
- * Citing a PDF results in `page_location`, plain text results in `char_location`,
539
- * and content document results in `content_block_location`.
540
- */
541
- citations: Array<BetaTextCitation> | null;
542
-
543
- text: string;
544
-
545
- type: 'text';
546
- }
547
-
548
- export interface BetaTextBlockParam {
549
- text: string;
550
-
551
- type: 'text';
552
-
553
- cache_control?: BetaCacheControlEphemeral | null;
554
-
555
- citations?: Array<BetaTextCitationParam> | null;
556
- }
557
-
558
- export type BetaTextCitation =
559
- | BetaCitationCharLocation
560
- | BetaCitationPageLocation
561
- | BetaCitationContentBlockLocation;
562
-
563
- export type BetaTextCitationParam =
564
- | BetaCitationCharLocationParam
565
- | BetaCitationPageLocationParam
566
- | BetaCitationContentBlockLocationParam;
567
-
568
- export interface BetaTextDelta {
569
- text: string;
570
-
571
- type: 'text_delta';
572
- }
573
-
574
- export interface BetaThinkingBlock {
575
- signature: string;
576
-
577
- thinking: string;
578
-
579
- type: 'thinking';
580
- }
581
-
582
- export interface BetaThinkingBlockParam {
583
- signature: string;
584
-
585
- thinking: string;
586
-
587
- type: 'thinking';
588
- }
589
-
590
- export interface BetaThinkingConfigDisabled {
591
- type: 'disabled';
592
- }
593
-
594
- export interface BetaThinkingConfigEnabled {
595
- budget_tokens: number;
596
-
597
- type: 'enabled';
598
- }
599
-
600
- export interface BetaThinkingDelta {
601
- thinking: string;
602
-
603
- type: 'thinking_delta';
604
- }
605
-
606
- export interface BetaTool {
607
- /**
608
- * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
609
- *
610
- * This defines the shape of the `input` that your tool accepts and that the model
611
- * will produce.
612
- */
613
- input_schema: BetaTool.InputSchema;
614
-
615
- /**
616
- * Name of the tool.
617
- *
618
- * This is how the tool will be called by the model and in tool_use blocks.
619
- */
620
- name: string;
621
-
622
- cache_control?: BetaCacheControlEphemeral | null;
623
-
624
- /**
625
- * Description of what this tool does.
626
- *
627
- * Tool descriptions should be as detailed as possible. The more information that
628
- * the model has about what the tool is and how to use it, the better it will
629
- * perform. You can use natural language descriptions to reinforce important
630
- * aspects of the tool input JSON schema.
631
- */
632
- description?: string;
633
-
634
- type?: 'custom' | null;
635
- }
636
-
637
- export namespace BetaTool {
638
- /**
639
- * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
640
- *
641
- * This defines the shape of the `input` that your tool accepts and that the model
642
- * will produce.
643
- */
644
- export interface InputSchema {
645
- type: 'object';
646
-
647
- properties?: unknown | null;
648
- [k: string]: unknown;
649
- }
650
- }
651
-
652
- export interface BetaToolBash20241022 {
653
- /**
654
- * Name of the tool.
655
- *
656
- * This is how the tool will be called by the model and in tool_use blocks.
657
- */
658
- name: 'bash';
659
-
660
- type: 'bash_20241022';
661
-
662
- cache_control?: BetaCacheControlEphemeral | null;
663
- }
664
-
665
- export interface BetaToolBash20250124 {
666
- /**
667
- * Name of the tool.
668
- *
669
- * This is how the tool will be called by the model and in tool_use blocks.
670
- */
671
- name: 'bash';
672
-
673
- type: 'bash_20250124';
674
-
675
- cache_control?: BetaCacheControlEphemeral | null;
676
- }
677
-
678
- /**
679
- * How the model should use the provided tools. The model can use a specific tool,
680
- * any available tool, or decide by itself.
681
- */
682
- export type BetaToolChoice = BetaToolChoiceAuto | BetaToolChoiceAny | BetaToolChoiceTool;
683
-
684
- /**
685
- * The model will use any available tools.
686
- */
687
- export interface BetaToolChoiceAny {
688
- type: 'any';
689
-
690
- /**
691
- * Whether to disable parallel tool use.
692
- *
693
- * Defaults to `false`. If set to `true`, the model will output exactly one tool
694
- * use.
695
- */
696
- disable_parallel_tool_use?: boolean;
697
- }
698
-
699
- /**
700
- * The model will automatically decide whether to use tools.
701
- */
702
- export interface BetaToolChoiceAuto {
703
- type: 'auto';
704
-
705
- /**
706
- * Whether to disable parallel tool use.
707
- *
708
- * Defaults to `false`. If set to `true`, the model will output at most one tool
709
- * use.
710
- */
711
- disable_parallel_tool_use?: boolean;
712
- }
713
-
714
- /**
715
- * The model will use the specified tool with `tool_choice.name`.
716
- */
717
- export interface BetaToolChoiceTool {
718
- /**
719
- * The name of the tool to use.
720
- */
721
- name: string;
722
-
723
- type: 'tool';
724
-
725
- /**
726
- * Whether to disable parallel tool use.
727
- *
728
- * Defaults to `false`. If set to `true`, the model will output exactly one tool
729
- * use.
730
- */
731
- disable_parallel_tool_use?: boolean;
732
- }
733
-
734
- export interface BetaToolComputerUse20241022 {
735
- /**
736
- * The height of the display in pixels.
737
- */
738
- display_height_px: number;
739
-
740
- /**
741
- * The width of the display in pixels.
742
- */
743
- display_width_px: number;
744
-
745
- /**
746
- * Name of the tool.
747
- *
748
- * This is how the tool will be called by the model and in tool_use blocks.
749
- */
750
- name: 'computer';
751
-
752
- type: 'computer_20241022';
753
-
754
- cache_control?: BetaCacheControlEphemeral | null;
755
-
756
- /**
757
- * The X11 display number (e.g. 0, 1) for the display.
758
- */
759
- display_number?: number | null;
760
- }
761
-
762
- export interface BetaToolResultBlockParam {
763
- tool_use_id: string;
764
-
765
- type: 'tool_result';
766
-
767
- cache_control?: BetaCacheControlEphemeral | null;
768
-
769
- content?: string | Array<BetaTextBlockParam | BetaImageBlockParam>;
770
-
771
- is_error?: boolean;
772
- }
773
-
774
- export interface BetaToolTextEditor20241022 {
775
- /**
776
- * Name of the tool.
777
- *
778
- * This is how the tool will be called by the model and in tool_use blocks.
779
- */
780
- name: 'str_replace_editor';
781
-
782
- type: 'text_editor_20241022';
783
-
784
- cache_control?: BetaCacheControlEphemeral | null;
785
- }
786
-
787
- export interface BetaToolTextEditor20250124 {
788
- /**
789
- * Name of the tool.
790
- *
791
- * This is how the tool will be called by the model and in tool_use blocks.
792
- */
793
- name: 'str_replace_editor';
794
-
795
- type: 'text_editor_20250124';
796
-
797
- cache_control?: BetaCacheControlEphemeral | null;
798
- }
799
-
800
- export type BetaToolUnion =
801
- | BetaToolComputerUse20241022
802
- | BetaToolBash20241022
803
- | BetaToolTextEditor20241022
804
- | BetaToolBash20250124
805
- | BetaToolTextEditor20250124
806
- | BetaTool;
807
-
808
- export interface BetaToolUseBlock {
809
- id: string;
810
-
811
- input: unknown;
812
-
813
- name: string;
814
-
815
- type: 'tool_use';
816
- }
817
-
818
- export interface BetaToolUseBlockParam {
819
- id: string;
820
-
821
- input: unknown;
822
-
823
- name: string;
824
-
825
- type: 'tool_use';
826
-
827
- cache_control?: BetaCacheControlEphemeral | null;
828
- }
829
-
830
- export interface BetaUsage {
831
- /**
832
- * The number of input tokens used to create the cache entry.
833
- */
834
- cache_creation_input_tokens: number | null;
835
-
836
- /**
837
- * The number of input tokens read from the cache.
838
- */
839
- cache_read_input_tokens: number | null;
840
-
841
- /**
842
- * The number of input tokens which were used.
843
- */
844
- input_tokens: number;
845
-
846
- /**
847
- * The number of output tokens which were used.
848
- */
849
- output_tokens: number;
850
- }
851
-
852
- export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
853
-
854
- export interface MessageCreateParamsBase {
855
- /**
856
- * Body param: The maximum number of tokens to generate before stopping.
857
- *
858
- * Note that our models may stop _before_ reaching this maximum. This parameter
859
- * only specifies the absolute maximum number of tokens to generate.
860
- *
861
- * Different models have different maximum values for this parameter. See
862
- * [models](https://docs.anthropic.com/en/docs/models-overview) for details.
863
- */
864
- max_tokens: number;
865
-
866
- /**
867
- * Body param: Input messages.
868
- *
869
- * Our models are trained to operate on alternating `user` and `assistant`
870
- * conversational turns. When creating a new `Message`, you specify the prior
871
- * conversational turns with the `messages` parameter, and the model then generates
872
- * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
873
- * in your request will be combined into a single turn.
874
- *
875
- * Each input message must be an object with a `role` and `content`. You can
876
- * specify a single `user`-role message, or you can include multiple `user` and
877
- * `assistant` messages.
878
- *
879
- * If the final message uses the `assistant` role, the response content will
880
- * continue immediately from the content in that message. This can be used to
881
- * constrain part of the model's response.
882
- *
883
- * Example with a single `user` message:
884
- *
885
- * ```json
886
- * [{ "role": "user", "content": "Hello, Claude" }]
887
- * ```
888
- *
889
- * Example with multiple conversational turns:
890
- *
891
- * ```json
892
- * [
893
- * { "role": "user", "content": "Hello there." },
894
- * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
895
- * { "role": "user", "content": "Can you explain LLMs in plain English?" }
896
- * ]
897
- * ```
898
- *
899
- * Example with a partially-filled response from Claude:
900
- *
901
- * ```json
902
- * [
903
- * {
904
- * "role": "user",
905
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
906
- * },
907
- * { "role": "assistant", "content": "The best answer is (" }
908
- * ]
909
- * ```
910
- *
911
- * Each input message `content` may be either a single `string` or an array of
912
- * content blocks, where each block has a specific `type`. Using a `string` for
913
- * `content` is shorthand for an array of one content block of type `"text"`. The
914
- * following input messages are equivalent:
915
- *
916
- * ```json
917
- * { "role": "user", "content": "Hello, Claude" }
918
- * ```
919
- *
920
- * ```json
921
- * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
922
- * ```
923
- *
924
- * Starting with Claude 3 models, you can also send image content blocks:
925
- *
926
- * ```json
927
- * {
928
- * "role": "user",
929
- * "content": [
930
- * {
931
- * "type": "image",
932
- * "source": {
933
- * "type": "base64",
934
- * "media_type": "image/jpeg",
935
- * "data": "/9j/4AAQSkZJRg..."
936
- * }
937
- * },
938
- * { "type": "text", "text": "What is in this image?" }
939
- * ]
940
- * }
941
- * ```
942
- *
943
- * We currently support the `base64` source type for images, and the `image/jpeg`,
944
- * `image/png`, `image/gif`, and `image/webp` media types.
945
- *
946
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
947
- * more input examples.
948
- *
949
- * Note that if you want to include a
950
- * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
951
- * the top-level `system` parameter — there is no `"system"` role for input
952
- * messages in the Messages API.
953
- */
954
- messages: Array<BetaMessageParam>;
955
-
956
- /**
957
- * Body param: The model that will complete your prompt.\n\nSee
958
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
959
- * details and options.
960
- */
961
- model: MessagesAPI.Model;
962
-
963
- /**
964
- * Body param: An object describing metadata about the request.
965
- */
966
- metadata?: BetaMetadata;
967
-
968
- /**
969
- * Body param: Custom text sequences that will cause the model to stop generating.
970
- *
971
- * Our models will normally stop when they have naturally completed their turn,
972
- * which will result in a response `stop_reason` of `"end_turn"`.
973
- *
974
- * If you want the model to stop generating when it encounters custom strings of
975
- * text, you can use the `stop_sequences` parameter. If the model encounters one of
976
- * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
977
- * and the response `stop_sequence` value will contain the matched stop sequence.
978
- */
979
- stop_sequences?: Array<string>;
980
-
981
- /**
982
- * Body param: Whether to incrementally stream the response using server-sent
983
- * events.
984
- *
985
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
986
- * details.
987
- */
988
- stream?: boolean;
989
-
990
- /**
991
- * Body param: System prompt.
992
- *
993
- * A system prompt is a way of providing context and instructions to Claude, such
994
- * as specifying a particular goal or role. See our
995
- * [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
996
- */
997
- system?: string | Array<BetaTextBlockParam>;
998
-
999
- /**
1000
- * Body param: Amount of randomness injected into the response.
1001
- *
1002
- * Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
1003
- * for analytical / multiple choice, and closer to `1.0` for creative and
1004
- * generative tasks.
1005
- *
1006
- * Note that even with `temperature` of `0.0`, the results will not be fully
1007
- * deterministic.
1008
- */
1009
- temperature?: number;
1010
-
1011
- /**
1012
- * Body param:
1013
- */
1014
- thinking?: BetaThinkingConfigEnabled | BetaThinkingConfigDisabled;
1015
-
1016
- /**
1017
- * Body param: How the model should use the provided tools. The model can use a
1018
- * specific tool, any available tool, or decide by itself.
1019
- */
1020
- tool_choice?: BetaToolChoice;
1021
-
1022
- /**
1023
- * Body param: Definitions of tools that the model may use.
1024
- *
1025
- * If you include `tools` in your API request, the model may return `tool_use`
1026
- * content blocks that represent the model's use of those tools. You can then run
1027
- * those tools using the tool input generated by the model and then optionally
1028
- * return results back to the model using `tool_result` content blocks.
1029
- *
1030
- * Each tool definition includes:
1031
- *
1032
- * - `name`: Name of the tool.
1033
- * - `description`: Optional, but strongly-recommended description of the tool.
1034
- * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
1035
- * tool `input` shape that the model will produce in `tool_use` output content
1036
- * blocks.
1037
- *
1038
- * For example, if you defined `tools` as:
1039
- *
1040
- * ```json
1041
- * [
1042
- * {
1043
- * "name": "get_stock_price",
1044
- * "description": "Get the current stock price for a given ticker symbol.",
1045
- * "input_schema": {
1046
- * "type": "object",
1047
- * "properties": {
1048
- * "ticker": {
1049
- * "type": "string",
1050
- * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
1051
- * }
1052
- * },
1053
- * "required": ["ticker"]
1054
- * }
1055
- * }
1056
- * ]
1057
- * ```
1058
- *
1059
- * And then asked the model "What's the S&P 500 at today?", the model might produce
1060
- * `tool_use` content blocks in the response like this:
1061
- *
1062
- * ```json
1063
- * [
1064
- * {
1065
- * "type": "tool_use",
1066
- * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
1067
- * "name": "get_stock_price",
1068
- * "input": { "ticker": "^GSPC" }
1069
- * }
1070
- * ]
1071
- * ```
1072
- *
1073
- * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
1074
- * input, and return the following back to the model in a subsequent `user`
1075
- * message:
1076
- *
1077
- * ```json
1078
- * [
1079
- * {
1080
- * "type": "tool_result",
1081
- * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
1082
- * "content": "259.75 USD"
1083
- * }
1084
- * ]
1085
- * ```
1086
- *
1087
- * Tools can be used for workflows that include running client-side tools and
1088
- * functions, or more generally whenever you want the model to produce a particular
1089
- * JSON structure of output.
1090
- *
1091
- * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
1092
- */
1093
- tools?: Array<BetaToolUnion>;
1094
-
1095
- /**
1096
- * Body param: Only sample from the top K options for each subsequent token.
1097
- *
1098
- * Used to remove "long tail" low probability responses.
1099
- * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
1100
- *
1101
- * Recommended for advanced use cases only. You usually only need to use
1102
- * `temperature`.
1103
- */
1104
- top_k?: number;
1105
-
1106
- /**
1107
- * Body param: Use nucleus sampling.
1108
- *
1109
- * In nucleus sampling, we compute the cumulative distribution over all the options
1110
- * for each subsequent token in decreasing probability order and cut it off once it
1111
- * reaches a particular probability specified by `top_p`. You should either alter
1112
- * `temperature` or `top_p`, but not both.
1113
- *
1114
- * Recommended for advanced use cases only. You usually only need to use
1115
- * `temperature`.
1116
- */
1117
- top_p?: number;
1118
-
1119
- /**
1120
- * Header param: Optional header to specify the beta version(s) you want to use.
1121
- */
1122
- betas?: Array<BetaAPI.AnthropicBeta>;
1123
- }
1124
-
1125
- export namespace MessageCreateParams {
1126
- export type MessageCreateParamsNonStreaming = MessagesMessagesAPI.MessageCreateParamsNonStreaming;
1127
- export type MessageCreateParamsStreaming = MessagesMessagesAPI.MessageCreateParamsStreaming;
1128
- }
1129
-
1130
- export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
1131
- /**
1132
- * Body param: Whether to incrementally stream the response using server-sent
1133
- * events.
1134
- *
1135
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
1136
- * details.
1137
- */
1138
- stream?: false;
1139
- }
1140
-
1141
- export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
1142
- /**
1143
- * Body param: Whether to incrementally stream the response using server-sent
1144
- * events.
1145
- *
1146
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
1147
- * details.
1148
- */
1149
- stream: true;
1150
- }
1151
-
1152
- export interface MessageCountTokensParams {
1153
- /**
1154
- * Body param: Input messages.
1155
- *
1156
- * Our models are trained to operate on alternating `user` and `assistant`
1157
- * conversational turns. When creating a new `Message`, you specify the prior
1158
- * conversational turns with the `messages` parameter, and the model then generates
1159
- * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
1160
- * in your request will be combined into a single turn.
1161
- *
1162
- * Each input message must be an object with a `role` and `content`. You can
1163
- * specify a single `user`-role message, or you can include multiple `user` and
1164
- * `assistant` messages.
1165
- *
1166
- * If the final message uses the `assistant` role, the response content will
1167
- * continue immediately from the content in that message. This can be used to
1168
- * constrain part of the model's response.
1169
- *
1170
- * Example with a single `user` message:
1171
- *
1172
- * ```json
1173
- * [{ "role": "user", "content": "Hello, Claude" }]
1174
- * ```
1175
- *
1176
- * Example with multiple conversational turns:
1177
- *
1178
- * ```json
1179
- * [
1180
- * { "role": "user", "content": "Hello there." },
1181
- * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
1182
- * { "role": "user", "content": "Can you explain LLMs in plain English?" }
1183
- * ]
1184
- * ```
1185
- *
1186
- * Example with a partially-filled response from Claude:
1187
- *
1188
- * ```json
1189
- * [
1190
- * {
1191
- * "role": "user",
1192
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
1193
- * },
1194
- * { "role": "assistant", "content": "The best answer is (" }
1195
- * ]
1196
- * ```
1197
- *
1198
- * Each input message `content` may be either a single `string` or an array of
1199
- * content blocks, where each block has a specific `type`. Using a `string` for
1200
- * `content` is shorthand for an array of one content block of type `"text"`. The
1201
- * following input messages are equivalent:
1202
- *
1203
- * ```json
1204
- * { "role": "user", "content": "Hello, Claude" }
1205
- * ```
1206
- *
1207
- * ```json
1208
- * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
1209
- * ```
1210
- *
1211
- * Starting with Claude 3 models, you can also send image content blocks:
1212
- *
1213
- * ```json
1214
- * {
1215
- * "role": "user",
1216
- * "content": [
1217
- * {
1218
- * "type": "image",
1219
- * "source": {
1220
- * "type": "base64",
1221
- * "media_type": "image/jpeg",
1222
- * "data": "/9j/4AAQSkZJRg..."
1223
- * }
1224
- * },
1225
- * { "type": "text", "text": "What is in this image?" }
1226
- * ]
1227
- * }
1228
- * ```
1229
- *
1230
- * We currently support the `base64` source type for images, and the `image/jpeg`,
1231
- * `image/png`, `image/gif`, and `image/webp` media types.
1232
- *
1233
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
1234
- * more input examples.
1235
- *
1236
- * Note that if you want to include a
1237
- * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
1238
- * the top-level `system` parameter — there is no `"system"` role for input
1239
- * messages in the Messages API.
1240
- */
1241
- messages: Array<BetaMessageParam>;
1242
-
1243
- /**
1244
- * Body param: The model that will complete your prompt.\n\nSee
1245
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
1246
- * details and options.
1247
- */
1248
- model: MessagesAPI.Model;
1249
-
1250
- /**
1251
- * Body param: System prompt.
1252
- *
1253
- * A system prompt is a way of providing context and instructions to Claude, such
1254
- * as specifying a particular goal or role. See our
1255
- * [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
1256
- */
1257
- system?: string | Array<BetaTextBlockParam>;
1258
-
1259
- /**
1260
- * Body param:
1261
- */
1262
- thinking?: BetaThinkingConfigEnabled | BetaThinkingConfigDisabled;
1263
-
1264
- /**
1265
- * Body param: How the model should use the provided tools. The model can use a
1266
- * specific tool, any available tool, or decide by itself.
1267
- */
1268
- tool_choice?: BetaToolChoice;
1269
-
1270
- /**
1271
- * Body param: Definitions of tools that the model may use.
1272
- *
1273
- * If you include `tools` in your API request, the model may return `tool_use`
1274
- * content blocks that represent the model's use of those tools. You can then run
1275
- * those tools using the tool input generated by the model and then optionally
1276
- * return results back to the model using `tool_result` content blocks.
1277
- *
1278
- * Each tool definition includes:
1279
- *
1280
- * - `name`: Name of the tool.
1281
- * - `description`: Optional, but strongly-recommended description of the tool.
1282
- * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
1283
- * tool `input` shape that the model will produce in `tool_use` output content
1284
- * blocks.
1285
- *
1286
- * For example, if you defined `tools` as:
1287
- *
1288
- * ```json
1289
- * [
1290
- * {
1291
- * "name": "get_stock_price",
1292
- * "description": "Get the current stock price for a given ticker symbol.",
1293
- * "input_schema": {
1294
- * "type": "object",
1295
- * "properties": {
1296
- * "ticker": {
1297
- * "type": "string",
1298
- * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
1299
- * }
1300
- * },
1301
- * "required": ["ticker"]
1302
- * }
1303
- * }
1304
- * ]
1305
- * ```
1306
- *
1307
- * And then asked the model "What's the S&P 500 at today?", the model might produce
1308
- * `tool_use` content blocks in the response like this:
1309
- *
1310
- * ```json
1311
- * [
1312
- * {
1313
- * "type": "tool_use",
1314
- * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
1315
- * "name": "get_stock_price",
1316
- * "input": { "ticker": "^GSPC" }
1317
- * }
1318
- * ]
1319
- * ```
1320
- *
1321
- * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
1322
- * input, and return the following back to the model in a subsequent `user`
1323
- * message:
1324
- *
1325
- * ```json
1326
- * [
1327
- * {
1328
- * "type": "tool_result",
1329
- * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
1330
- * "content": "259.75 USD"
1331
- * }
1332
- * ]
1333
- * ```
1334
- *
1335
- * Tools can be used for workflows that include running client-side tools and
1336
- * functions, or more generally whenever you want the model to produce a particular
1337
- * JSON structure of output.
1338
- *
1339
- * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
1340
- */
1341
- tools?: Array<
1342
- | BetaToolComputerUse20241022
1343
- | BetaToolBash20241022
1344
- | BetaToolTextEditor20241022
1345
- | BetaToolBash20250124
1346
- | BetaToolTextEditor20250124
1347
- | BetaTool
1348
- >;
1349
-
1350
- /**
1351
- * Header param: Optional header to specify the beta version(s) you want to use.
1352
- */
1353
- betas?: Array<BetaAPI.AnthropicBeta>;
1354
- }
1355
-
1356
- Messages.Batches = Batches;
1357
- Messages.BetaMessageBatchesPage = BetaMessageBatchesPage;
1358
-
1359
- export declare namespace Messages {
1360
- export {
1361
- type BetaBase64PDFBlock as BetaBase64PDFBlock,
1362
- type BetaBase64PDFSource as BetaBase64PDFSource,
1363
- type BetaCacheControlEphemeral as BetaCacheControlEphemeral,
1364
- type BetaCitationCharLocation as BetaCitationCharLocation,
1365
- type BetaCitationCharLocationParam as BetaCitationCharLocationParam,
1366
- type BetaCitationContentBlockLocation as BetaCitationContentBlockLocation,
1367
- type BetaCitationContentBlockLocationParam as BetaCitationContentBlockLocationParam,
1368
- type BetaCitationPageLocation as BetaCitationPageLocation,
1369
- type BetaCitationPageLocationParam as BetaCitationPageLocationParam,
1370
- type BetaCitationsConfigParam as BetaCitationsConfigParam,
1371
- type BetaCitationsDelta as BetaCitationsDelta,
1372
- type BetaContentBlock as BetaContentBlock,
1373
- type BetaContentBlockParam as BetaContentBlockParam,
1374
- type BetaContentBlockSource as BetaContentBlockSource,
1375
- type BetaContentBlockSourceContent as BetaContentBlockSourceContent,
1376
- type BetaImageBlockParam as BetaImageBlockParam,
1377
- type BetaInputJSONDelta as BetaInputJSONDelta,
1378
- type BetaMessage as BetaMessage,
1379
- type BetaMessageDeltaUsage as BetaMessageDeltaUsage,
1380
- type BetaMessageParam as BetaMessageParam,
1381
- type BetaMessageTokensCount as BetaMessageTokensCount,
1382
- type BetaMetadata as BetaMetadata,
1383
- type BetaPlainTextSource as BetaPlainTextSource,
1384
- type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent,
1385
- type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent,
1386
- type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent,
1387
- type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent,
1388
- type BetaRawMessageStartEvent as BetaRawMessageStartEvent,
1389
- type BetaRawMessageStopEvent as BetaRawMessageStopEvent,
1390
- type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent,
1391
- type BetaRedactedThinkingBlock as BetaRedactedThinkingBlock,
1392
- type BetaRedactedThinkingBlockParam as BetaRedactedThinkingBlockParam,
1393
- type BetaSignatureDelta as BetaSignatureDelta,
1394
- type BetaTextBlock as BetaTextBlock,
1395
- type BetaTextBlockParam as BetaTextBlockParam,
1396
- type BetaTextCitation as BetaTextCitation,
1397
- type BetaTextCitationParam as BetaTextCitationParam,
1398
- type BetaTextDelta as BetaTextDelta,
1399
- type BetaThinkingBlock as BetaThinkingBlock,
1400
- type BetaThinkingBlockParam as BetaThinkingBlockParam,
1401
- type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
1402
- type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
1403
- type BetaThinkingDelta as BetaThinkingDelta,
1404
- type BetaTool as BetaTool,
1405
- type BetaToolBash20241022 as BetaToolBash20241022,
1406
- type BetaToolBash20250124 as BetaToolBash20250124,
1407
- type BetaToolChoice as BetaToolChoice,
1408
- type BetaToolChoiceAny as BetaToolChoiceAny,
1409
- type BetaToolChoiceAuto as BetaToolChoiceAuto,
1410
- type BetaToolChoiceTool as BetaToolChoiceTool,
1411
- type BetaToolComputerUse20241022 as BetaToolComputerUse20241022,
1412
- type BetaToolResultBlockParam as BetaToolResultBlockParam,
1413
- type BetaToolTextEditor20241022 as BetaToolTextEditor20241022,
1414
- type BetaToolTextEditor20250124 as BetaToolTextEditor20250124,
1415
- type BetaToolUnion as BetaToolUnion,
1416
- type BetaToolUseBlock as BetaToolUseBlock,
1417
- type BetaToolUseBlockParam as BetaToolUseBlockParam,
1418
- type BetaUsage as BetaUsage,
1419
- type MessageCreateParams as MessageCreateParams,
1420
- type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
1421
- type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
1422
- type MessageCountTokensParams as MessageCountTokensParams,
1423
- };
1424
-
1425
- export {
1426
- Batches as Batches,
1427
- type BetaDeletedMessageBatch as BetaDeletedMessageBatch,
1428
- type BetaMessageBatch as BetaMessageBatch,
1429
- type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult,
1430
- type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult,
1431
- type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult,
1432
- type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse,
1433
- type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts,
1434
- type BetaMessageBatchResult as BetaMessageBatchResult,
1435
- type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult,
1436
- BetaMessageBatchesPage as BetaMessageBatchesPage,
1437
- type BatchCreateParams as BatchCreateParams,
1438
- type BatchRetrieveParams as BatchRetrieveParams,
1439
- type BatchListParams as BatchListParams,
1440
- type BatchDeleteParams as BatchDeleteParams,
1441
- type BatchCancelParams as BatchCancelParams,
1442
- type BatchResultsParams as BatchResultsParams,
1443
- };
1444
- }