@perplexity-ai/perplexity_ai 0.22.0 → 0.23.0

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.
@@ -79,10 +79,139 @@ export interface ErrorInfo {
79
79
  type?: string;
80
80
  }
81
81
 
82
+ export interface FunctionCallOutputItem {
83
+ id: string;
84
+
85
+ /**
86
+ * JSON string of arguments
87
+ */
88
+ arguments: string;
89
+
90
+ /**
91
+ * Correlates with function_call_output input
92
+ */
93
+ call_id: string;
94
+
95
+ name: string;
96
+
97
+ /**
98
+ * Status of a response or output item
99
+ */
100
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
101
+
102
+ type: 'function_call';
103
+
104
+ /**
105
+ * Base64-encoded opaque signature for thinking models
106
+ */
107
+ thought_signature?: string;
108
+ }
109
+
110
+ export interface FunctionTool {
111
+ /**
112
+ * The name of the function
113
+ */
114
+ name: string;
115
+
116
+ type: 'function';
117
+
118
+ /**
119
+ * A description of what the function does
120
+ */
121
+ description?: string;
122
+
123
+ /**
124
+ * JSON Schema defining the function's parameters
125
+ */
126
+ parameters?: { [key: string]: unknown };
127
+
128
+ /**
129
+ * Whether to enable strict schema validation
130
+ */
131
+ strict?: boolean;
132
+ }
133
+
134
+ export type InputItem =
135
+ | InputItem.InputMessage
136
+ | InputItem.FunctionCallOutputInput
137
+ | InputItem.FunctionCallInput;
138
+
139
+ export namespace InputItem {
140
+ export interface InputMessage {
141
+ /**
142
+ * Message content - either a string or array of content parts
143
+ */
144
+ content: string | Array<InputMessage.ContentPartArray>;
145
+
146
+ role: 'user' | 'assistant' | 'system' | 'developer';
147
+
148
+ type: 'message';
149
+ }
150
+
151
+ export namespace InputMessage {
152
+ export interface ContentPartArray {
153
+ type: 'input_text' | 'input_image';
154
+
155
+ image_url?: string;
156
+
157
+ text?: string;
158
+ }
159
+ }
160
+
161
+ export interface FunctionCallOutputInput {
162
+ /**
163
+ * The call_id from function_call output
164
+ */
165
+ call_id: string;
166
+
167
+ /**
168
+ * Function result (JSON string)
169
+ */
170
+ output: string;
171
+
172
+ type: 'function_call_output';
173
+
174
+ /**
175
+ * Function name (required by some providers)
176
+ */
177
+ name?: string;
178
+
179
+ /**
180
+ * Base64-encoded signature from function_call
181
+ */
182
+ thought_signature?: string;
183
+ }
184
+
185
+ export interface FunctionCallInput {
186
+ /**
187
+ * Function arguments (JSON string)
188
+ */
189
+ arguments: string;
190
+
191
+ /**
192
+ * The call_id that correlates with function_call_output
193
+ */
194
+ call_id: string;
195
+
196
+ /**
197
+ * The function name
198
+ */
199
+ name: string;
200
+
201
+ type: 'function_call';
202
+
203
+ /**
204
+ * Base64-encoded signature for thinking models
205
+ */
206
+ thought_signature?: string;
207
+ }
208
+ }
209
+
82
210
  export type OutputItem =
83
211
  | OutputItem.MessageOutputItem
84
212
  | OutputItem.SearchResultsOutputItem
85
- | OutputItem.FetchURLResultsOutputItem;
213
+ | OutputItem.FetchURLResultsOutputItem
214
+ | FunctionCallOutputItem;
86
215
 
