Skip to content

Commit

Permalink
chore(js): remove extraneous console.log statements (#1829)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbleigh authored Feb 4, 2025
1 parent fe48347 commit c3775f9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
7 changes: 2 additions & 5 deletions js/ai/src/generate/resolve-tool-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ export async function resolveResumeOption(
interruptedResponse?: GenerateResponseData;
}> {
if (!rawRequest.resume) return { revisedRequest: rawRequest }; // no-op if no resume option
console.log('RESOLVE RESUME OPTION:', rawRequest.resume);
const toolMap = toToolMap(await resolveTools(registry, rawRequest.tools));

const messages = rawRequest.messages;
Expand All @@ -346,11 +345,11 @@ export async function resolveResumeOption(
if (
!lastMessage ||
lastMessage.role !== 'model' ||
!lastMessage.content.find((p) => p.toolRequest && p.metadata?.interrupt)
!lastMessage.content.find((p) => p.toolRequest)
) {
throw new GenkitError({
status: 'FAILED_PRECONDITION',
message: `Cannot 'resume' generation unless the previous message is a model message with at least one interrupt.`,
message: `Cannot 'resume' generation unless the previous message is a model message with at least one tool request.`,
});
}

Expand All @@ -365,7 +364,6 @@ export async function resolveResumeOption(
part,
toolMap
);
console.log('RESOLVED TOOL', part.toolRequest.name, 'TO', resolved);
if (resolved.interrupt) {
interrupted = true;
return resolved.interrupt;
Expand Down Expand Up @@ -407,7 +405,6 @@ export async function resolveResumeOption(
},
};

console.log('CONSTRUCTED A TOOL MESSAGE:', toolMessage.content);
return stripUndefinedProps({
revisedRequest: {
...rawRequest,
Expand Down
4 changes: 0 additions & 4 deletions js/core/src/tracing/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ class FilteringReadableSpanProxy implements ReadableSpan {
return this.span.status;
}
get attributes() {
console.log(
'FilteringReadableSpanProxy get attributes',
this.span.attributes
);
const out = {} as Record<string, any>;
for (const [key, value] of Object.entries(this.span.attributes)) {
if (!key.startsWith(ATTR_PREFIX + ':')) {
Expand Down
6 changes: 0 additions & 6 deletions js/plugins/langchain/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ export class GenkitTracer extends BaseTracer {
ctx = trace.setSpan(context.active(), parentCtx);
}
const span = this.tracer.startSpan(run.name, undefined, ctx);
console.log('run', JSON.stringify(run, undefined, ' '));
if (run.inputs) {
console.log('setting inputs', run.inputs);
console.log(
'setting inputs flattened',
this.maybeFlattenInput(run.inputs)
);
span.setAttribute(
'genkit:input',
JSON.stringify(this.maybeFlattenInput(run.inputs))
Expand Down
1 change: 0 additions & 1 deletion js/plugins/mcp/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export class GenkitMcpServer {
const toolList: ToolAction[] = [];
const promptList: PromptAction[] = [];
for (const k in allActions) {
console.log('action:', k);
if (k.startsWith('/tool/')) {
toolList.push(allActions[k] as ToolAction);
} else if (k.startsWith('/prompt/')) {
Expand Down

0 comments on commit c3775f9

Please sign in to comment.