(value: unknown)
| 118 | } |
| 119 | |
| 120 | const schema = (value: unknown): JsonSchema => { |
| 121 | if (!isRecord(value)) return { type: "object", properties: {} } |
| 122 | if (isRecord(value.jsonSchema)) return value.jsonSchema |
| 123 | return value |
| 124 | } |
| 125 | |
| 126 | const tools = (input: Record<string, ToolInput> | undefined): ToolDefinition[] => |
| 127 | Object.entries(input ?? {}).map(([name, item]) => |