87
216
  export namespace OutputItem {
88
217
  export interface MessageOutputItem {
@@ -98,7 +227,7 @@ export namespace OutputItem {
98
227
  /**
99
228
  * Status of a response or output item
100
229
  */
101
- status: 'completed' | 'failed' | 'in_progress';
230
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
102
231
 
103
232
  type: 'message';
104
233
  }
@@ -231,7 +360,7 @@ export namespace ResponseStreamChunk {
231
360
  /**
232
361
  * Status of a response or output item
233
362
  */
234
- status: 'completed' | 'failed' | 'in_progress';
363
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
235
364
 
236
365
  error?: ResponsesAPI.ErrorInfo;
237
366
 
@@ -295,7 +424,7 @@ export namespace ResponseStreamChunk {
295
424
  /**
296
425
  * Status of a response or output item
297
426
  */
298
- status: 'completed' | 'failed' | 'in_progress';
427
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
299
428
 
300
429
  error?: ResponsesAPI.ErrorInfo;
301
430
 
@@ -358,7 +487,7 @@ export namespace ResponseStreamChunk {
358
487
  /**
359
488
  * Status of a response or output item
360
489
  */
361
- status: 'completed' | 'failed' | 'in_progress';
490
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
362
491
 
363
492
  error?: ResponsesAPI.ErrorInfo;
364
493
 
@@ -769,9 +898,9 @@ export namespace ResponseStreamChunk {
769
898
 
770
899
  export interface ResponsesCreateParams {
771
900
  /**
772
- * Input content - either a string or array of input messages
901
+ * Input content - either a string or array of input items
773
902
  */
774
- input: string | Array<ResponsesCreateParams.InputMessageArray>;
903
+ input: string | Array<InputItem>;
775
904
 
776
905
  /**
777
906
  * System instructions for the model
@@ -831,31 +960,10 @@ export interface ResponsesCreateParams {
831
960
  /**
832
961
  * Tools available to the model
833
962
  */
834
- tools?: Array<ResponsesCreateParams.WebSearchTool | ResponsesCreateParams.FetchURLTool>;
963
+ tools?: Array<ResponsesCreateParams.WebSearchTool | ResponsesCreateParams.FetchURLTool | FunctionTool>;
835
964
  }
836
965
 
837
966
  export namespace ResponsesCreateParams {
838
- export interface InputMessageArray {
839
- /**
840
- * Message content - either a string or array of content parts
841
- */
842
- content: string | Array<InputMessageArray.ContentPartArray>;
843
-
844
- role: 'user' | 'assistant' | 'system' | 'developer';
845
-
846
- type?: 'message';
847
- }
848
-
849
- export namespace InputMessageArray {
850
- export interface ContentPartArray {
851
- type: 'input_text' | 'input_image';
852
-
853
- image_url?: string;
854
-
855
- text?: string;
856
- }
857
- }
858
-
859
967
  export interface Reasoning {
860
968
  /**
861
969
  * How much effort the model should spend on reasoning
@@ -1002,7 +1110,7 @@ export interface ResponseCreateResponse {
1002
1110
  /**
1003
1111
  * Status of a response or output item
1004
1112
  */
1005
- status: 'completed' | 'failed' | 'in_progress';
1113
+ status: 'completed' | 'failed' | 'in_progress' | 'requires_action';
1006
1114
 
1007
1115
  error?: ErrorInfo;
1008
1116
 
@@ -1019,9 +1127,9 @@ export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCr
1019
1127
 
1020
1128
  export interface ResponseCreateParamsBase {
1021
1129
  /**
1022
- * Input content - either a string or array of input messages
1130
+ * Input content - either a string or array of input items
1023
1131
  */
1024
- input: string | Array<ResponseCreateParams.InputMessageArray>;
1132
+ input: string | Array<InputItem>;
1025
1133
 
1026
1134
  /**
1027
1135
  * System instructions for the model
@@ -1081,31 +1189,10 @@ export interface ResponseCreateParamsBase {
1081
1189
  /**
1082
1190
  * Tools available to the model
1083
1191
  */
1084
- tools?: Array<ResponseCreateParams.WebSearchTool | ResponseCreateParams.FetchURLTool>;
1192
+ tools?: Array<ResponseCreateParams.WebSearchTool | ResponseCreateParams.FetchURLTool | FunctionTool>;
1085
1193
  }
1086
1194
 
1087
1195
  export namespace ResponseCreateParams {
1088
- export interface InputMessageArray {
1089
- /**
1090
- * Message content - either a string or array of content parts
1091
- */
1092
- content: string | Array<InputMessageArray.ContentPartArray>;
1093
-
1094
- role: 'user' | 'assistant' | 'system' | 'developer';
1095
-
1096
- type?: 'message';
1097
- }
1098
-
1099
- export namespace InputMessageArray {
1100
- export interface ContentPartArray {
1101
- type: 'input_text' | 'input_image';
1102
-
1103
- image_url?: string;
1104
-
1105
- text?: string;
1106
- }
1107
- }
1108
-
1109
1196
  export interface Reasoning {
1110
1197
  /**
1111
1198
  * How much effort the model should spend on reasoning
@@ -1206,6 +1293,9 @@ export declare namespace Responses {
1206
1293
  type Annotation as Annotation,
1207
1294
  type ContentPart as ContentPart,
1208
1295
  type ErrorInfo as ErrorInfo,
1296
+ type FunctionCallOutputItem as FunctionCallOutputItem,
1297
+ type FunctionTool as FunctionTool,
1298
+ type InputItem as InputItem,
1209
1299
  type OutputItem as OutputItem,
1210
1300
  type ResponseStreamChunk as ResponseStreamChunk,
1211
1301
  type ResponsesCreateParams as ResponsesCreateParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.22.0'; // x-release-please-version
1
+ export const VERSION = '0.23.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.22.0";
1
+ export declare const VERSION = "0.23.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.22.0";
1
+ export declare const VERSION = "0.23.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.22.0'; // x-release-please-version
4
+ exports.VERSION = '0.23.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.22.0'; // x-release-please-version
1
+ export const VERSION = '0.23.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map