.
This commit is contained in:
@@ -35,7 +35,6 @@ export const gemini = agent({
|
|||||||
env: {
|
env: {
|
||||||
GEMINI_API_KEY: apiKey,
|
GEMINI_API_KEY: apiKey,
|
||||||
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
||||||
GEMINI_CLI_DISABLE_SCHEMA_VALIDATION: "1",
|
|
||||||
},
|
},
|
||||||
onStdout: (chunk) => {
|
onStdout: (chunk) => {
|
||||||
const trimmed = chunk.trim();
|
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({
|
configure({
|
||||||
toJsonSchema: {
|
toJsonSchema: {
|
||||||
dialect: null,
|
// dialect: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-28
@@ -65,36 +65,9 @@ export const tool = <const params>(toolDef: Tool<any, StandardSchemaV1<params>>)
|
|||||||
return toolDef;
|
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>[]) => {
|
export const addTools = (server: FastMCP, tools: Tool<any, any>[]) => {
|
||||||
for (const tool of tools) {
|
for (const tool of tools) {
|
||||||
// clone tool and remove $schema from parameters schema
|
server.addTool(tool);
|
||||||
const cleanedTool = {
|
|
||||||
...tool,
|
|
||||||
parameters: tool.parameters ? removeSchemaFields(tool.parameters) : undefined,
|
|
||||||
};
|
|
||||||
server.addTool(cleanedTool);
|
|
||||||
}
|
}
|
||||||
return server;
|
return server;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export async function run(
|
|||||||
|
|
||||||
const inputs: Required<Inputs> = {
|
const inputs: Required<Inputs> = {
|
||||||
prompt,
|
prompt,
|
||||||
agent: "gemini",
|
agent: "codex",
|
||||||
...flatMorph(agents, (_, agent) =>
|
...flatMorph(agents, (_, agent) =>
|
||||||
agent.apiKeyNames.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
agent.apiKeyNames.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user