@runappsai/sdk 0.7.3 → 0.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runappsai/sdk",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "JavaScript / TypeScript client for the RunApps AI Gateway",
5
5
  "license": "MIT",
6
6
  "author": "RunApps",
package/src/chat.ts CHANGED
@@ -40,9 +40,34 @@ export interface ChatTool {
40
40
  name: string;
41
41
  description?: string;
42
42
  parameters?: Record<string, unknown>;
43
+ /**
44
+ * Guarantee arguments that validate against `parameters` (strict tool
45
+ * use). The schema should list `required` fields and close every
46
+ * object with `additionalProperties: false`.
47
+ */
48
+ strict?: boolean;
43
49
  };
44
50
  }
45
51
 
52
+ /**
53
+ * Constrains the reply. `json_schema` makes the reply a JSON document
54
+ * matching `schema` (structured outputs: on Claude it becomes
55
+ * `output_config.format`, and objects that leave `additionalProperties`
56
+ * unset are closed for you); `json_object` asks for any JSON object.
57
+ */
58
+ export type ChatResponseFormat =
59
+ | { type: "text" }
60
+ | { type: "json_object" }
61
+ | {
62
+ type: "json_schema";
63
+ json_schema: {
64
+ name: string;
65
+ description?: string;
66
+ schema: Record<string, unknown>;
67
+ strict?: boolean;
68
+ };
69
+ };
70
+
46
71
  export interface StreamOptions {
47
72
  include_usage: boolean;
48
73
  }
@@ -108,6 +133,8 @@ export interface ChatCompletionParams {
108
133
  n?: number;
109
134
  tools?: ChatTool[];
110
135
  tool_choice?: unknown;
136
+ /** Structured outputs — see {@link ChatResponseFormat}. */
137
+ response_format?: ChatResponseFormat;
111
138
  user?: string;
112
139
  metadata?: Record<string, unknown>;
113
140
  stream?: boolean;
package/src/index.ts CHANGED
@@ -55,6 +55,7 @@ export type {
55
55
  ChatMessage,
56
56
  ContentPart,
57
57
  ChatTool,
58
+ ChatResponseFormat,
58
59
  StreamOptions,
59
60
  ChatCompletionParams,
60
61
  ChatToolCall,