@gleanwork/api-client 0.19.2 → 0.20.1
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.
- package/README.md +38 -0
- package/dist/commonjs/__tests__/summarize.test.js +2 -4
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/funcs/chatCreate.d.ts +2 -8
- package/dist/commonjs/funcs/chatCreate.d.ts.map +1 -1
- package/dist/commonjs/funcs/chatCreate.js +4 -13
- package/dist/commonjs/funcs/chatCreate.js.map +1 -1
- package/dist/commonjs/funcs/chatCreateStream.d.ts +20 -0
- package/dist/commonjs/funcs/chatCreateStream.d.ts.map +1 -0
- package/dist/commonjs/funcs/chatCreateStream.js +134 -0
- package/dist/commonjs/funcs/chatCreateStream.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/event-streams.d.ts +23 -0
- package/dist/commonjs/lib/event-streams.d.ts.map +1 -0
- package/dist/commonjs/lib/event-streams.js +168 -0
- package/dist/commonjs/lib/event-streams.js.map +1 -0
- package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/commonjs/models/components/index.d.ts +15 -1
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +15 -1
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/platformchatcompletedresponse.d.ts +4 -4
- package/dist/commonjs/models/components/platformchatcompletedresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/platformchatcompletedresponse.js +4 -5
- package/dist/commonjs/models/components/platformchatcompletedresponse.js.map +1 -1
- package/dist/commonjs/models/components/platformchatfailedresponse.d.ts +44 -0
- package/dist/commonjs/models/components/platformchatfailedresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatfailedresponse.js +71 -0
- package/dist/commonjs/models/components/platformchatfailedresponse.js.map +1 -0
- package/dist/commonjs/models/components/platformchatresponseerror.d.ts +16 -0
- package/dist/commonjs/models/components/platformchatresponseerror.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatresponseerror.js +52 -0
- package/dist/commonjs/models/components/platformchatresponseerror.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreameventserversentevent.d.ts +17 -0
- package/dist/commonjs/models/components/platformchatstreameventserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreameventserversentevent.js +62 -0
- package/dist/commonjs/models/components/platformchatstreameventserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.d.ts +24 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.js +58 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdone.d.ts +24 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdone.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdone.js +58 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdone.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamprogress.d.ts +29 -0
- package/dist/commonjs/models/components/platformchatstreamprogress.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamprogress.js +58 -0
- package/dist/commonjs/models/components/platformchatstreamprogress.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompleted.d.ts +25 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompleted.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompleted.js +60 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompleted.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreated.d.ts +23 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreated.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreated.js +57 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreated.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailed.d.ts +25 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailed.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailed.js +59 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailed.js.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.d.ts +13 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.js +64 -0
- package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/platformchatcreate.d.ts +41 -5
- package/dist/commonjs/models/operations/platformchatcreate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/platformchatcreate.js +20 -7
- package/dist/commonjs/models/operations/platformchatcreate.js.map +1 -1
- package/dist/commonjs/models/operations/platformchatcreatestream.d.ts +45 -0
- package/dist/commonjs/models/operations/platformchatcreatestream.d.ts.map +1 -0
- package/dist/commonjs/models/{components/platformchatcreaterequest.js → operations/platformchatcreatestream.js} +17 -14
- package/dist/commonjs/models/operations/platformchatcreatestream.js.map +1 -0
- package/dist/commonjs/react-query/chatCreate.d.ts +5 -11
- package/dist/commonjs/react-query/chatCreate.d.ts.map +1 -1
- package/dist/commonjs/react-query/chatCreate.js +1 -4
- package/dist/commonjs/react-query/chatCreate.js.map +1 -1
- package/dist/commonjs/react-query/chatCreateStream.d.ts +31 -0
- package/dist/commonjs/react-query/chatCreateStream.d.ts.map +1 -0
- package/dist/commonjs/react-query/chatCreateStream.js +48 -0
- package/dist/commonjs/react-query/chatCreateStream.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +10 -6
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +12 -4
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +2 -4
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/funcs/chatCreate.d.ts +2 -8
- package/dist/esm/funcs/chatCreate.d.ts.map +1 -1
- package/dist/esm/funcs/chatCreate.js +4 -12
- package/dist/esm/funcs/chatCreate.js.map +1 -1
- package/dist/esm/funcs/chatCreateStream.d.ts +20 -0
- package/dist/esm/funcs/chatCreateStream.d.ts.map +1 -0
- package/dist/esm/funcs/chatCreateStream.js +98 -0
- package/dist/esm/funcs/chatCreateStream.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/event-streams.d.ts +23 -0
- package/dist/esm/lib/event-streams.d.ts.map +1 -0
- package/dist/esm/lib/event-streams.js +164 -0
- package/dist/esm/lib/event-streams.js.map +1 -0
- package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/esm/models/components/index.d.ts +15 -1
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +15 -1
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/platformchatcompletedresponse.d.ts +4 -4
- package/dist/esm/models/components/platformchatcompletedresponse.d.ts.map +1 -1
- package/dist/esm/models/components/platformchatcompletedresponse.js +3 -4
- package/dist/esm/models/components/platformchatcompletedresponse.js.map +1 -1
- package/dist/esm/models/components/platformchatfailedresponse.d.ts +44 -0
- package/dist/esm/models/components/platformchatfailedresponse.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatfailedresponse.js +34 -0
- package/dist/esm/models/components/platformchatfailedresponse.js.map +1 -0
- package/dist/esm/models/components/platformchatresponseerror.d.ts +16 -0
- package/dist/esm/models/components/platformchatresponseerror.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatresponseerror.js +15 -0
- package/dist/esm/models/components/platformchatresponseerror.js.map +1 -0
- package/dist/esm/models/components/platformchatstreameventserversentevent.d.ts +17 -0
- package/dist/esm/models/components/platformchatstreameventserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreameventserversentevent.js +25 -0
- package/dist/esm/models/components/platformchatstreameventserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdelta.d.ts +24 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdelta.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdelta.js +21 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdelta.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdone.d.ts +24 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdone.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdone.js +21 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdone.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamprogress.d.ts +29 -0
- package/dist/esm/models/components/platformchatstreamprogress.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamprogress.js +21 -0
- package/dist/esm/models/components/platformchatstreamprogress.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamprogressserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamprogressserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamprogressserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamprogressserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecompleted.d.ts +25 -0
- package/dist/esm/models/components/platformchatstreamresponsecompleted.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecompleted.js +23 -0
- package/dist/esm/models/components/platformchatstreamresponsecompleted.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecreated.d.ts +23 -0
- package/dist/esm/models/components/platformchatstreamresponsecreated.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecreated.js +20 -0
- package/dist/esm/models/components/platformchatstreamresponsecreated.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsefailed.d.ts +25 -0
- package/dist/esm/models/components/platformchatstreamresponsefailed.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsefailed.js +22 -0
- package/dist/esm/models/components/platformchatstreamresponsefailed.js.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.d.ts +13 -0
- package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.d.ts.map +1 -0
- package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.js +27 -0
- package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/platformchatcreate.d.ts +41 -5
- package/dist/esm/models/operations/platformchatcreate.d.ts.map +1 -1
- package/dist/esm/models/operations/platformchatcreate.js +17 -5
- package/dist/esm/models/operations/platformchatcreate.js.map +1 -1
- package/dist/esm/models/operations/platformchatcreatestream.d.ts +45 -0
- package/dist/esm/models/operations/platformchatcreatestream.d.ts.map +1 -0
- package/dist/esm/models/operations/platformchatcreatestream.js +28 -0
- package/dist/esm/models/operations/platformchatcreatestream.js.map +1 -0
- package/dist/esm/react-query/chatCreate.d.ts +5 -11
- package/dist/esm/react-query/chatCreate.d.ts.map +1 -1
- package/dist/esm/react-query/chatCreate.js +1 -2
- package/dist/esm/react-query/chatCreate.js.map +1 -1
- package/dist/esm/react-query/chatCreateStream.d.ts +31 -0
- package/dist/esm/react-query/chatCreateStream.d.ts.map +1 -0
- package/dist/esm/react-query/chatCreateStream.js +43 -0
- package/dist/esm/react-query/chatCreateStream.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +10 -6
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +11 -2
- package/dist/esm/sdk/chat.js.map +1 -1
- package/jsr.json +2 -1
- package/package.json +1 -1
- package/src/__tests__/summarize.test.ts +2 -4
- package/src/funcs/chatCreate.ts +11 -20
- package/src/funcs/chatCreateStream.ts +197 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/event-streams.ts +192 -0
- package/src/models/components/chatmessagefragment.ts +1 -1
- package/src/models/components/index.ts +15 -1
- package/src/models/components/platformchatcompletedresponse.ts +9 -6
- package/src/models/components/platformchatfailedresponse.ts +92 -0
- package/src/models/components/platformchatresponseerror.ts +39 -0
- package/src/models/components/platformchatstreameventserversentevent.ts +69 -0
- package/src/models/components/platformchatstreamoutputtextdelta.ts +55 -0
- package/src/models/components/platformchatstreamoutputtextdeltaserversentevent.ts +55 -0
- package/src/models/components/platformchatstreamoutputtextdone.ts +55 -0
- package/src/models/components/platformchatstreamoutputtextdoneserversentevent.ts +55 -0
- package/src/models/components/platformchatstreamprogress.ts +59 -0
- package/src/models/components/platformchatstreamprogressserversentevent.ts +54 -0
- package/src/models/components/platformchatstreamresponsecompleted.ts +59 -0
- package/src/models/components/platformchatstreamresponsecompletedserversentevent.ts +55 -0
- package/src/models/components/platformchatstreamresponsecreated.ts +53 -0
- package/src/models/components/platformchatstreamresponsecreatedserversentevent.ts +55 -0
- package/src/models/components/platformchatstreamresponsefailed.ts +59 -0
- package/src/models/components/platformchatstreamresponsefailedserversentevent.ts +55 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/platformchatcreate.ts +75 -17
- package/src/models/operations/platformchatcreatestream.ts +96 -0
- package/src/react-query/chatCreate.ts +6 -8
- package/src/react-query/chatCreateStream.ts +115 -0
- package/src/react-query/index.ts +1 -0
- package/src/sdk/chat.ts +24 -7
- package/dist/commonjs/models/components/platformchatcreaterequest.d.ts +0 -50
- package/dist/commonjs/models/components/platformchatcreaterequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/platformchatcreaterequest.js.map +0 -1
- package/dist/esm/models/components/platformchatcreaterequest.d.ts +0 -50
- package/dist/esm/models/components/platformchatcreaterequest.d.ts.map +0 -1
- package/dist/esm/models/components/platformchatcreaterequest.js +0 -25
- package/dist/esm/models/components/platformchatcreaterequest.js.map +0 -1
- package/src/models/components/platformchatcreaterequest.ts +0 -90
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7b911127469b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import * as components from "../components/index.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
*/
|
|
14
|
+
export type PlatformChatCreateStreamInput =
|
|
15
|
+
| string
|
|
16
|
+
| Array<components.PlatformChatInputMessage>;
|
|
17
|
+
|
|
18
|
+
export type PlatformChatCreateStreamRequest = {
|
|
19
|
+
/**
|
|
20
|
+
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
*/
|
|
24
|
+
input: string | Array<components.PlatformChatInputMessage>;
|
|
25
|
+
stream?: true | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*/
|
|
31
|
+
store?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*/
|
|
37
|
+
conversation_id?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type PlatformChatCreateStreamInput$Outbound =
|
|
42
|
+
| string
|
|
43
|
+
| Array<components.PlatformChatInputMessage$Outbound>;
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const PlatformChatCreateStreamInput$outboundSchema: z.ZodType<
|
|
47
|
+
PlatformChatCreateStreamInput$Outbound,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
PlatformChatCreateStreamInput
|
|
50
|
+
> = z.union([
|
|
51
|
+
z.string(),
|
|
52
|
+
z.array(components.PlatformChatInputMessage$outboundSchema),
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
export function platformChatCreateStreamInputToJSON(
|
|
56
|
+
platformChatCreateStreamInput: PlatformChatCreateStreamInput,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
PlatformChatCreateStreamInput$outboundSchema.parse(
|
|
60
|
+
platformChatCreateStreamInput,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export type PlatformChatCreateStreamRequest$Outbound = {
|
|
67
|
+
input: string | Array<components.PlatformChatInputMessage$Outbound>;
|
|
68
|
+
stream: true;
|
|
69
|
+
store: boolean;
|
|
70
|
+
conversation_id?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const PlatformChatCreateStreamRequest$outboundSchema: z.ZodType<
|
|
75
|
+
PlatformChatCreateStreamRequest$Outbound,
|
|
76
|
+
z.ZodTypeDef,
|
|
77
|
+
PlatformChatCreateStreamRequest
|
|
78
|
+
> = z.object({
|
|
79
|
+
input: z.union([
|
|
80
|
+
z.string(),
|
|
81
|
+
z.array(components.PlatformChatInputMessage$outboundSchema),
|
|
82
|
+
]),
|
|
83
|
+
stream: z.literal(true).default(true as const),
|
|
84
|
+
store: z.boolean().default(true),
|
|
85
|
+
conversation_id: z.string().optional(),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export function platformChatCreateStreamRequestToJSON(
|
|
89
|
+
platformChatCreateStreamRequest: PlatformChatCreateStreamRequest,
|
|
90
|
+
): string {
|
|
91
|
+
return JSON.stringify(
|
|
92
|
+
PlatformChatCreateStreamRequest$outboundSchema.parse(
|
|
93
|
+
platformChatCreateStreamRequest,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
UseMutationResult,
|
|
10
10
|
} from "@tanstack/react-query";
|
|
11
11
|
import { GleanCore } from "../core.js";
|
|
12
|
-
import { chatCreate
|
|
12
|
+
import { chatCreate } from "../funcs/chatCreate.js";
|
|
13
13
|
import { combineSignals } from "../lib/primitives.js";
|
|
14
14
|
import { RequestOptions } from "../lib/sdks.js";
|
|
15
15
|
import * as components from "../models/components/index.js";
|
|
@@ -29,14 +29,12 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
29
29
|
import { useGleanContext } from "./_context.js";
|
|
30
30
|
import { MutationHookOptions } from "./_types.js";
|
|
31
31
|
|
|
32
|
-
export { CreateAcceptEnum } from "../funcs/chatCreate.js";
|
|
33
|
-
|
|
34
32
|
export type ChatCreateMutationVariables = {
|
|
35
|
-
request:
|
|
36
|
-
options?: RequestOptions
|
|
33
|
+
request: operations.PlatformChatCreateRequest;
|
|
34
|
+
options?: RequestOptions;
|
|
37
35
|
};
|
|
38
36
|
|
|
39
|
-
export type ChatCreateMutationData =
|
|
37
|
+
export type ChatCreateMutationData = components.PlatformChatCompletedResponse;
|
|
40
38
|
|
|
41
39
|
export type ChatCreateMutationError =
|
|
42
40
|
| errors.PlatformProblemDetailError
|
|
@@ -53,7 +51,7 @@ export type ChatCreateMutationError =
|
|
|
53
51
|
* Create a chat response
|
|
54
52
|
*
|
|
55
53
|
* @remarks
|
|
56
|
-
* Run an assistant turn.
|
|
54
|
+
* Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
|
|
57
55
|
*/
|
|
58
56
|
export function useChatCreateMutation(
|
|
59
57
|
options?: MutationHookOptions<
|
|
@@ -79,7 +77,7 @@ export function mutationKeyChatCreate(): MutationKey {
|
|
|
79
77
|
|
|
80
78
|
export function buildChatCreateMutation(
|
|
81
79
|
client$: GleanCore,
|
|
82
|
-
hookOptions?: RequestOptions
|
|
80
|
+
hookOptions?: RequestOptions,
|
|
83
81
|
): {
|
|
84
82
|
mutationKey: MutationKey;
|
|
85
83
|
mutationFn: (
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3f9fb5fbb84c
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
MutationKey,
|
|
8
|
+
useMutation,
|
|
9
|
+
UseMutationResult,
|
|
10
|
+
} from "@tanstack/react-query";
|
|
11
|
+
import { GleanCore } from "../core.js";
|
|
12
|
+
import { chatCreateStream } from "../funcs/chatCreateStream.js";
|
|
13
|
+
import { EventStream } from "../lib/event-streams.js";
|
|
14
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
15
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
16
|
+
import * as components from "../models/components/index.js";
|
|
17
|
+
import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/errors/httpclienterrors.js";
|
|
25
|
+
import * as errors from "../models/errors/index.js";
|
|
26
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
27
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
28
|
+
import * as operations from "../models/operations/index.js";
|
|
29
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
30
|
+
import { useGleanContext } from "./_context.js";
|
|
31
|
+
import { MutationHookOptions } from "./_types.js";
|
|
32
|
+
|
|
33
|
+
export type ChatCreateStreamMutationVariables = {
|
|
34
|
+
request: operations.PlatformChatCreateStreamRequest;
|
|
35
|
+
options?: RequestOptions;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ChatCreateStreamMutationData = EventStream<
|
|
39
|
+
components.PlatformChatStreamEventServerSentEvent
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
export type ChatCreateStreamMutationError =
|
|
43
|
+
| errors.PlatformProblemDetailError
|
|
44
|
+
| GleanBaseError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Create a chat response
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
|
|
58
|
+
*/
|
|
59
|
+
export function useChatCreateStreamMutation(
|
|
60
|
+
options?: MutationHookOptions<
|
|
61
|
+
ChatCreateStreamMutationData,
|
|
62
|
+
ChatCreateStreamMutationError,
|
|
63
|
+
ChatCreateStreamMutationVariables
|
|
64
|
+
>,
|
|
65
|
+
): UseMutationResult<
|
|
66
|
+
ChatCreateStreamMutationData,
|
|
67
|
+
ChatCreateStreamMutationError,
|
|
68
|
+
ChatCreateStreamMutationVariables
|
|
69
|
+
> {
|
|
70
|
+
const client = useGleanContext();
|
|
71
|
+
return useMutation({
|
|
72
|
+
...buildChatCreateStreamMutation(client, options),
|
|
73
|
+
...options,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function mutationKeyChatCreateStream(): MutationKey {
|
|
78
|
+
return ["@gleanwork/api-client", "chat", "createStream"];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function buildChatCreateStreamMutation(
|
|
82
|
+
client$: GleanCore,
|
|
83
|
+
hookOptions?: RequestOptions,
|
|
84
|
+
): {
|
|
85
|
+
mutationKey: MutationKey;
|
|
86
|
+
mutationFn: (
|
|
87
|
+
variables: ChatCreateStreamMutationVariables,
|
|
88
|
+
) => Promise<ChatCreateStreamMutationData>;
|
|
89
|
+
} {
|
|
90
|
+
return {
|
|
91
|
+
mutationKey: mutationKeyChatCreateStream(),
|
|
92
|
+
mutationFn: function chatCreateStreamMutationFn({
|
|
93
|
+
request,
|
|
94
|
+
options,
|
|
95
|
+
}): Promise<ChatCreateStreamMutationData> {
|
|
96
|
+
const mergedOptions = {
|
|
97
|
+
...hookOptions,
|
|
98
|
+
...options,
|
|
99
|
+
fetchOptions: {
|
|
100
|
+
...hookOptions?.fetchOptions,
|
|
101
|
+
...options?.fetchOptions,
|
|
102
|
+
signal: combineSignals(
|
|
103
|
+
hookOptions?.fetchOptions?.signal,
|
|
104
|
+
options?.fetchOptions?.signal,
|
|
105
|
+
),
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
return unwrapAsync(chatCreateStream(
|
|
109
|
+
client$,
|
|
110
|
+
request,
|
|
111
|
+
mergedOptions,
|
|
112
|
+
));
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./agentsGet.js";
|
|
|
11
11
|
export * from "./agentsGetSchemas.js";
|
|
12
12
|
export * from "./agentsSearch.js";
|
|
13
13
|
export * from "./chatCreate.js";
|
|
14
|
+
export * from "./chatCreateStream.js";
|
|
14
15
|
export * from "./clientActivityFeedback.js";
|
|
15
16
|
export * from "./clientActivityReport.js";
|
|
16
17
|
export * from "./clientAgentsCreate.js";
|
package/src/sdk/chat.ts
CHANGED
|
@@ -3,29 +3,46 @@
|
|
|
3
3
|
* @generated-id: c56babc22a20
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { chatCreate
|
|
6
|
+
import { chatCreate } from "../funcs/chatCreate.js";
|
|
7
|
+
import { chatCreateStream } from "../funcs/chatCreateStream.js";
|
|
8
|
+
import { EventStream } from "../lib/event-streams.js";
|
|
7
9
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
10
|
import * as components from "../models/components/index.js";
|
|
9
11
|
import * as operations from "../models/operations/index.js";
|
|
10
12
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
13
|
|
|
12
|
-
export { CreateAcceptEnum } from "../funcs/chatCreate.js";
|
|
13
|
-
|
|
14
14
|
export class Chat extends ClientSDK {
|
|
15
15
|
/**
|
|
16
16
|
* Create a chat response
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Run an assistant turn.
|
|
19
|
+
* Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
|
|
20
20
|
*/
|
|
21
21
|
async create(
|
|
22
|
-
request:
|
|
23
|
-
options?: RequestOptions
|
|
24
|
-
): Promise<
|
|
22
|
+
request: operations.PlatformChatCreateRequest,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): Promise<components.PlatformChatCompletedResponse> {
|
|
25
25
|
return unwrapAsync(chatCreate(
|
|
26
26
|
this,
|
|
27
27
|
request,
|
|
28
28
|
options,
|
|
29
29
|
));
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Create a chat response
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
|
|
37
|
+
*/
|
|
38
|
+
async createStream(
|
|
39
|
+
request: operations.PlatformChatCreateStreamRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): Promise<EventStream<components.PlatformChatStreamEventServerSentEvent>> {
|
|
42
|
+
return unwrapAsync(chatCreateStream(
|
|
43
|
+
this,
|
|
44
|
+
request,
|
|
45
|
+
options,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
31
48
|
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v3";
|
|
2
|
-
import { PlatformChatInputMessage, PlatformChatInputMessage$Outbound } from "./platformchatinputmessage.js";
|
|
3
|
-
/**
|
|
4
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
*/
|
|
8
|
-
export type Input = string | Array<PlatformChatInputMessage>;
|
|
9
|
-
export type PlatformChatCreateRequest = {
|
|
10
|
-
/**
|
|
11
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
*/
|
|
15
|
-
input: string | Array<PlatformChatInputMessage>;
|
|
16
|
-
/**
|
|
17
|
-
* When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
*/
|
|
21
|
-
stream?: boolean | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
*/
|
|
27
|
-
store?: boolean | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
*/
|
|
33
|
-
conversation_id?: string | undefined;
|
|
34
|
-
};
|
|
35
|
-
/** @internal */
|
|
36
|
-
export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
|
|
37
|
-
/** @internal */
|
|
38
|
-
export declare const Input$outboundSchema: z.ZodType<Input$Outbound, z.ZodTypeDef, Input>;
|
|
39
|
-
export declare function inputToJSON(input: Input): string;
|
|
40
|
-
/** @internal */
|
|
41
|
-
export type PlatformChatCreateRequest$Outbound = {
|
|
42
|
-
input: string | Array<PlatformChatInputMessage$Outbound>;
|
|
43
|
-
stream: boolean;
|
|
44
|
-
store: boolean;
|
|
45
|
-
conversation_id?: string | undefined;
|
|
46
|
-
};
|
|
47
|
-
/** @internal */
|
|
48
|
-
export declare const PlatformChatCreateRequest$outboundSchema: z.ZodType<PlatformChatCreateRequest$Outbound, z.ZodTypeDef, PlatformChatCreateRequest>;
|
|
49
|
-
export declare function platformChatCreateRequestToJSON(platformChatCreateRequest: PlatformChatCreateRequest): string;
|
|
50
|
-
//# sourceMappingURL=platformchatcreaterequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformchatcreaterequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAE/E,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,KAAK,CACoE,CAAC;AAE5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEhD;AAED,gBAAgB;AAChB,MAAM,MAAM,kCAAkC,GAAG;IAC/C,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CASzB,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformchatcreaterequest.js","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDH,kCAEC;AAyBD,0EAMC;AApFD,0CAA4B;AAC5B,+EAIuC;AAuCvC,gBAAgB;AACH,QAAA,oBAAoB,GAI7B,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,qEAAuC,CAAC,CAAC,CAAC,CAAC;AAE5E,SAAgB,WAAW,CAAC,KAAY;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,4BAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,CAAC;AAUD,gBAAgB;AACH,QAAA,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;QACb,CAAC,CAAC,MAAM,EAAE;QACV,CAAC,CAAC,KAAK,CAAC,qEAAuC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,SAAgB,+BAA+B,CAC7C,yBAAoD;IAEpD,OAAO,IAAI,CAAC,SAAS,CACnB,gDAAwC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v3";
|
|
2
|
-
import { PlatformChatInputMessage, PlatformChatInputMessage$Outbound } from "./platformchatinputmessage.js";
|
|
3
|
-
/**
|
|
4
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
*/
|
|
8
|
-
export type Input = string | Array<PlatformChatInputMessage>;
|
|
9
|
-
export type PlatformChatCreateRequest = {
|
|
10
|
-
/**
|
|
11
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
*/
|
|
15
|
-
input: string | Array<PlatformChatInputMessage>;
|
|
16
|
-
/**
|
|
17
|
-
* When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
*/
|
|
21
|
-
stream?: boolean | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
*/
|
|
27
|
-
store?: boolean | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
*/
|
|
33
|
-
conversation_id?: string | undefined;
|
|
34
|
-
};
|
|
35
|
-
/** @internal */
|
|
36
|
-
export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
|
|
37
|
-
/** @internal */
|
|
38
|
-
export declare const Input$outboundSchema: z.ZodType<Input$Outbound, z.ZodTypeDef, Input>;
|
|
39
|
-
export declare function inputToJSON(input: Input): string;
|
|
40
|
-
/** @internal */
|
|
41
|
-
export type PlatformChatCreateRequest$Outbound = {
|
|
42
|
-
input: string | Array<PlatformChatInputMessage$Outbound>;
|
|
43
|
-
stream: boolean;
|
|
44
|
-
store: boolean;
|
|
45
|
-
conversation_id?: string | undefined;
|
|
46
|
-
};
|
|
47
|
-
/** @internal */
|
|
48
|
-
export declare const PlatformChatCreateRequest$outboundSchema: z.ZodType<PlatformChatCreateRequest$Outbound, z.ZodTypeDef, PlatformChatCreateRequest>;
|
|
49
|
-
export declare function platformChatCreateRequestToJSON(platformChatCreateRequest: PlatformChatCreateRequest): string;
|
|
50
|
-
//# sourceMappingURL=platformchatcreaterequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformchatcreaterequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAE/E,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,KAAK,CACoE,CAAC;AAE5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEhD;AAED,gBAAgB;AAChB,MAAM,MAAM,kCAAkC,GAAG;IAC/C,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CASzB,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: a0537d504f7f
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { PlatformChatInputMessage$outboundSchema, } from "./platformchatinputmessage.js";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export const Input$outboundSchema = z.union([z.string(), z.array(PlatformChatInputMessage$outboundSchema)]);
|
|
9
|
-
export function inputToJSON(input) {
|
|
10
|
-
return JSON.stringify(Input$outboundSchema.parse(input));
|
|
11
|
-
}
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const PlatformChatCreateRequest$outboundSchema = z.object({
|
|
14
|
-
input: z.union([
|
|
15
|
-
z.string(),
|
|
16
|
-
z.array(PlatformChatInputMessage$outboundSchema),
|
|
17
|
-
]),
|
|
18
|
-
stream: z.boolean().default(false),
|
|
19
|
-
store: z.boolean().default(true),
|
|
20
|
-
conversation_id: z.string().optional(),
|
|
21
|
-
});
|
|
22
|
-
export function platformChatCreateRequestToJSON(platformChatCreateRequest) {
|
|
23
|
-
return JSON.stringify(PlatformChatCreateRequest$outboundSchema.parse(platformChatCreateRequest));
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=platformchatcreaterequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformchatcreaterequest.js","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,uCAAuC,GACxC,MAAM,+BAA+B,CAAC;AAuCvC,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAI7B,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,CAAC;AAUD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;QACb,CAAC,CAAC,MAAM,EAAE;QACV,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,+BAA+B,CAC7C,yBAAoD;IAEpD,OAAO,IAAI,CAAC,SAAS,CACnB,wCAAwC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: a0537d504f7f
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as z from "zod/v3";
|
|
7
|
-
import {
|
|
8
|
-
PlatformChatInputMessage,
|
|
9
|
-
PlatformChatInputMessage$Outbound,
|
|
10
|
-
PlatformChatInputMessage$outboundSchema,
|
|
11
|
-
} from "./platformchatinputmessage.js";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
*/
|
|
18
|
-
export type Input = string | Array<PlatformChatInputMessage>;
|
|
19
|
-
|
|
20
|
-
export type PlatformChatCreateRequest = {
|
|
21
|
-
/**
|
|
22
|
-
* Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
|
|
23
|
-
*
|
|
24
|
-
* @remarks
|
|
25
|
-
*/
|
|
26
|
-
input: string | Array<PlatformChatInputMessage>;
|
|
27
|
-
/**
|
|
28
|
-
* When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
*/
|
|
32
|
-
stream?: boolean | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
*/
|
|
38
|
-
store?: boolean | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
|
|
41
|
-
*
|
|
42
|
-
* @remarks
|
|
43
|
-
*/
|
|
44
|
-
conversation_id?: string | undefined;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/** @internal */
|
|
48
|
-
export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const Input$outboundSchema: z.ZodType<
|
|
52
|
-
Input$Outbound,
|
|
53
|
-
z.ZodTypeDef,
|
|
54
|
-
Input
|
|
55
|
-
> = z.union([z.string(), z.array(PlatformChatInputMessage$outboundSchema)]);
|
|
56
|
-
|
|
57
|
-
export function inputToJSON(input: Input): string {
|
|
58
|
-
return JSON.stringify(Input$outboundSchema.parse(input));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** @internal */
|
|
62
|
-
export type PlatformChatCreateRequest$Outbound = {
|
|
63
|
-
input: string | Array<PlatformChatInputMessage$Outbound>;
|
|
64
|
-
stream: boolean;
|
|
65
|
-
store: boolean;
|
|
66
|
-
conversation_id?: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/** @internal */
|
|
70
|
-
export const PlatformChatCreateRequest$outboundSchema: z.ZodType<
|
|
71
|
-
PlatformChatCreateRequest$Outbound,
|
|
72
|
-
z.ZodTypeDef,
|
|
73
|
-
PlatformChatCreateRequest
|
|
74
|
-
> = z.object({
|
|
75
|
-
input: z.union([
|
|
76
|
-
z.string(),
|
|
77
|
-
z.array(PlatformChatInputMessage$outboundSchema),
|
|
78
|
-
]),
|
|
79
|
-
stream: z.boolean().default(false),
|
|
80
|
-
store: z.boolean().default(true),
|
|
81
|
-
conversation_id: z.string().optional(),
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
export function platformChatCreateRequestToJSON(
|
|
85
|
-
platformChatCreateRequest: PlatformChatCreateRequest,
|
|
86
|
-
): string {
|
|
87
|
-
return JSON.stringify(
|
|
88
|
-
PlatformChatCreateRequest$outboundSchema.parse(platformChatCreateRequest),
|
|
89
|
-
);
|
|
90
|
-
}
|