Skip to content

Commit 272e6d7

Browse files
committed
fix: remove unused output_schema and serializeApiBasedTool function from ApiBasedTool
1 parent bd4865b commit 272e6d7

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

agent/tools/fetchToolSchema.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { tool } from "langchain";
22
import { z } from "zod";
3-
import {
4-
serializeApiBasedTool,
5-
type ApiBasedTool,
6-
} from "../../apiBasedTools.js";
3+
import type { ApiBasedTool } from "../../apiBasedTools.js";
74

85
const fetchToolSchemaSchema = z.object({
96
toolName: z
@@ -34,7 +31,7 @@ export async function createFetchToolSchemaTool(
3431
{
3532
status: 200,
3633
name: toolName,
37-
...serializeApiBasedTool(toolDefinition),
34+
loaded: true,
3835
},
3936
null,
4037
2,

apiBasedTools.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ export type ApiBasedToolCallParams = {
175175
export type ApiBasedTool = {
176176
description?: string;
177177
input_schema?: unknown;
178-
output_schema?: unknown;
179178
call: (params?: ApiBasedToolCallParams) => Promise<string>;
180179
};
181180

@@ -616,7 +615,6 @@ export function prepareApiBasedTools(
616615
apiBasedTools[toolName] = {
617616
description: schema.description,
618617
input_schema: schema.request_schema,
619-
output_schema: schema.response_schema,
620618
call: async ({ adminUser, adminuser, abortSignal, inputs, userTimeZone, acceptLanguage } = {}) => {
621619
if (isHiddenResourceCall(hiddenResourceIdSet, inputs)) {
622620
return YAML.stringify({
@@ -652,16 +650,3 @@ export function prepareApiBasedTools(
652650

653651
return apiBasedTools;
654652
}
655-
656-
export function serializeApiBasedTool(tool: ApiBasedTool | undefined) {
657-
if (!tool) {
658-
return null;
659-
}
660-
661-
return {
662-
description: tool.description,
663-
input_schema: tool.input_schema,
664-
output_schema: tool.output_schema,
665-
call: '[Function]',
666-
};
667-
}

0 commit comments

Comments
 (0)