export interface API { desc: string; name: string; } export interface Tool { apis: API[]; identifier: string; name?: string; systemRole?: string; } export const apiPrompt = (api: API) => `${api.desc}`; export const toolPrompt = (tool: Tool) => ` ${tool.systemRole ? `${tool.systemRole}` : ''} ${tool.apis.map((api) => apiPrompt(api)).join('\n')} `; export const toolsPrompts = (tools: Tool[]) => { const hasTools = tools.length > 0; if (!hasTools) return ''; return tools.map((tool) => toolPrompt(tool)).join('\n'); };