@@ -112,7 +112,7 @@ interface ToolChoice {
112112 function : { name : string } ;
113113}
114114
115- interface BaseOptions {
115+ interface PipeBaseOptions {
116116 name : string ;
117117 description ?: string ;
118118 status ?: 'public' | 'private' ;
@@ -145,7 +145,43 @@ interface BaseOptions {
145145 } [ ] ;
146146}
147147
148- interface BaseResponse {
148+ export interface PipeListResponse {
149+ name : string ;
150+ description : string ;
151+ status : 'public' | 'private' ;
152+ owner_login : string ;
153+ url : string ;
154+ model : string ;
155+ stream : boolean ;
156+ json : boolean ;
157+ store : boolean ;
158+ moderate : boolean ;
159+ top_p : number ;
160+ max_tokens : number ;
161+ temperature : number ;
162+ presence_penalty : number ;
163+ frequency_penalty : number ;
164+ stop : string [ ] ;
165+ tool_choice : 'auto' | 'required' | ToolChoice ;
166+ parallel_tool_calls : boolean ;
167+ messages : Message [ ] ;
168+ variables : Variable [ ] | [ ] ;
169+ tools :
170+ | {
171+ type : 'function' ;
172+ function : {
173+ name : string ;
174+ description ?: string ;
175+ parameters ?: Record < string , any > ;
176+ } ;
177+ } [ ]
178+ | [ ] ;
179+ memory : {
180+ name : string ;
181+ } [ ] | [ ] ;
182+ }
183+
184+ interface PipeBaseResponse {
149185 name : string ;
150186 description : string ;
151187 status : 'public' | 'private' ;
@@ -155,10 +191,10 @@ interface BaseResponse {
155191 api_key : string ;
156192}
157193
158- export interface CreateOptions extends BaseOptions { }
159- export interface UpdateOptions extends BaseOptions { }
160- export interface CreateResponse extends BaseResponse { }
161- export interface UpdateResponse extends BaseResponse { }
194+ export interface PipeCreateOptions extends PipeBaseOptions { }
195+ export interface PipeUpdateOptions extends PipeBaseOptions { }
196+ export interface PipeCreateResponse extends PipeBaseResponse { }
197+ export interface PipeUpdateResponse extends PipeBaseResponse { }
162198
163199export class Pipe {
164200 private request : Request ;
@@ -207,21 +243,21 @@ export class Pipe {
207243 } ) ;
208244 }
209245
210- async create ( options : CreateOptions ) : Promise < CreateResponse > {
246+ async create ( options : PipeCreateOptions ) : Promise < PipeCreateResponse > {
211247 return this . request . post ( {
212248 endpoint : '/v1/pipes' ,
213249 body : options ,
214250 } ) ;
215251 }
216252
217- async update ( options : UpdateOptions ) : Promise < UpdateResponse > {
253+ async update ( options : PipeUpdateOptions ) : Promise < PipeUpdateResponse > {
218254 return this . request . post ( {
219255 endpoint : `/v1/pipes/${ options . name } ` ,
220256 body : options ,
221257 } ) ;
222258 }
223259
224- async list ( ) {
260+ async list ( ) : Promise < PipeListResponse [ ] > {
225261 return this . request . get ( {
226262 endpoint : '/v1/pipes' ,
227263 } ) ;
0 commit comments