Skip to content

Commit 63749d4

Browse files
πŸ‘Œ IMPROVE: User facing logs (#86)
1 parent b839734 commit 63749d4

File tree

4 files changed

+19
-55
lines changed

4 files changed

+19
-55
lines changed

β€Žpackages/core/src/common/request.tsβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export class Request {
9999
options,
100100
headers,
101101
}: MakeRequestParams): Promise<Response> {
102-
// console.log(' =================== REQUEST ===================');
103102
const resp = await fetch(url, {
104103
method: options.method,
105104
headers,
@@ -158,8 +157,8 @@ export class Request {
158157
}
159158

160159
async post<T>(options: Omit<RequestOptions, 'method'>): Promise<T> {
161-
console.log('Request.post.options');
162-
console.dir(options, {depth: null, colors: true});
160+
// logger('Request.post.options');
161+
// logger(options, {depth: null, colors: true});
163162

164163
return this.send<T>({...options, method: 'POST'});
165164
}

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ export class Pipe {
155155
public async run(
156156
options: RunOptions | RunOptionsStream,
157157
): Promise<RunResponse | RunResponseStream> {
158-
console.log('pipe.run', this.pipe.name, 'RUN');
158+
// logger('pipe.run', this.pipe.name, 'RUN');
159159

160160
const endpoint = '/beta/pipes/run';
161-
console.log('pipe.run.baseUrl.endpoint', getApiUrl() + endpoint);
162-
console.log('pipe.run.options');
163-
console.dir(options, {depth: null, colors: true});
161+
// logger('pipe.run.baseUrl.endpoint', getApiUrl() + endpoint);
162+
// logger('pipe.run.options');
163+
// logger(options, {depth: null, colors: true});
164164

165165
const requestedStream = this.isStreamRequested(options);
166166
const stream = this.hasTools ? false : requestedStream;
@@ -175,8 +175,8 @@ export class Pipe {
175175
return {} as RunResponse | RunResponseStream;
176176
}
177177

178-
console.log('pipe.run.response');
179-
console.dir(response, {depth: null, colors: true});
178+
// logger('pipe.run.response');
179+
// logger(response, {depth: null, colors: true});
180180

181181
if (stream) {
182182
return response as RunResponseStream;
@@ -190,21 +190,21 @@ export class Pipe {
190190
const responseMessage = currentResponse.choices[0].message;
191191

192192
if (this.hasNoToolCalls(responseMessage)) {
193-
console.log('No more tool calls. Returning final response.');
193+
// logger('No more tool calls. Returning final response.');
194194
return currentResponse;
195195
}
196196

197-
console.log('\npipe.run.response.toolCalls');
198-
console.dir(responseMessage.tool_calls, {
199-
depth: null,
200-
colors: true,
201-
});
197+
// logger('\npipe.run.response.toolCalls');
198+
// logger(responseMessage.tool_calls, {
199+
// depth: null,
200+
// colors: true,
201+
// });
202202

203203
const toolResults = await this.runTools(
204204
responseMessage.tool_calls as ToolCall[],
205205
);
206-
console.log('\npipe.run.toolResults');
207-
console.dir(toolResults, {depth: null, colors: true});
206+
// logger('\npipe.run.toolResults');
207+
// logger(toolResults, {depth: null, colors: true});
208208

209209
messages = this.getMessagesToSend(
210210
messages,
@@ -226,9 +226,9 @@ export class Pipe {
226226

227227
// Explicitly check if the new response has no tool calls
228228
if (this.hasNoToolCalls(currentResponse.choices[0].message)) {
229-
console.log(
230-
'New response has no tool calls. Returning final response.',
231-
);
229+
// logger(
230+
// 'New response has no tool calls. Returning final response.',
231+
// );
232232
return currentResponse;
233233
}
234234
}

β€Žpackages/testing/index.tsβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žpackages/testing/package.jsonβ€Ž

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
Β (0)