syllable-sdk 0.1.0-alpha.7 → 0.1.0-alpha.9
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/docs/sdks/prompts/README.md +1 -3
- package/docs/sdks/syllablesdk/README.md +3 -0
- package/funcs/promptsUpdate.d.ts +1 -1
- package/funcs/promptsUpdate.d.ts.map +1 -1
- package/funcs/promptsUpdate.js +1 -1
- package/funcs/promptsUpdate.js.map +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/primitives.d.ts +2 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +53 -0
- package/lib/primitives.js.map +1 -1
- package/models/components/agentproperties.d.ts +3 -0
- package/models/components/agentproperties.d.ts.map +1 -1
- package/models/components/agentproperties.js +1 -0
- package/models/components/agentproperties.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/prompt.d.ts +13 -3
- package/models/components/prompt.d.ts.map +1 -1
- package/models/components/prompt.js +10 -4
- package/models/components/prompt.js.map +1 -1
- package/models/components/promptcreate.d.ts +5 -0
- package/models/components/promptcreate.d.ts.map +1 -1
- package/models/components/promptcreate.js +2 -0
- package/models/components/promptcreate.js.map +1 -1
- package/models/components/prompthistory.d.ts +2 -0
- package/models/components/prompthistory.d.ts.map +1 -1
- package/models/components/prompthistory.js +4 -0
- package/models/components/prompthistory.js.map +1 -1
- package/models/components/promptproperties.d.ts +12 -0
- package/models/components/promptproperties.d.ts.map +1 -1
- package/models/components/promptproperties.js +4 -0
- package/models/components/promptproperties.js.map +1 -1
- package/models/components/promptupdate.d.ts +68 -0
- package/models/components/promptupdate.d.ts.map +1 -0
- package/models/components/promptupdate.js +85 -0
- package/models/components/promptupdate.js.map +1 -0
- package/package.json +3 -1
- package/sdk/prompts.d.ts +1 -1
- package/sdk/prompts.d.ts.map +1 -1
- package/sdk/prompts.js.map +1 -1
- package/src/funcs/promptsUpdate.ts +2 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/primitives.ts +62 -0
- package/src/models/components/agentproperties.ts +1 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/prompt.ts +23 -7
- package/src/models/components/promptcreate.ts +7 -0
- package/src/models/components/prompthistory.ts +6 -0
- package/src/models/components/promptproperties.ts +4 -0
- package/src/models/components/promptupdate.ts +131 -0
- package/src/sdk/prompts.ts +1 -1
- package/src/types/operations.ts +11 -5
- package/types/operations.d.ts +5 -3
- package/types/operations.d.ts.map +1 -1
- package/types/operations.js +3 -0
- package/types/operations.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptproperties.js","sourceRoot":"","sources":["../../src/models/components/promptproperties.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAGZ,QAAA,gBAAgB,GAAG;IAC9B,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,YAAY;IACvB,aAAa,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"promptproperties.js","sourceRoot":"","sources":["../../src/models/components/promptproperties.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAGZ,QAAA,gBAAgB,GAAG;IAC9B,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,kBAAkB;IACnC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,YAAY;IACvB,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,iBAAiB;IAChC,UAAU,EAAE,aAAa;CACjB,CAAC;AAGX,gBAAgB;AACH,QAAA,8BAA8B,GAEvC,CAAC,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;AAEnC,gBAAgB;AACH,QAAA,+BAA+B,GAExC,sCAA8B,CAAC;AAEnC;;;GAGG;AACH,IAAiB,iBAAiB,CAKjC;AALD,WAAiB,iBAAiB;IAChC,gEAAgE;IACnD,+BAAa,GAAG,sCAA8B,CAAC;IAC5D,iEAAiE;IACpD,gCAAc,GAAG,uCAA+B,CAAC;AAChE,CAAC,EALgB,iBAAiB,iCAAjB,iBAAiB,QAKjC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import { LlmConfig, LlmConfig$Outbound } from "./llmconfig.js";
|
|
5
|
+
export type PromptUpdate = {
|
|
6
|
+
/**
|
|
7
|
+
* The Prompt name
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The description of the prompt
|
|
12
|
+
*/
|
|
13
|
+
description?: string | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The type of the prompt
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
/**
|
|
19
|
+
* The prompt text
|
|
20
|
+
*/
|
|
21
|
+
context?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The tools for the prompt
|
|
24
|
+
*/
|
|
25
|
+
tools?: Array<string> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The configuration for the language model used by the Cortex API.
|
|
28
|
+
*/
|
|
29
|
+
llmConfig: LlmConfig;
|
|
30
|
+
/**
|
|
31
|
+
* The Prompt ID
|
|
32
|
+
*/
|
|
33
|
+
id: number;
|
|
34
|
+
/**
|
|
35
|
+
* The comments for the last edit
|
|
36
|
+
*/
|
|
37
|
+
editComments?: string | null | undefined;
|
|
38
|
+
};
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const PromptUpdate$inboundSchema: z.ZodType<PromptUpdate, z.ZodTypeDef, unknown>;
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type PromptUpdate$Outbound = {
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string | null | undefined;
|
|
45
|
+
type: string;
|
|
46
|
+
context?: string | null | undefined;
|
|
47
|
+
tools?: Array<string> | undefined;
|
|
48
|
+
llm_config: LlmConfig$Outbound;
|
|
49
|
+
id: number;
|
|
50
|
+
edit_comments?: string | null | undefined;
|
|
51
|
+
};
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const PromptUpdate$outboundSchema: z.ZodType<PromptUpdate$Outbound, z.ZodTypeDef, PromptUpdate>;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export declare namespace PromptUpdate$ {
|
|
59
|
+
/** @deprecated use `PromptUpdate$inboundSchema` instead. */
|
|
60
|
+
const inboundSchema: z.ZodType<PromptUpdate, z.ZodTypeDef, unknown>;
|
|
61
|
+
/** @deprecated use `PromptUpdate$outboundSchema` instead. */
|
|
62
|
+
const outboundSchema: z.ZodType<PromptUpdate$Outbound, z.ZodTypeDef, PromptUpdate>;
|
|
63
|
+
/** @deprecated use `PromptUpdate$Outbound` instead. */
|
|
64
|
+
type Outbound = PromptUpdate$Outbound;
|
|
65
|
+
}
|
|
66
|
+
export declare function promptUpdateToJSON(promptUpdate: PromptUpdate): string;
|
|
67
|
+
export declare function promptUpdateFromJSON(jsonString: string): SafeParseResult<PromptUpdate, SDKValidationError>;
|
|
68
|
+
//# sourceMappingURL=promptupdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptupdate.d.ts","sourceRoot":"","sources":["../../src/models/components/promptupdate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MA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EAAE,CAAC,CAAC,OAAO,CACjD,qBAAqB,EACrB,CAAC,CAAC,UAAU,EACZ,YAAY,CAeZ,CAAC;AAEH;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAC7B,4DAA4D;IACrD,MAAM,aAAa,gDAA6B,CAAC;IACxD,6DAA6D;IACtD,MAAM,cAAc,8DAA8B,CAAC;IAC1D,uDAAuD;IACvD,KAAY,QAAQ,GAAG,qBAAqB,CAAC;CAC9C;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAErE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAMnD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.PromptUpdate$ = exports.PromptUpdate$outboundSchema = exports.PromptUpdate$inboundSchema = void 0;
|
|
30
|
+
exports.promptUpdateToJSON = promptUpdateToJSON;
|
|
31
|
+
exports.promptUpdateFromJSON = promptUpdateFromJSON;
|
|
32
|
+
const z = __importStar(require("zod"));
|
|
33
|
+
const primitives_js_1 = require("../../lib/primitives.js");
|
|
34
|
+
const schemas_js_1 = require("../../lib/schemas.js");
|
|
35
|
+
const llmconfig_js_1 = require("./llmconfig.js");
|
|
36
|
+
/** @internal */
|
|
37
|
+
exports.PromptUpdate$inboundSchema = z.object({
|
|
38
|
+
name: z.string(),
|
|
39
|
+
description: z.nullable(z.string()).optional(),
|
|
40
|
+
type: z.string(),
|
|
41
|
+
context: z.nullable(z.string()).optional(),
|
|
42
|
+
tools: z.array(z.string()).optional(),
|
|
43
|
+
llm_config: llmconfig_js_1.LlmConfig$inboundSchema,
|
|
44
|
+
id: z.number().int(),
|
|
45
|
+
edit_comments: z.nullable(z.string()).optional(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return (0, primitives_js_1.remap)(v, {
|
|
48
|
+
"llm_config": "llmConfig",
|
|
49
|
+
"edit_comments": "editComments",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
/** @internal */
|
|
53
|
+
exports.PromptUpdate$outboundSchema = z.object({
|
|
54
|
+
name: z.string(),
|
|
55
|
+
description: z.nullable(z.string()).optional(),
|
|
56
|
+
type: z.string(),
|
|
57
|
+
context: z.nullable(z.string()).optional(),
|
|
58
|
+
tools: z.array(z.string()).optional(),
|
|
59
|
+
llmConfig: llmconfig_js_1.LlmConfig$outboundSchema,
|
|
60
|
+
id: z.number().int(),
|
|
61
|
+
editComments: z.nullable(z.string()).optional(),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return (0, primitives_js_1.remap)(v, {
|
|
64
|
+
llmConfig: "llm_config",
|
|
65
|
+
editComments: "edit_comments",
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
71
|
+
*/
|
|
72
|
+
var PromptUpdate$;
|
|
73
|
+
(function (PromptUpdate$) {
|
|
74
|
+
/** @deprecated use `PromptUpdate$inboundSchema` instead. */
|
|
75
|
+
PromptUpdate$.inboundSchema = exports.PromptUpdate$inboundSchema;
|
|
76
|
+
/** @deprecated use `PromptUpdate$outboundSchema` instead. */
|
|
77
|
+
PromptUpdate$.outboundSchema = exports.PromptUpdate$outboundSchema;
|
|
78
|
+
})(PromptUpdate$ || (exports.PromptUpdate$ = PromptUpdate$ = {}));
|
|
79
|
+
function promptUpdateToJSON(promptUpdate) {
|
|
80
|
+
return JSON.stringify(exports.PromptUpdate$outboundSchema.parse(promptUpdate));
|
|
81
|
+
}
|
|
82
|
+
function promptUpdateFromJSON(jsonString) {
|
|
83
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PromptUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptUpdate' from JSON`);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=promptupdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptupdate.js","sourceRoot":"","sources":["../../src/models/components/promptupdate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHH,gDAEC;AAED,oDAQC;AA9HD,uCAAyB;AACzB,2DAA0D;AAC1D,qDAAiD;AAGjD,iDAKwB;AAqCxB,gBAAgB;AACH,QAAA,0BAA0B,GAInC,CAAC,CAAC,MAAM,CAAC;IACX,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AE;IACpB,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,YAAY;QACvB,YAAY,EAAE,eAAe;KAC9B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,aAAa,CAO7B;AAPD,WAAiB,aAAa;IAC5B,4DAA4D;IAC/C,2BAAa,GAAG,kCAA0B,CAAC;IACxD,6DAA6D;IAChD,4BAAc,GAAG,mCAA2B,CAAC;AAG5D,CAAC,EAPgB,aAAa,6BAAb,aAAa,QAO7B;AAED,SAAgB,kBAAkB,CAAC,YAA0B;IAC3D,OAAO,IAAI,CAAC,SAAS,CAAC,mCAA2B,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,oBAAoB,CAClC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,kCAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtD,0CAA0C,CAC3C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syllable-sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"author": "Speakeasy",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"prepublishOnly": "npm run build"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
+
"react": "^18 || ^19",
|
|
18
|
+
"react-dom": "^18 || ^19",
|
|
17
19
|
"zod": ">= 3"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
package/sdk/prompts.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class Prompts extends ClientSDK {
|
|
|
22
22
|
* @remarks
|
|
23
23
|
* Update an existing prompt
|
|
24
24
|
*/
|
|
25
|
-
update(request: components.
|
|
25
|
+
update(request: components.PromptUpdate, options?: RequestOptions): Promise<components.Prompt>;
|
|
26
26
|
/**
|
|
27
27
|
* Get Prompt By Id
|
|
28
28
|
*
|
package/sdk/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/sdk/prompts.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,OAAQ,SAAQ,SAAS;IACpC;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,YAAY,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;IAQ7B;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/sdk/prompts.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,OAAQ,SAAQ,SAAS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IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAAwC,EACxC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gCAAa,EAC9B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAtGD,0BAsGC"}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
*/
|
|
31
31
|
export async function promptsUpdate(
|
|
32
32
|
client: SyllableSDKCore,
|
|
33
|
-
request: components.
|
|
33
|
+
request: components.PromptUpdate,
|
|
34
34
|
options?: RequestOptions,
|
|
35
35
|
): Promise<
|
|
36
36
|
Result<
|
|
@@ -47,7 +47,7 @@ export async function promptsUpdate(
|
|
|
47
47
|
> {
|
|
48
48
|
const parsed = safeParse(
|
|
49
49
|
request,
|
|
50
|
-
(value) => components.
|
|
50
|
+
(value) => components.PromptUpdate$outboundSchema.parse(value),
|
|
51
51
|
"Input validation failed",
|
|
52
52
|
);
|
|
53
53
|
if (!parsed.ok) {
|
package/src/lib/config.ts
CHANGED
|
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.2",
|
|
64
|
-
sdkVersion: "0.1.0-alpha.
|
|
65
|
-
genVersion: "2.
|
|
64
|
+
sdkVersion: "0.1.0-alpha.9",
|
|
65
|
+
genVersion: "2.463.1",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.1.0-alpha.
|
|
67
|
+
"speakeasy-sdk/typescript 0.1.0-alpha.9 2.463.1 0.0.2 syllable-sdk",
|
|
68
68
|
} as const;
|
package/src/lib/primitives.ts
CHANGED
|
@@ -58,3 +58,65 @@ export function remap<
|
|
|
58
58
|
|
|
59
59
|
return out;
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
export function combineSignals(
|
|
63
|
+
...signals: Array<AbortSignal | null | undefined>
|
|
64
|
+
): AbortSignal | null {
|
|
65
|
+
const filtered: AbortSignal[] = [];
|
|
66
|
+
for (const signal of signals) {
|
|
67
|
+
if (signal) {
|
|
68
|
+
filtered.push(signal);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
switch (filtered.length) {
|
|
73
|
+
case 0:
|
|
74
|
+
case 1:
|
|
75
|
+
return filtered[0] || null;
|
|
76
|
+
default:
|
|
77
|
+
if ("any" in AbortSignal && typeof AbortSignal.any === "function") {
|
|
78
|
+
return AbortSignal.any(filtered);
|
|
79
|
+
}
|
|
80
|
+
return abortSignalAny(filtered);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function abortSignalAny(signals: AbortSignal[]): AbortSignal {
|
|
85
|
+
const controller = new AbortController();
|
|
86
|
+
const result = controller.signal;
|
|
87
|
+
if (!signals.length) {
|
|
88
|
+
return controller.signal;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (signals.length === 1) {
|
|
92
|
+
return signals[0] || controller.signal;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (const signal of signals) {
|
|
96
|
+
if (signal.aborted) {
|
|
97
|
+
return signal;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function abort(this: AbortSignal) {
|
|
102
|
+
controller.abort(this.reason);
|
|
103
|
+
clean();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const signalRefs: WeakRef<AbortSignal>[] = [];
|
|
107
|
+
function clean() {
|
|
108
|
+
for (const signalRef of signalRefs) {
|
|
109
|
+
const signal = signalRef.deref();
|
|
110
|
+
if (signal) {
|
|
111
|
+
signal.removeEventListener("abort", abort);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for (const signal of signals) {
|
|
117
|
+
signalRefs.push(new WeakRef(signal));
|
|
118
|
+
signal.addEventListener("abort", abort);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
@@ -40,6 +40,7 @@ export * from "./prompt.js";
|
|
|
40
40
|
export * from "./promptcreate.js";
|
|
41
41
|
export * from "./prompthistory.js";
|
|
42
42
|
export * from "./promptproperties.js";
|
|
43
|
+
export * from "./promptupdate.js";
|
|
43
44
|
export * from "./security.js";
|
|
44
45
|
export * from "./service.js";
|
|
45
46
|
export * from "./servicecreate.js";
|
|
@@ -19,6 +19,10 @@ export type Prompt = {
|
|
|
19
19
|
* The Prompt name
|
|
20
20
|
*/
|
|
21
21
|
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The description of the prompt
|
|
24
|
+
*/
|
|
25
|
+
description?: string | null | undefined;
|
|
22
26
|
/**
|
|
23
27
|
* The type of the prompt
|
|
24
28
|
*/
|
|
@@ -39,6 +43,10 @@ export type Prompt = {
|
|
|
39
43
|
* The Prompt ID
|
|
40
44
|
*/
|
|
41
45
|
id: number;
|
|
46
|
+
/**
|
|
47
|
+
* The comments for the last edit
|
|
48
|
+
*/
|
|
49
|
+
editComments?: string | null | undefined;
|
|
42
50
|
/**
|
|
43
51
|
* The last updated date of the prompt
|
|
44
52
|
*/
|
|
@@ -48,43 +56,48 @@ export type Prompt = {
|
|
|
48
56
|
*/
|
|
49
57
|
lastUpdatedBy?: string | null | undefined;
|
|
50
58
|
/**
|
|
51
|
-
* The
|
|
59
|
+
* The number of agents using the prompt
|
|
52
60
|
*/
|
|
53
|
-
|
|
61
|
+
agentCount?: number | null | undefined;
|
|
54
62
|
};
|
|
55
63
|
|
|
56
64
|
/** @internal */
|
|
57
65
|
export const Prompt$inboundSchema: z.ZodType<Prompt, z.ZodTypeDef, unknown> = z
|
|
58
66
|
.object({
|
|
59
67
|
name: z.string(),
|
|
68
|
+
description: z.nullable(z.string()).optional(),
|
|
60
69
|
type: z.string(),
|
|
61
70
|
context: z.nullable(z.string()).optional(),
|
|
62
71
|
tools: z.array(z.string()).optional(),
|
|
63
72
|
llm_config: LlmConfig$inboundSchema,
|
|
64
73
|
id: z.number().int(),
|
|
74
|
+
edit_comments: z.nullable(z.string()).optional(),
|
|
65
75
|
last_updated: z.nullable(z.string()),
|
|
66
76
|
last_updated_by: z.nullable(z.string()).optional(),
|
|
67
|
-
|
|
77
|
+
agent_count: z.nullable(z.number().int()).optional(),
|
|
68
78
|
}).transform((v) => {
|
|
69
79
|
return remap$(v, {
|
|
70
80
|
"llm_config": "llmConfig",
|
|
81
|
+
"edit_comments": "editComments",
|
|
71
82
|
"last_updated": "lastUpdated",
|
|
72
83
|
"last_updated_by": "lastUpdatedBy",
|
|
73
|
-
"
|
|
84
|
+
"agent_count": "agentCount",
|
|
74
85
|
});
|
|
75
86
|
});
|
|
76
87
|
|
|
77
88
|
/** @internal */
|
|
78
89
|
export type Prompt$Outbound = {
|
|
79
90
|
name: string;
|
|
91
|
+
description?: string | null | undefined;
|
|
80
92
|
type: string;
|
|
81
93
|
context?: string | null | undefined;
|
|
82
94
|
tools?: Array<string> | undefined;
|
|
83
95
|
llm_config: LlmConfig$Outbound;
|
|
84
96
|
id: number;
|
|
97
|
+
edit_comments?: string | null | undefined;
|
|
85
98
|
last_updated: string | null;
|
|
86
99
|
last_updated_by?: string | null | undefined;
|
|
87
|
-
|
|
100
|
+
agent_count?: number | null | undefined;
|
|
88
101
|
};
|
|
89
102
|
|
|
90
103
|
/** @internal */
|
|
@@ -94,20 +107,23 @@ export const Prompt$outboundSchema: z.ZodType<
|
|
|
94
107
|
Prompt
|
|
95
108
|
> = z.object({
|
|
96
109
|
name: z.string(),
|
|
110
|
+
description: z.nullable(z.string()).optional(),
|
|
97
111
|
type: z.string(),
|
|
98
112
|
context: z.nullable(z.string()).optional(),
|
|
99
113
|
tools: z.array(z.string()).optional(),
|
|
100
114
|
llmConfig: LlmConfig$outboundSchema,
|
|
101
115
|
id: z.number().int(),
|
|
116
|
+
editComments: z.nullable(z.string()).optional(),
|
|
102
117
|
lastUpdated: z.nullable(z.string()),
|
|
103
118
|
lastUpdatedBy: z.nullable(z.string()).optional(),
|
|
104
|
-
|
|
119
|
+
agentCount: z.nullable(z.number().int()).optional(),
|
|
105
120
|
}).transform((v) => {
|
|
106
121
|
return remap$(v, {
|
|
107
122
|
llmConfig: "llm_config",
|
|
123
|
+
editComments: "edit_comments",
|
|
108
124
|
lastUpdated: "last_updated",
|
|
109
125
|
lastUpdatedBy: "last_updated_by",
|
|
110
|
-
|
|
126
|
+
agentCount: "agent_count",
|
|
111
127
|
});
|
|
112
128
|
});
|
|
113
129
|
|
|
@@ -19,6 +19,10 @@ export type PromptCreate = {
|
|
|
19
19
|
* The Prompt name
|
|
20
20
|
*/
|
|
21
21
|
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The description of the prompt
|
|
24
|
+
*/
|
|
25
|
+
description?: string | null | undefined;
|
|
22
26
|
/**
|
|
23
27
|
* The type of the prompt
|
|
24
28
|
*/
|
|
@@ -44,6 +48,7 @@ export const PromptCreate$inboundSchema: z.ZodType<
|
|
|
44
48
|
unknown
|
|
45
49
|
> = z.object({
|
|
46
50
|
name: z.string(),
|
|
51
|
+
description: z.nullable(z.string()).optional(),
|
|
47
52
|
type: z.string(),
|
|
48
53
|
context: z.nullable(z.string()).optional(),
|
|
49
54
|
tools: z.array(z.string()).optional(),
|
|
@@ -57,6 +62,7 @@ export const PromptCreate$inboundSchema: z.ZodType<
|
|
|
57
62
|
/** @internal */
|
|
58
63
|
export type PromptCreate$Outbound = {
|
|
59
64
|
name: string;
|
|
65
|
+
description?: string | null | undefined;
|
|
60
66
|
type: string;
|
|
61
67
|
context?: string | null | undefined;
|
|
62
68
|
tools?: Array<string> | undefined;
|
|
@@ -70,6 +76,7 @@ export const PromptCreate$outboundSchema: z.ZodType<
|
|
|
70
76
|
PromptCreate
|
|
71
77
|
> = z.object({
|
|
72
78
|
name: z.string(),
|
|
79
|
+
description: z.nullable(z.string()).optional(),
|
|
73
80
|
type: z.string(),
|
|
74
81
|
context: z.nullable(z.string()).optional(),
|
|
75
82
|
tools: z.array(z.string()).optional(),
|
|
@@ -12,6 +12,7 @@ export type PromptHistory = {
|
|
|
12
12
|
timestamp: Date;
|
|
13
13
|
promptId?: string | null | undefined;
|
|
14
14
|
promptText?: string | null | undefined;
|
|
15
|
+
promptDescription?: string | null | undefined;
|
|
15
16
|
promptName?: string | null | undefined;
|
|
16
17
|
llmConfig?: string | null | undefined;
|
|
17
18
|
comments?: string | null | undefined;
|
|
@@ -27,6 +28,7 @@ export const PromptHistory$inboundSchema: z.ZodType<
|
|
|
27
28
|
timestamp: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
28
29
|
prompt_id: z.nullable(z.string()).optional(),
|
|
29
30
|
prompt_text: z.nullable(z.string()).optional(),
|
|
31
|
+
prompt_description: z.nullable(z.string()).optional(),
|
|
30
32
|
prompt_name: z.nullable(z.string()).optional(),
|
|
31
33
|
llm_config: z.nullable(z.string()).optional(),
|
|
32
34
|
comments: z.nullable(z.string()).optional(),
|
|
@@ -35,6 +37,7 @@ export const PromptHistory$inboundSchema: z.ZodType<
|
|
|
35
37
|
return remap$(v, {
|
|
36
38
|
"prompt_id": "promptId",
|
|
37
39
|
"prompt_text": "promptText",
|
|
40
|
+
"prompt_description": "promptDescription",
|
|
38
41
|
"prompt_name": "promptName",
|
|
39
42
|
"llm_config": "llmConfig",
|
|
40
43
|
"user_email": "userEmail",
|
|
@@ -46,6 +49,7 @@ export type PromptHistory$Outbound = {
|
|
|
46
49
|
timestamp: string;
|
|
47
50
|
prompt_id?: string | null | undefined;
|
|
48
51
|
prompt_text?: string | null | undefined;
|
|
52
|
+
prompt_description?: string | null | undefined;
|
|
49
53
|
prompt_name?: string | null | undefined;
|
|
50
54
|
llm_config?: string | null | undefined;
|
|
51
55
|
comments?: string | null | undefined;
|
|
@@ -61,6 +65,7 @@ export const PromptHistory$outboundSchema: z.ZodType<
|
|
|
61
65
|
timestamp: z.date().transform(v => v.toISOString()),
|
|
62
66
|
promptId: z.nullable(z.string()).optional(),
|
|
63
67
|
promptText: z.nullable(z.string()).optional(),
|
|
68
|
+
promptDescription: z.nullable(z.string()).optional(),
|
|
64
69
|
promptName: z.nullable(z.string()).optional(),
|
|
65
70
|
llmConfig: z.nullable(z.string()).optional(),
|
|
66
71
|
comments: z.nullable(z.string()).optional(),
|
|
@@ -69,6 +74,7 @@ export const PromptHistory$outboundSchema: z.ZodType<
|
|
|
69
74
|
return remap$(v, {
|
|
70
75
|
promptId: "prompt_id",
|
|
71
76
|
promptText: "prompt_text",
|
|
77
|
+
promptDescription: "prompt_description",
|
|
72
78
|
promptName: "prompt_name",
|
|
73
79
|
llmConfig: "llm_config",
|
|
74
80
|
userEmail: "user_email",
|
|
@@ -8,10 +8,14 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
8
8
|
export const PromptProperties = {
|
|
9
9
|
Id: "id",
|
|
10
10
|
Name: "name",
|
|
11
|
+
Description: "description",
|
|
12
|
+
NameDescription: "name_description",
|
|
11
13
|
Context: "context",
|
|
12
14
|
Tools: "tools",
|
|
13
15
|
LlmConfig: "llm_config",
|
|
16
|
+
LastUpdated: "last_updated",
|
|
14
17
|
LastUpdatedBy: "last_updated_by",
|
|
18
|
+
AgentCount: "agent_count",
|
|
15
19
|
} as const;
|
|
16
20
|
export type PromptProperties = ClosedEnum<typeof PromptProperties>;
|
|
17
21
|
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
LlmConfig,
|
|
12
|
+
LlmConfig$inboundSchema,
|
|
13
|
+
LlmConfig$Outbound,
|
|
14
|
+
LlmConfig$outboundSchema,
|
|
15
|
+
} from "./llmconfig.js";
|
|
16
|
+
|
|
17
|
+
export type PromptUpdate = {
|
|
18
|
+
/**
|
|
19
|
+
* The Prompt name
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The description of the prompt
|
|
24
|
+
*/
|
|
25
|
+
description?: string | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The type of the prompt
|
|
28
|
+
*/
|
|
29
|
+
type: string;
|
|
30
|
+
/**
|
|
31
|
+
* The prompt text
|
|
32
|
+
*/
|
|
33
|
+
context?: string | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The tools for the prompt
|
|
36
|
+
*/
|
|
37
|
+
tools?: Array<string> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The configuration for the language model used by the Cortex API.
|
|
40
|
+
*/
|
|
41
|
+
llmConfig: LlmConfig;
|
|
42
|
+
/**
|
|
43
|
+
* The Prompt ID
|
|
44
|
+
*/
|
|
45
|
+
id: number;
|
|
46
|
+
/**
|
|
47
|
+
* The comments for the last edit
|
|
48
|
+
*/
|
|
49
|
+
editComments?: string | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const PromptUpdate$inboundSchema: z.ZodType<
|
|
54
|
+
PromptUpdate,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
unknown
|
|
57
|
+
> = z.object({
|
|
58
|
+
name: z.string(),
|
|
59
|
+
description: z.nullable(z.string()).optional(),
|
|
60
|
+
type: z.string(),
|
|
61
|
+
context: z.nullable(z.string()).optional(),
|
|
62
|
+
tools: z.array(z.string()).optional(),
|
|
63
|
+
llm_config: LlmConfig$inboundSchema,
|
|
64
|
+
id: z.number().int(),
|
|
65
|
+
edit_comments: z.nullable(z.string()).optional(),
|
|
66
|
+
}).transform((v) => {
|
|
67
|
+
return remap$(v, {
|
|
68
|
+
"llm_config": "llmConfig",
|
|
69
|
+
"edit_comments": "editComments",
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export type PromptUpdate$Outbound = {
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string | null | undefined;
|
|
77
|
+
type: string;
|
|
78
|
+
context?: string | null | undefined;
|
|
79
|
+
tools?: Array<string> | undefined;
|
|
80
|
+
llm_config: LlmConfig$Outbound;
|
|
81
|
+
id: number;
|
|
82
|
+
edit_comments?: string | null | undefined;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const PromptUpdate$outboundSchema: z.ZodType<
|
|
87
|
+
PromptUpdate$Outbound,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
PromptUpdate
|
|
90
|
+
> = z.object({
|
|
91
|
+
name: z.string(),
|
|
92
|
+
description: z.nullable(z.string()).optional(),
|
|
93
|
+
type: z.string(),
|
|
94
|
+
context: z.nullable(z.string()).optional(),
|
|
95
|
+
tools: z.array(z.string()).optional(),
|
|
96
|
+
llmConfig: LlmConfig$outboundSchema,
|
|
97
|
+
id: z.number().int(),
|
|
98
|
+
editComments: z.nullable(z.string()).optional(),
|
|
99
|
+
}).transform((v) => {
|
|
100
|
+
return remap$(v, {
|
|
101
|
+
llmConfig: "llm_config",
|
|
102
|
+
editComments: "edit_comments",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
109
|
+
*/
|
|
110
|
+
export namespace PromptUpdate$ {
|
|
111
|
+
/** @deprecated use `PromptUpdate$inboundSchema` instead. */
|
|
112
|
+
export const inboundSchema = PromptUpdate$inboundSchema;
|
|
113
|
+
/** @deprecated use `PromptUpdate$outboundSchema` instead. */
|
|
114
|
+
export const outboundSchema = PromptUpdate$outboundSchema;
|
|
115
|
+
/** @deprecated use `PromptUpdate$Outbound` instead. */
|
|
116
|
+
export type Outbound = PromptUpdate$Outbound;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function promptUpdateToJSON(promptUpdate: PromptUpdate): string {
|
|
120
|
+
return JSON.stringify(PromptUpdate$outboundSchema.parse(promptUpdate));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function promptUpdateFromJSON(
|
|
124
|
+
jsonString: string,
|
|
125
|
+
): SafeParseResult<PromptUpdate, SDKValidationError> {
|
|
126
|
+
return safeParse(
|
|
127
|
+
jsonString,
|
|
128
|
+
(x) => PromptUpdate$inboundSchema.parse(JSON.parse(x)),
|
|
129
|
+
`Failed to parse 'PromptUpdate' from JSON`,
|
|
130
|
+
);
|
|
131
|
+
}
|
package/src/sdk/prompts.ts
CHANGED
|
@@ -55,7 +55,7 @@ export class Prompts extends ClientSDK {
|
|
|
55
55
|
* Update an existing prompt
|
|
56
56
|
*/
|
|
57
57
|
async update(
|
|
58
|
-
request: components.
|
|
58
|
+
request: components.PromptUpdate,
|
|
59
59
|
options?: RequestOptions,
|
|
60
60
|
): Promise<components.Prompt> {
|
|
61
61
|
return unwrapAsync(promptsUpdate(
|