Skip to content

Commit bf851b7

Browse files
authored
πŸ“¦ NEW: runTools run options param in pipe.run() (#99)
* πŸ“¦ NEW: `runTool` run options param * πŸ‘Œ IMPROVE: Code * πŸ‘Œ IMPROVE: Delete runTools param from options
1 parent 9bad9af commit bf851b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

β€Žpackages/core/src/pipes/pipes.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface RunOptions {
1616
variables?: Variable[];
1717
threadId?: string;
1818
rawResponse?: boolean;
19+
runTools?: boolean;
1920
}
2021

2122
export interface RunOptionsStream extends RunOptions {
@@ -166,6 +167,9 @@ export class Pipe {
166167
const stream = this.hasTools ? false : requestedStream;
167168
this.warnIfToolsWithStream(requestedStream);
168169

170+
const runTools = options.runTools ?? true;
171+
delete options.runTools;
172+
169173
const body = {...options, stream};
170174

171175
let response = await this.createRequest<
@@ -175,10 +179,7 @@ export class Pipe {
175179
return {} as RunResponse | RunResponseStream;
176180
}
177181

178-
// logger('pipe.run.response');
179-
// logger(response, {depth: null, colors: true});
180-
181-
if (stream) {
182+
if (stream || !runTools) {
182183
return response as RunResponseStream;
183184
}
184185

0 commit comments

Comments
Β (0)