Skip to content

Fix AI() inferred return types #2096

@nathanclevenger

Description

@nathanclevenger
import { AI } from '@/lib/ai'

export const { leanCanvas } = AI({
  leanCanvas: {
    productName: 'name of the product or service',
    problem: ['top 3 problems the product solves'],
    solution: ['top 3 solutions the product offers'],
    uniqueValueProposition: 'clear message that states the benefit of your product',
    unfairAdvantage: 'something that cannot be easily copied or bought',
    customerSegments: ['list of target customer segments'],
    keyMetrics: ['list of key numbers that tell you how your business is doing'],
    channels: ['path to customers'],
    costStructure: ['list of operational costs'],
    revenueStreams: ['list of revenue sources'],
    recommendations: ['list of recommendations based on the analysis'],
  },
})

in this example, leanCanvas has an inferred TypeScript type of const leanCanvas: never so I think something is still wrong with the TypeScript generics, as the type should be (args: any) => Promise<{ productName: string, … >

PR #2098 was merged, but it still shows a return of never in .ai/functions/leanCanvas.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions