@credal/sdk 0.0.13 → 0.0.15

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 (332) hide show
  1. package/Client.d.ts +3 -0
  2. package/api/resources/common/types/index.d.ts +1 -0
  3. package/api/resources/common/types/index.js +1 -0
  4. package/api/resources/copilots/client/Client.d.ts +25 -11
  5. package/api/resources/copilots/client/Client.js +119 -37
  6. package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -1
  7. package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  8. package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +14 -1
  9. package/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +60 -0
  10. package/api/resources/copilots/client/requests/StreamMessageRequest.js +5 -0
  11. package/api/resources/copilots/client/requests/index.d.ts +1 -0
  12. package/api/resources/copilots/types/BlockedChunk.d.ts +10 -0
  13. package/api/resources/copilots/types/BlockedChunk.js +5 -0
  14. package/api/resources/copilots/types/BooleanFieldSchema.d.ts +8 -0
  15. package/api/resources/copilots/types/BooleanFieldSchema.js +5 -0
  16. package/api/resources/copilots/types/CollectionFilteredData.d.ts +9 -0
  17. package/api/resources/copilots/types/CollectionFilteredData.js +5 -0
  18. package/api/resources/copilots/types/DataChunk.d.ts +6 -0
  19. package/api/resources/copilots/types/DataChunk.js +5 -0
  20. package/api/resources/copilots/types/DataFilter.d.ts +9 -0
  21. package/api/resources/copilots/types/DataFilter.js +5 -0
  22. package/api/resources/copilots/types/DatetimeFieldSchema.d.ts +9 -0
  23. package/api/resources/copilots/types/DatetimeFieldSchema.js +5 -0
  24. package/api/resources/copilots/types/Filter.d.ts +19 -0
  25. package/api/resources/copilots/types/Filter.js +5 -0
  26. package/api/resources/copilots/types/FinalChunk.d.ts +7 -0
  27. package/api/resources/copilots/types/FinalChunk.js +5 -0
  28. package/api/resources/copilots/types/InitialChunk.d.ts +10 -0
  29. package/api/resources/copilots/types/InitialChunk.js +5 -0
  30. package/api/resources/copilots/types/InputVariable.d.ts +7 -0
  31. package/api/resources/copilots/types/InputVariable.js +5 -0
  32. package/api/resources/copilots/types/MessageReply.d.ts +1 -0
  33. package/api/resources/copilots/types/NumberFieldSchema.d.ts +9 -0
  34. package/api/resources/copilots/types/NumberFieldSchema.js +5 -0
  35. package/api/resources/copilots/types/StreamingChunk.d.ts +5 -0
  36. package/api/resources/copilots/types/StreamingChunk.js +5 -0
  37. package/api/resources/copilots/types/StringFieldSchema.d.ts +9 -0
  38. package/api/resources/copilots/types/StringFieldSchema.js +5 -0
  39. package/api/resources/copilots/types/WebSearchResult.d.ts +8 -0
  40. package/api/resources/copilots/types/WebSearchResult.js +5 -0
  41. package/api/resources/copilots/types/index.d.ts +14 -0
  42. package/api/resources/copilots/types/index.js +14 -0
  43. package/api/resources/documentCatalog/client/Client.d.ts +7 -4
  44. package/api/resources/documentCatalog/client/Client.js +13 -13
  45. package/api/resources/documentCollections/client/Client.d.ts +14 -11
  46. package/api/resources/documentCollections/client/Client.js +39 -29
  47. package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +2 -2
  48. package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -1
  49. package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +2 -2
  50. package/api/resources/permissionsService/client/Client.d.ts +8 -5
  51. package/api/resources/permissionsService/client/Client.js +20 -14
  52. package/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +1 -1
  53. package/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +1 -1
  54. package/api/resources/search/client/Client.d.ts +5 -2
  55. package/api/resources/search/client/Client.js +7 -7
  56. package/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -1
  57. package/api/resources/search/types/index.d.ts +0 -1
  58. package/api/resources/search/types/index.js +0 -1
  59. package/api/resources/users/client/Client.d.ts +4 -1
  60. package/api/resources/users/client/Client.js +5 -3
  61. package/core/fetcher/Fetcher.d.ts +4 -1
  62. package/core/fetcher/Fetcher.js +19 -176
  63. package/core/fetcher/createRequestUrl.d.ts +1 -0
  64. package/core/fetcher/createRequestUrl.js +13 -0
  65. package/core/fetcher/getFetchFn.d.ts +4 -0
  66. package/core/fetcher/getFetchFn.js +59 -0
  67. package/core/fetcher/getRequestBody.d.ts +7 -0
  68. package/core/fetcher/getRequestBody.js +23 -0
  69. package/core/fetcher/getResponseBody.d.ts +1 -0
  70. package/core/fetcher/getResponseBody.js +55 -0
  71. package/core/fetcher/makeRequest.d.ts +1 -0
  72. package/core/fetcher/makeRequest.js +42 -0
  73. package/core/fetcher/requestWithRetries.d.ts +1 -0
  74. package/core/fetcher/requestWithRetries.js +41 -0
  75. package/core/fetcher/signals.d.ts +12 -0
  76. package/core/fetcher/signals.js +37 -0
  77. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  78. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  79. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  80. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  81. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  82. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  83. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  84. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  85. package/core/index.d.ts +1 -0
  86. package/core/index.js +1 -0
  87. package/core/runtime/runtime.d.ts +2 -1
  88. package/core/runtime/runtime.js +12 -1
  89. package/core/schemas/Schema.d.ts +8 -4
  90. package/core/schemas/Schema.js +1 -0
  91. package/core/schemas/builders/bigint/bigint.d.ts +2 -0
  92. package/core/schemas/builders/bigint/bigint.js +50 -0
  93. package/core/schemas/builders/bigint/index.d.ts +1 -0
  94. package/core/schemas/builders/bigint/index.js +5 -0
  95. package/core/schemas/builders/index.d.ts +1 -0
  96. package/core/schemas/builders/index.js +1 -0
  97. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  98. package/core/schemas/builders/lazy/lazy.js +8 -19
  99. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  100. package/core/schemas/builders/list/list.js +31 -44
  101. package/core/schemas/builders/object/object.js +90 -111
  102. package/core/schemas/builders/object/types.d.ts +2 -2
  103. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  104. package/core/schemas/builders/record/record.js +49 -60
  105. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  106. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  107. package/core/schemas/builders/set/set.js +6 -15
  108. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  109. package/core/schemas/builders/union/union.js +51 -62
  110. package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  111. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  112. package/core/streaming-fetcher/Stream.d.ts +48 -0
  113. package/core/streaming-fetcher/Stream.js +170 -0
  114. package/core/streaming-fetcher/index.d.ts +1 -0
  115. package/core/streaming-fetcher/index.js +5 -0
  116. package/dist/Client.d.ts +3 -0
  117. package/dist/api/resources/common/types/index.d.ts +1 -0
  118. package/dist/api/resources/common/types/index.js +1 -0
  119. package/dist/api/resources/copilots/client/Client.d.ts +25 -11
  120. package/dist/api/resources/copilots/client/Client.js +119 -37
  121. package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -1
  122. package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  123. package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +14 -1
  124. package/dist/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +60 -0
  125. package/dist/api/resources/copilots/client/requests/StreamMessageRequest.js +5 -0
  126. package/dist/api/resources/copilots/client/requests/index.d.ts +1 -0
  127. package/dist/api/resources/copilots/types/BlockedChunk.d.ts +10 -0
  128. package/dist/api/resources/copilots/types/BlockedChunk.js +5 -0
  129. package/dist/api/resources/copilots/types/BooleanFieldSchema.d.ts +8 -0
  130. package/dist/api/resources/copilots/types/BooleanFieldSchema.js +5 -0
  131. package/dist/api/resources/copilots/types/CollectionFilteredData.d.ts +9 -0
  132. package/dist/api/resources/copilots/types/CollectionFilteredData.js +5 -0
  133. package/dist/api/resources/copilots/types/DataChunk.d.ts +6 -0
  134. package/dist/api/resources/copilots/types/DataChunk.js +5 -0
  135. package/dist/api/resources/copilots/types/DataFilter.d.ts +9 -0
  136. package/dist/api/resources/copilots/types/DataFilter.js +5 -0
  137. package/dist/api/resources/copilots/types/DatetimeFieldSchema.d.ts +9 -0
  138. package/dist/api/resources/copilots/types/DatetimeFieldSchema.js +5 -0
  139. package/dist/api/resources/copilots/types/Filter.d.ts +19 -0
  140. package/dist/api/resources/copilots/types/Filter.js +5 -0
  141. package/dist/api/resources/copilots/types/FinalChunk.d.ts +7 -0
  142. package/dist/api/resources/copilots/types/FinalChunk.js +5 -0
  143. package/dist/api/resources/copilots/types/InitialChunk.d.ts +10 -0
  144. package/dist/api/resources/copilots/types/InitialChunk.js +5 -0
  145. package/dist/api/resources/copilots/types/InputVariable.d.ts +7 -0
  146. package/dist/api/resources/copilots/types/InputVariable.js +5 -0
  147. package/dist/api/resources/copilots/types/MessageReply.d.ts +1 -0
  148. package/dist/api/resources/copilots/types/NumberFieldSchema.d.ts +9 -0
  149. package/dist/api/resources/copilots/types/NumberFieldSchema.js +5 -0
  150. package/dist/api/resources/copilots/types/StreamingChunk.d.ts +5 -0
  151. package/dist/api/resources/copilots/types/StreamingChunk.js +5 -0
  152. package/dist/api/resources/copilots/types/StringFieldSchema.d.ts +9 -0
  153. package/dist/api/resources/copilots/types/StringFieldSchema.js +5 -0
  154. package/dist/api/resources/copilots/types/WebSearchResult.d.ts +8 -0
  155. package/dist/api/resources/copilots/types/WebSearchResult.js +5 -0
  156. package/dist/api/resources/copilots/types/index.d.ts +14 -0
  157. package/dist/api/resources/copilots/types/index.js +14 -0
  158. package/dist/api/resources/documentCatalog/client/Client.d.ts +7 -4
  159. package/dist/api/resources/documentCatalog/client/Client.js +13 -13
  160. package/dist/api/resources/documentCollections/client/Client.d.ts +14 -11
  161. package/dist/api/resources/documentCollections/client/Client.js +39 -29
  162. package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +2 -2
  163. package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -1
  164. package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +2 -2
  165. package/dist/api/resources/permissionsService/client/Client.d.ts +8 -5
  166. package/dist/api/resources/permissionsService/client/Client.js +20 -14
  167. package/dist/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +1 -1
  168. package/dist/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +1 -1
  169. package/dist/api/resources/search/client/Client.d.ts +5 -2
  170. package/dist/api/resources/search/client/Client.js +7 -7
  171. package/dist/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -1
  172. package/dist/api/resources/search/types/index.d.ts +0 -1
  173. package/dist/api/resources/search/types/index.js +0 -1
  174. package/dist/api/resources/users/client/Client.d.ts +4 -1
  175. package/dist/api/resources/users/client/Client.js +5 -3
  176. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  177. package/dist/core/fetcher/Fetcher.js +19 -176
  178. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  179. package/dist/core/fetcher/createRequestUrl.js +13 -0
  180. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  181. package/dist/core/fetcher/getFetchFn.js +59 -0
  182. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  183. package/dist/core/fetcher/getRequestBody.js +23 -0
  184. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  185. package/dist/core/fetcher/getResponseBody.js +55 -0
  186. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  187. package/dist/core/fetcher/makeRequest.js +42 -0
  188. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  189. package/dist/core/fetcher/requestWithRetries.js +41 -0
  190. package/dist/core/fetcher/signals.d.ts +12 -0
  191. package/dist/core/fetcher/signals.js +37 -0
  192. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  193. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  194. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  195. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  196. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  197. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  198. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  199. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  200. package/dist/core/index.d.ts +1 -0
  201. package/dist/core/index.js +1 -0
  202. package/dist/core/runtime/runtime.d.ts +2 -1
  203. package/dist/core/runtime/runtime.js +12 -1
  204. package/dist/core/schemas/Schema.d.ts +8 -4
  205. package/dist/core/schemas/Schema.js +1 -0
  206. package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
  207. package/dist/core/schemas/builders/bigint/bigint.js +50 -0
  208. package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
  209. package/dist/core/schemas/builders/bigint/index.js +5 -0
  210. package/dist/core/schemas/builders/index.d.ts +1 -0
  211. package/dist/core/schemas/builders/index.js +1 -0
  212. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  213. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  214. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  215. package/dist/core/schemas/builders/list/list.js +31 -44
  216. package/dist/core/schemas/builders/object/object.js +90 -111
  217. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  218. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  219. package/dist/core/schemas/builders/record/record.js +49 -60
  220. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  221. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  222. package/dist/core/schemas/builders/set/set.js +6 -15
  223. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  224. package/dist/core/schemas/builders/union/union.js +51 -62
  225. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  226. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  227. package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
  228. package/dist/core/streaming-fetcher/Stream.js +170 -0
  229. package/dist/core/streaming-fetcher/index.d.ts +1 -0
  230. package/dist/core/streaming-fetcher/index.js +5 -0
  231. package/dist/serialization/resources/common/types/index.d.ts +1 -0
  232. package/dist/serialization/resources/common/types/index.js +1 -0
  233. package/dist/serialization/resources/copilots/client/requests/SendMessageRequest.d.ts +2 -0
  234. package/dist/serialization/resources/copilots/client/requests/SendMessageRequest.js +2 -0
  235. package/dist/serialization/resources/copilots/client/requests/StreamMessageRequest.d.ts +17 -0
  236. package/dist/serialization/resources/copilots/client/requests/StreamMessageRequest.js +38 -0
  237. package/dist/serialization/resources/copilots/client/requests/index.d.ts +1 -0
  238. package/dist/serialization/resources/copilots/client/requests/index.js +3 -1
  239. package/dist/serialization/resources/copilots/types/BlockedChunk.d.ts +16 -0
  240. package/dist/serialization/resources/copilots/types/BlockedChunk.js +37 -0
  241. package/dist/serialization/resources/copilots/types/BooleanFieldSchema.d.ts +14 -0
  242. package/dist/serialization/resources/copilots/types/BooleanFieldSchema.js +35 -0
  243. package/dist/serialization/resources/copilots/types/CollectionFilteredData.d.ts +15 -0
  244. package/dist/serialization/resources/copilots/types/CollectionFilteredData.js +36 -0
  245. package/dist/serialization/resources/copilots/types/DataChunk.d.ts +12 -0
  246. package/dist/serialization/resources/copilots/types/DataChunk.js +33 -0
  247. package/dist/serialization/resources/copilots/types/DataFilter.d.ts +15 -0
  248. package/dist/serialization/resources/copilots/types/DataFilter.js +36 -0
  249. package/dist/serialization/resources/copilots/types/DatetimeFieldSchema.d.ts +15 -0
  250. package/dist/serialization/resources/copilots/types/DatetimeFieldSchema.js +36 -0
  251. package/dist/serialization/resources/copilots/types/Filter.d.ts +26 -0
  252. package/dist/serialization/resources/copilots/types/Filter.js +45 -0
  253. package/dist/serialization/resources/copilots/types/FinalChunk.d.ts +13 -0
  254. package/dist/serialization/resources/copilots/types/FinalChunk.js +34 -0
  255. package/dist/serialization/resources/copilots/types/InitialChunk.d.ts +17 -0
  256. package/dist/serialization/resources/copilots/types/InitialChunk.js +38 -0
  257. package/dist/serialization/resources/copilots/types/InputVariable.d.ts +13 -0
  258. package/dist/serialization/resources/copilots/types/InputVariable.js +34 -0
  259. package/dist/serialization/resources/copilots/types/MessageReply.d.ts +2 -0
  260. package/dist/serialization/resources/copilots/types/MessageReply.js +2 -0
  261. package/dist/serialization/resources/copilots/types/NumberFieldSchema.d.ts +15 -0
  262. package/dist/serialization/resources/copilots/types/NumberFieldSchema.js +36 -0
  263. package/dist/serialization/resources/copilots/types/StreamingChunk.d.ts +14 -0
  264. package/dist/serialization/resources/copilots/types/StreamingChunk.js +35 -0
  265. package/dist/serialization/resources/copilots/types/StringFieldSchema.d.ts +15 -0
  266. package/dist/serialization/resources/copilots/types/StringFieldSchema.js +36 -0
  267. package/dist/serialization/resources/copilots/types/WebSearchResult.d.ts +14 -0
  268. package/dist/serialization/resources/copilots/types/WebSearchResult.js +35 -0
  269. package/dist/serialization/resources/copilots/types/index.d.ts +14 -0
  270. package/dist/serialization/resources/copilots/types/index.js +14 -0
  271. package/dist/serialization/resources/search/types/SingleFieldFilter.d.ts +1 -1
  272. package/dist/serialization/resources/search/types/SingleFieldFilter.js +1 -1
  273. package/dist/serialization/resources/search/types/index.d.ts +0 -1
  274. package/dist/serialization/resources/search/types/index.js +0 -1
  275. package/dist/version.d.ts +1 -0
  276. package/dist/version.js +4 -0
  277. package/package.json +12 -2
  278. package/reference.md +203 -511
  279. package/serialization/resources/common/types/index.d.ts +1 -0
  280. package/serialization/resources/common/types/index.js +1 -0
  281. package/serialization/resources/copilots/client/requests/SendMessageRequest.d.ts +2 -0
  282. package/serialization/resources/copilots/client/requests/SendMessageRequest.js +2 -0
  283. package/serialization/resources/copilots/client/requests/StreamMessageRequest.d.ts +17 -0
  284. package/serialization/resources/copilots/client/requests/StreamMessageRequest.js +38 -0
  285. package/serialization/resources/copilots/client/requests/index.d.ts +1 -0
  286. package/serialization/resources/copilots/client/requests/index.js +3 -1
  287. package/serialization/resources/copilots/types/BlockedChunk.d.ts +16 -0
  288. package/serialization/resources/copilots/types/BlockedChunk.js +37 -0
  289. package/serialization/resources/copilots/types/BooleanFieldSchema.d.ts +14 -0
  290. package/serialization/resources/copilots/types/BooleanFieldSchema.js +35 -0
  291. package/serialization/resources/copilots/types/CollectionFilteredData.d.ts +15 -0
  292. package/serialization/resources/copilots/types/CollectionFilteredData.js +36 -0
  293. package/serialization/resources/copilots/types/DataChunk.d.ts +12 -0
  294. package/serialization/resources/copilots/types/DataChunk.js +33 -0
  295. package/serialization/resources/copilots/types/DataFilter.d.ts +15 -0
  296. package/serialization/resources/copilots/types/DataFilter.js +36 -0
  297. package/serialization/resources/copilots/types/DatetimeFieldSchema.d.ts +15 -0
  298. package/serialization/resources/copilots/types/DatetimeFieldSchema.js +36 -0
  299. package/serialization/resources/copilots/types/Filter.d.ts +26 -0
  300. package/serialization/resources/copilots/types/Filter.js +45 -0
  301. package/serialization/resources/copilots/types/FinalChunk.d.ts +13 -0
  302. package/serialization/resources/copilots/types/FinalChunk.js +34 -0
  303. package/serialization/resources/copilots/types/InitialChunk.d.ts +17 -0
  304. package/serialization/resources/copilots/types/InitialChunk.js +38 -0
  305. package/serialization/resources/copilots/types/InputVariable.d.ts +13 -0
  306. package/serialization/resources/copilots/types/InputVariable.js +34 -0
  307. package/serialization/resources/copilots/types/MessageReply.d.ts +2 -0
  308. package/serialization/resources/copilots/types/MessageReply.js +2 -0
  309. package/serialization/resources/copilots/types/NumberFieldSchema.d.ts +15 -0
  310. package/serialization/resources/copilots/types/NumberFieldSchema.js +36 -0
  311. package/serialization/resources/copilots/types/StreamingChunk.d.ts +14 -0
  312. package/serialization/resources/copilots/types/StreamingChunk.js +35 -0
  313. package/serialization/resources/copilots/types/StringFieldSchema.d.ts +15 -0
  314. package/serialization/resources/copilots/types/StringFieldSchema.js +36 -0
  315. package/serialization/resources/copilots/types/WebSearchResult.d.ts +14 -0
  316. package/serialization/resources/copilots/types/WebSearchResult.js +35 -0
  317. package/serialization/resources/copilots/types/index.d.ts +14 -0
  318. package/serialization/resources/copilots/types/index.js +14 -0
  319. package/serialization/resources/search/types/SingleFieldFilter.d.ts +1 -1
  320. package/serialization/resources/search/types/SingleFieldFilter.js +1 -1
  321. package/serialization/resources/search/types/index.d.ts +0 -1
  322. package/serialization/resources/search/types/index.js +0 -1
  323. package/version.d.ts +1 -0
  324. package/version.js +4 -0
  325. /package/api/resources/{search → common}/types/Operator.d.ts +0 -0
  326. /package/api/resources/{search → common}/types/Operator.js +0 -0
  327. /package/dist/api/resources/{search → common}/types/Operator.d.ts +0 -0
  328. /package/dist/api/resources/{search → common}/types/Operator.js +0 -0
  329. /package/dist/serialization/resources/{search → common}/types/Operator.d.ts +0 -0
  330. /package/dist/serialization/resources/{search → common}/types/Operator.js +0 -0
  331. /package/serialization/resources/{search → common}/types/Operator.d.ts +0 -0
  332. /package/serialization/resources/{search → common}/types/Operator.js +0 -0
package/Client.d.ts CHANGED
@@ -16,8 +16,11 @@ export declare namespace CredalClient {
16
16
  fetcher?: core.FetchFunction;
17
17
  }
18
18
  interface RequestOptions {
19
+ /** The maximum time to wait for a response in seconds. */
19
20
  timeoutInSeconds?: number;
21
+ /** The number of times to retry the request. Defaults to 2. */
20
22
  maxRetries?: number;
23
+ /** A hook to abort the request. */
21
24
  abortSignal?: AbortSignal;
22
25
  }
23
26
  }
@@ -4,3 +4,4 @@ export * from "./Url";
4
4
  export * from "./ResourceType";
5
5
  export * from "./Collaborator";
6
6
  export * from "./Role";
7
+ export * from "./Operator";
@@ -20,3 +20,4 @@ __exportStar(require("./Url"), exports);
20
20
  __exportStar(require("./ResourceType"), exports);
21
21
  __exportStar(require("./Collaborator"), exports);
22
22
  __exportStar(require("./Role"), exports);
23
+ __exportStar(require("./Operator"), exports);
@@ -11,8 +11,11 @@ export declare namespace Copilots {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -26,12 +29,12 @@ export declare class Copilots {
26
29
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
27
30
  *
28
31
  * @example
29
- * await credal.copilots.createCopilot({
32
+ * await client.copilots.createCopilot({
30
33
  * name: "Customer Copilot",
31
34
  * description: "This copilot is used to answer customer requests based on internal documentation.",
32
35
  * collaborators: [{
33
36
  * email: "test@gmail.com",
34
- * role: Credal.Role.Editor
37
+ * role: "editor"
35
38
  * }]
36
39
  * })
37
40
  */
@@ -43,7 +46,7 @@ export declare class Copilots {
43
46
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
44
47
  *
45
48
  * @example
46
- * await credal.copilots.createConversation({
49
+ * await client.copilots.createConversation({
47
50
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
48
51
  * userEmail: "ravin@credal.ai"
49
52
  * })
@@ -54,12 +57,12 @@ export declare class Copilots {
54
57
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
55
58
  *
56
59
  * @example
57
- * await credal.copilots.provideMessageFeedback({
60
+ * await client.copilots.provideMessageFeedback({
58
61
  * userEmail: "ravin@credal.ai",
59
62
  * messageId: "dd721cd8-4bf2-4b94-9869-258df3dab9dc",
60
63
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
61
64
  * messageFeedback: {
62
- * feedback: Credal.FeedbackEnum.Negative,
65
+ * feedback: "NEGATIVE",
63
66
  * suggestedAnswer: "Yes, Credal is SOC 2 compliant."
64
67
  * }
65
68
  * })
@@ -70,13 +73,24 @@ export declare class Copilots {
70
73
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
71
74
  *
72
75
  * @example
73
- * await credal.copilots.sendMessage({
76
+ * await client.copilots.sendMessage({
74
77
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
75
78
  * message: "Is Credal SOC 2 compliant?",
76
- * userEmail: "ravin@credal.ai"
79
+ * userEmail: "ravin@credal.ai",
80
+ * inputVariables: [{
81
+ * name: "input1",
82
+ * urls: ["https://drive.google.com/file/d/123456/view"]
83
+ * }, {
84
+ * name: "input2",
85
+ * urls: ["https://drive.google.com/file/d/123457/view", "https://drive.google.com/file/d/123458/view"]
86
+ * }]
77
87
  * })
78
88
  */
79
89
  sendMessage(request: Credal.SendMessageRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.SendAgentMessageResponse>;
90
+ /**
91
+ * This endpoint allows you to send a message to a specific copilot and get the response back as a streamed set of Server-Sent Events.
92
+ */
93
+ streamMessage(request: Credal.StreamMessageRequest, requestOptions?: Copilots.RequestOptions): Promise<core.Stream<Credal.StreamingChunk>>;
80
94
  /**
81
95
  * Link a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
82
96
  *
@@ -84,7 +98,7 @@ export declare class Copilots {
84
98
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
85
99
  *
86
100
  * @example
87
- * await credal.copilots.addCollectionToCopilot({
101
+ * await client.copilots.addCollectionToCopilot({
88
102
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
89
103
  * collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
90
104
  * })
@@ -97,7 +111,7 @@ export declare class Copilots {
97
111
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
98
112
  *
99
113
  * @example
100
- * await credal.copilots.removeCollectionFromCopilot({
114
+ * await client.copilots.removeCollectionFromCopilot({
101
115
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
102
116
  * collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
103
117
  * })
@@ -110,7 +124,7 @@ export declare class Copilots {
110
124
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
111
125
  *
112
126
  * @example
113
- * await credal.copilots.updateConfiguration({
127
+ * await client.copilots.updateConfiguration({
114
128
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
115
129
  * configuration: {
116
130
  * name: "Customer Copilot",
@@ -129,7 +143,7 @@ export declare class Copilots {
129
143
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
130
144
  *
131
145
  * @example
132
- * await credal.copilots.deleteCopilot({
146
+ * await client.copilots.deleteCopilot({
133
147
  * id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
134
148
  * })
135
149
  */
@@ -55,12 +55,12 @@ class Copilots {
55
55
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @example
58
- * await credal.copilots.createCopilot({
58
+ * await client.copilots.createCopilot({
59
59
  * name: "Customer Copilot",
60
60
  * description: "This copilot is used to answer customer requests based on internal documentation.",
61
61
  * collaborators: [{
62
62
  * email: "test@gmail.com",
63
- * role: Credal.Role.Editor
63
+ * role: "editor"
64
64
  * }]
65
65
  * })
66
66
  */
@@ -74,18 +74,20 @@ class Copilots {
74
74
  Authorization: yield this._getAuthorizationHeader(),
75
75
  "X-Fern-Language": "JavaScript",
76
76
  "X-Fern-SDK-Name": "@credal/sdk",
77
- "X-Fern-SDK-Version": "0.0.13",
77
+ "X-Fern-SDK-Version": "0.0.15",
78
+ "User-Agent": "@credal/sdk/0.0.15",
78
79
  "X-Fern-Runtime": core.RUNTIME.type,
79
80
  "X-Fern-Runtime-Version": core.RUNTIME.version,
80
81
  },
81
82
  contentType: "application/json",
82
- body: yield serializers.CreateCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
83
+ requestType: "json",
84
+ body: serializers.CreateCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
83
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
84
86
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
85
87
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
88
  });
87
89
  if (_response.ok) {
88
- return yield serializers.CreateCopilotResponse.parseOrThrow(_response.body, {
90
+ return serializers.CreateCopilotResponse.parseOrThrow(_response.body, {
89
91
  unrecognizedObjectKeys: "passthrough",
90
92
  allowUnrecognizedUnionMembers: true,
91
93
  allowUnrecognizedEnumValues: true,
@@ -120,7 +122,7 @@ class Copilots {
120
122
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
121
123
  *
122
124
  * @example
123
- * await credal.copilots.createConversation({
125
+ * await client.copilots.createConversation({
124
126
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
125
127
  * userEmail: "ravin@credal.ai"
126
128
  * })
@@ -135,18 +137,20 @@ class Copilots {
135
137
  Authorization: yield this._getAuthorizationHeader(),
136
138
  "X-Fern-Language": "JavaScript",
137
139
  "X-Fern-SDK-Name": "@credal/sdk",
138
- "X-Fern-SDK-Version": "0.0.13",
140
+ "X-Fern-SDK-Version": "0.0.15",
141
+ "User-Agent": "@credal/sdk/0.0.15",
139
142
  "X-Fern-Runtime": core.RUNTIME.type,
140
143
  "X-Fern-Runtime-Version": core.RUNTIME.version,
141
144
  },
142
145
  contentType: "application/json",
143
- body: yield serializers.CreateConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
146
+ requestType: "json",
147
+ body: serializers.CreateConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
144
148
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
145
149
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
146
150
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
147
151
  });
148
152
  if (_response.ok) {
149
- return yield serializers.CreateConversationResponse.parseOrThrow(_response.body, {
153
+ return serializers.CreateConversationResponse.parseOrThrow(_response.body, {
150
154
  unrecognizedObjectKeys: "passthrough",
151
155
  allowUnrecognizedUnionMembers: true,
152
156
  allowUnrecognizedEnumValues: true,
@@ -179,12 +183,12 @@ class Copilots {
179
183
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
180
184
  *
181
185
  * @example
182
- * await credal.copilots.provideMessageFeedback({
186
+ * await client.copilots.provideMessageFeedback({
183
187
  * userEmail: "ravin@credal.ai",
184
188
  * messageId: "dd721cd8-4bf2-4b94-9869-258df3dab9dc",
185
189
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
186
190
  * messageFeedback: {
187
- * feedback: Credal.FeedbackEnum.Negative,
191
+ * feedback: "NEGATIVE",
188
192
  * suggestedAnswer: "Yes, Credal is SOC 2 compliant."
189
193
  * }
190
194
  * })
@@ -199,14 +203,14 @@ class Copilots {
199
203
  Authorization: yield this._getAuthorizationHeader(),
200
204
  "X-Fern-Language": "JavaScript",
201
205
  "X-Fern-SDK-Name": "@credal/sdk",
202
- "X-Fern-SDK-Version": "0.0.13",
206
+ "X-Fern-SDK-Version": "0.0.15",
207
+ "User-Agent": "@credal/sdk/0.0.15",
203
208
  "X-Fern-Runtime": core.RUNTIME.type,
204
209
  "X-Fern-Runtime-Version": core.RUNTIME.version,
205
210
  },
206
211
  contentType: "application/json",
207
- body: yield serializers.ProvideMessageFeedbackRequest.jsonOrThrow(request, {
208
- unrecognizedObjectKeys: "strip",
209
- }),
212
+ requestType: "json",
213
+ body: serializers.ProvideMessageFeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
210
214
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
211
215
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
212
216
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -240,10 +244,17 @@ class Copilots {
240
244
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
241
245
  *
242
246
  * @example
243
- * await credal.copilots.sendMessage({
247
+ * await client.copilots.sendMessage({
244
248
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
245
249
  * message: "Is Credal SOC 2 compliant?",
246
- * userEmail: "ravin@credal.ai"
250
+ * userEmail: "ravin@credal.ai",
251
+ * inputVariables: [{
252
+ * name: "input1",
253
+ * urls: ["https://drive.google.com/file/d/123456/view"]
254
+ * }, {
255
+ * name: "input2",
256
+ * urls: ["https://drive.google.com/file/d/123457/view", "https://drive.google.com/file/d/123458/view"]
257
+ * }]
247
258
  * })
248
259
  */
249
260
  sendMessage(request, requestOptions) {
@@ -256,18 +267,20 @@ class Copilots {
256
267
  Authorization: yield this._getAuthorizationHeader(),
257
268
  "X-Fern-Language": "JavaScript",
258
269
  "X-Fern-SDK-Name": "@credal/sdk",
259
- "X-Fern-SDK-Version": "0.0.13",
270
+ "X-Fern-SDK-Version": "0.0.15",
271
+ "User-Agent": "@credal/sdk/0.0.15",
260
272
  "X-Fern-Runtime": core.RUNTIME.type,
261
273
  "X-Fern-Runtime-Version": core.RUNTIME.version,
262
274
  },
263
275
  contentType: "application/json",
264
- body: yield serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
276
+ requestType: "json",
277
+ body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
265
278
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
266
279
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
267
280
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
268
281
  });
269
282
  if (_response.ok) {
270
- return yield serializers.SendAgentMessageResponse.parseOrThrow(_response.body, {
283
+ return serializers.SendAgentMessageResponse.parseOrThrow(_response.body, {
271
284
  unrecognizedObjectKeys: "passthrough",
272
285
  allowUnrecognizedUnionMembers: true,
273
286
  allowUnrecognizedEnumValues: true,
@@ -295,6 +308,71 @@ class Copilots {
295
308
  }
296
309
  });
297
310
  }
311
+ /**
312
+ * This endpoint allows you to send a message to a specific copilot and get the response back as a streamed set of Server-Sent Events.
313
+ */
314
+ streamMessage(request, requestOptions) {
315
+ var _a, _b;
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
318
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
319
+ method: "POST",
320
+ headers: {
321
+ Authorization: yield this._getAuthorizationHeader(),
322
+ "X-Fern-Language": "JavaScript",
323
+ "X-Fern-SDK-Name": "@credal/sdk",
324
+ "X-Fern-SDK-Version": "0.0.15",
325
+ "User-Agent": "@credal/sdk/0.0.15",
326
+ "X-Fern-Runtime": core.RUNTIME.type,
327
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
328
+ },
329
+ contentType: "application/json",
330
+ requestType: "json",
331
+ body: serializers.StreamMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
332
+ responseType: "sse",
333
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
334
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
335
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
336
+ });
337
+ if (_response.ok) {
338
+ return new core.Stream({
339
+ stream: _response.body,
340
+ parse: (data) => __awaiter(this, void 0, void 0, function* () {
341
+ return serializers.StreamingChunk.parseOrThrow(data, {
342
+ unrecognizedObjectKeys: "passthrough",
343
+ allowUnrecognizedUnionMembers: true,
344
+ allowUnrecognizedEnumValues: true,
345
+ breadcrumbsPrefix: ["response"],
346
+ });
347
+ }),
348
+ signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
349
+ eventShape: {
350
+ type: "sse",
351
+ streamTerminator: "[DONE]",
352
+ },
353
+ });
354
+ }
355
+ if (_response.error.reason === "status-code") {
356
+ throw new errors.CredalError({
357
+ statusCode: _response.error.statusCode,
358
+ body: _response.error.body,
359
+ });
360
+ }
361
+ switch (_response.error.reason) {
362
+ case "non-json":
363
+ throw new errors.CredalError({
364
+ statusCode: _response.error.statusCode,
365
+ body: _response.error.rawBody,
366
+ });
367
+ case "timeout":
368
+ throw new errors.CredalTimeoutError();
369
+ case "unknown":
370
+ throw new errors.CredalError({
371
+ message: _response.error.errorMessage,
372
+ });
373
+ }
374
+ });
375
+ }
298
376
  /**
299
377
  * Link a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
300
378
  *
@@ -302,7 +380,7 @@ class Copilots {
302
380
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
303
381
  *
304
382
  * @example
305
- * await credal.copilots.addCollectionToCopilot({
383
+ * await client.copilots.addCollectionToCopilot({
306
384
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
307
385
  * collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
308
386
  * })
@@ -317,14 +395,14 @@ class Copilots {
317
395
  Authorization: yield this._getAuthorizationHeader(),
318
396
  "X-Fern-Language": "JavaScript",
319
397
  "X-Fern-SDK-Name": "@credal/sdk",
320
- "X-Fern-SDK-Version": "0.0.13",
398
+ "X-Fern-SDK-Version": "0.0.15",
399
+ "User-Agent": "@credal/sdk/0.0.15",
321
400
  "X-Fern-Runtime": core.RUNTIME.type,
322
401
  "X-Fern-Runtime-Version": core.RUNTIME.version,
323
402
  },
324
403
  contentType: "application/json",
325
- body: yield serializers.AddCollectionToCopilotRequest.jsonOrThrow(request, {
326
- unrecognizedObjectKeys: "strip",
327
- }),
404
+ requestType: "json",
405
+ body: serializers.AddCollectionToCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
328
406
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
329
407
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
330
408
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -360,7 +438,7 @@ class Copilots {
360
438
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
361
439
  *
362
440
  * @example
363
- * await credal.copilots.removeCollectionFromCopilot({
441
+ * await client.copilots.removeCollectionFromCopilot({
364
442
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
365
443
  * collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
366
444
  * })
@@ -375,12 +453,14 @@ class Copilots {
375
453
  Authorization: yield this._getAuthorizationHeader(),
376
454
  "X-Fern-Language": "JavaScript",
377
455
  "X-Fern-SDK-Name": "@credal/sdk",
378
- "X-Fern-SDK-Version": "0.0.13",
456
+ "X-Fern-SDK-Version": "0.0.15",
457
+ "User-Agent": "@credal/sdk/0.0.15",
379
458
  "X-Fern-Runtime": core.RUNTIME.type,
380
459
  "X-Fern-Runtime-Version": core.RUNTIME.version,
381
460
  },
382
461
  contentType: "application/json",
383
- body: yield serializers.RemoveCollectionFromCopilotRequest.jsonOrThrow(request, {
462
+ requestType: "json",
463
+ body: serializers.RemoveCollectionFromCopilotRequest.jsonOrThrow(request, {
384
464
  unrecognizedObjectKeys: "strip",
385
465
  }),
386
466
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -418,7 +498,7 @@ class Copilots {
418
498
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
419
499
  *
420
500
  * @example
421
- * await credal.copilots.updateConfiguration({
501
+ * await client.copilots.updateConfiguration({
422
502
  * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
423
503
  * configuration: {
424
504
  * name: "Customer Copilot",
@@ -441,14 +521,14 @@ class Copilots {
441
521
  Authorization: yield this._getAuthorizationHeader(),
442
522
  "X-Fern-Language": "JavaScript",
443
523
  "X-Fern-SDK-Name": "@credal/sdk",
444
- "X-Fern-SDK-Version": "0.0.13",
524
+ "X-Fern-SDK-Version": "0.0.15",
525
+ "User-Agent": "@credal/sdk/0.0.15",
445
526
  "X-Fern-Runtime": core.RUNTIME.type,
446
527
  "X-Fern-Runtime-Version": core.RUNTIME.version,
447
528
  },
448
529
  contentType: "application/json",
449
- body: yield serializers.UpdateConfigurationRequest.jsonOrThrow(request, {
450
- unrecognizedObjectKeys: "strip",
451
- }),
530
+ requestType: "json",
531
+ body: serializers.UpdateConfigurationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
452
532
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
453
533
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
454
534
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -482,7 +562,7 @@ class Copilots {
482
562
  * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
483
563
  *
484
564
  * @example
485
- * await credal.copilots.deleteCopilot({
565
+ * await client.copilots.deleteCopilot({
486
566
  * id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
487
567
  * })
488
568
  */
@@ -496,18 +576,20 @@ class Copilots {
496
576
  Authorization: yield this._getAuthorizationHeader(),
497
577
  "X-Fern-Language": "JavaScript",
498
578
  "X-Fern-SDK-Name": "@credal/sdk",
499
- "X-Fern-SDK-Version": "0.0.13",
579
+ "X-Fern-SDK-Version": "0.0.15",
580
+ "User-Agent": "@credal/sdk/0.0.15",
500
581
  "X-Fern-Runtime": core.RUNTIME.type,
501
582
  "X-Fern-Runtime-Version": core.RUNTIME.version,
502
583
  },
503
584
  contentType: "application/json",
504
- body: yield serializers.DeleteCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
585
+ requestType: "json",
586
+ body: serializers.DeleteCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
505
587
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
506
588
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
507
589
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
508
590
  });
509
591
  if (_response.ok) {
510
- return yield serializers.DeleteCopilotResponse.parseOrThrow(_response.body, {
592
+ return serializers.DeleteCopilotResponse.parseOrThrow(_response.body, {
511
593
  unrecognizedObjectKeys: "passthrough",
512
594
  allowUnrecognizedUnionMembers: true,
513
595
  allowUnrecognizedEnumValues: true,
@@ -9,7 +9,7 @@ import * as Credal from "../../../../index";
9
9
  * description: "This copilot is used to answer customer requests based on internal documentation.",
10
10
  * collaborators: [{
11
11
  * email: "test@gmail.com",
12
- * role: Credal.Role.Editor
12
+ * role: "editor"
13
13
  * }]
14
14
  * }
15
15
  */
@@ -9,7 +9,7 @@ import * as Credal from "../../../../index";
9
9
  * messageId: "dd721cd8-4bf2-4b94-9869-258df3dab9dc",
10
10
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
11
11
  * messageFeedback: {
12
- * feedback: Credal.FeedbackEnum.Negative,
12
+ * feedback: "NEGATIVE",
13
13
  * suggestedAnswer: "Yes, Credal is SOC 2 compliant."
14
14
  * }
15
15
  * }
@@ -1,12 +1,20 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Credal from "../../../../index";
4
5
  /**
5
6
  * @example
6
7
  * {
7
8
  * agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
8
9
  * message: "Is Credal SOC 2 compliant?",
9
- * userEmail: "ravin@credal.ai"
10
+ * userEmail: "ravin@credal.ai",
11
+ * inputVariables: [{
12
+ * name: "input1",
13
+ * urls: ["https://drive.google.com/file/d/123456/view"]
14
+ * }, {
15
+ * name: "input2",
16
+ * urls: ["https://drive.google.com/file/d/123457/view", "https://drive.google.com/file/d/123458/view"]
17
+ * }]
10
18
  * }
11
19
  */
12
20
  export interface SendMessageRequest {
@@ -30,4 +38,9 @@ export interface SendMessageRequest {
30
38
  *
31
39
  */
32
40
  conversationId?: string;
41
+ /**
42
+ * Optional input variables to be used in the message. Map the name of the variable to a list of urls.
43
+ *
44
+ */
45
+ inputVariables?: Credal.InputVariable[];
33
46
  }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
9
+ * message: "Is Credal SOC 2 compliant?",
10
+ * email: "ravin@credal.ai",
11
+ * inputVariables: [{
12
+ * name: "input1",
13
+ * urls: ["https://drive.google.com/file/d/123456/view"]
14
+ * }, {
15
+ * name: "input2",
16
+ * urls: ["https://drive.google.com/file/d/123457/view", "https://drive.google.com/file/d/123458/view"]
17
+ * }]
18
+ * }
19
+ *
20
+ * @example
21
+ * {
22
+ * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
23
+ * message: "Is this user eligible for benefits based on their date of birth?",
24
+ * email: "ravin@credal.ai",
25
+ * inputVariables: [{
26
+ * name: "input1",
27
+ * urls: ["https://drive.google.com/file/d/123456/view"]
28
+ * }, {
29
+ * name: "input2",
30
+ * urls: ["https://drive.google.com/file/d/123457/view", "https://drive.google.com/file/d/123458/view"]
31
+ * }]
32
+ * }
33
+ */
34
+ export interface StreamMessageRequest {
35
+ /**
36
+ * Credal-generated Copilot ID to specify which agent to route the request to.
37
+ *
38
+ */
39
+ copilotId: string;
40
+ /**
41
+ * The message you want to send to your copilot.
42
+ *
43
+ */
44
+ message: string;
45
+ /**
46
+ * The user profile you want to use when sending the message.
47
+ *
48
+ */
49
+ email: string;
50
+ /**
51
+ * Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations.
52
+ *
53
+ */
54
+ conversationId?: string;
55
+ /**
56
+ * Optional input variables to be used in the message. Map the name of the variable to a list of urls.
57
+ *
58
+ */
59
+ inputVariables?: Credal.InputVariable[];
60
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,7 @@ export { type CreateCopilotRequest } from "./CreateCopilotRequest";
2
2
  export { type CreateConversationRequest } from "./CreateConversationRequest";
3
3
  export { type ProvideMessageFeedbackRequest } from "./ProvideMessageFeedbackRequest";
4
4
  export { type SendMessageRequest } from "./SendMessageRequest";
5
+ export { type StreamMessageRequest } from "./StreamMessageRequest";
5
6
  export { type AddCollectionToCopilotRequest } from "./AddCollectionToCopilotRequest";
6
7
  export { type RemoveCollectionFromCopilotRequest } from "./RemoveCollectionFromCopilotRequest";
7
8
  export { type UpdateConfigurationRequest } from "./UpdateConfigurationRequest";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../index";
5
+ export interface BlockedChunk {
6
+ conversationId: string;
7
+ warnings: string[];
8
+ blocks: string[];
9
+ policyTriggers: Credal.PolicyTrigger[];
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface BooleanFieldSchema {
5
+ field: string;
6
+ operator: "==";
7
+ value: boolean;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../index";
5
+ export interface CollectionFilteredData {
6
+ collectionId: string;
7
+ filteredDataIds: string[];
8
+ filters: Credal.Filter[];
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });