| 29 | } |
| 30 | |
| 31 | export function getImageGenToolDefinitions(): Array<{ |
| 32 | type: 'function'; |
| 33 | function: { |
| 34 | name: string; |
| 35 | description: string; |
| 36 | parameters: { |
| 37 | type: 'object'; |
| 38 | properties: Record<string, unknown>; |
| 39 | required: string[]; |
| 40 | }; |
| 41 | }; |
| 42 | }> { |
| 43 | return [ |
| 44 | { |
| 45 | type: 'function', |
| 46 | function: { |
| 47 | name: TOOL_NAME, |
| 48 | description: |
| 49 | 'Generate an image from a text prompt. The image is displayed in chat and saved to disk. Returns a url.', |
| 50 | parameters: { |
| 51 | type: 'object', |
| 52 | properties: { |
| 53 | prompt: { |
| 54 | type: 'string', |
| 55 | description: 'Detailed description of the image to generate', |
| 56 | }, |
| 57 | }, |
| 58 | required: ['prompt'], |
| 59 | }, |
| 60 | }, |
| 61 | }, |
| 62 | ]; |
| 63 | } |
| 64 | |
| 65 | export function isImageGenTool(toolName: string): boolean { |
| 66 | return toolName === TOOL_NAME; |