.
This commit is contained in:
@@ -35,7 +35,6 @@ export const gemini = agent({
|
||||
env: {
|
||||
GEMINI_API_KEY: apiKey,
|
||||
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
||||
GEMINI_CLI_DISABLE_SCHEMA_VALIDATION: "1",
|
||||
},
|
||||
onStdout: (chunk) => {
|
||||
const trimmed = chunk.trim();
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
comment on https://github.com/pullfrogai/scratch/pull/29 that writes a really funny joke about Arktype
|
||||
comment on https://github.com/pullfrogai/scratch/pull/29 that writes a really funny joke about Codex
|
||||
+1
-1
@@ -2,6 +2,6 @@ import { configure } from "arktype/config";
|
||||
|
||||
configure({
|
||||
toJsonSchema: {
|
||||
dialect: null,
|
||||
// dialect: null,
|
||||
},
|
||||
});
|
||||
|
||||
+1
-28
@@ -65,36 +65,9 @@ export const tool = <const params>(toolDef: Tool<any, StandardSchemaV1<params>>)
|
||||
return toolDef;
|
||||
};
|
||||
|
||||
// recursively remove $schema fields from JSON Schema objects
|
||||
function removeSchemaFields(obj: any): any {
|
||||
if (obj === null || typeof obj !== "object") {
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(removeSchemaFields);
|
||||
}
|
||||
|
||||
const result: any = {};
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
// skip $schema fields
|
||||
if (key === "$schema") {
|
||||
continue;
|
||||
}
|
||||
result[key] = removeSchemaFields(value);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export const addTools = (server: FastMCP, tools: Tool<any, any>[]) => {
|
||||
for (const tool of tools) {
|
||||
// clone tool and remove $schema from parameters schema
|
||||
const cleanedTool = {
|
||||
...tool,
|
||||
parameters: tool.parameters ? removeSchemaFields(tool.parameters) : undefined,
|
||||
};
|
||||
server.addTool(cleanedTool);
|
||||
server.addTool(tool);
|
||||
}
|
||||
return server;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user