News for hackers. Stuff that matters.
Re:Use the Gemini API with OpenAI Fallback in TypeScript by dcre on Sunday April 06, 2025 @10:14PM (#43606902)
Silly comment, but I concede this bit is very ugly — they should have extracted the inner type to an alias and used that twice.

    options: [
        Omit<ChatCompletionParseParams, 'model'> & { model: Model },
        Omit<ChatCompletionParseParams, 'model'> & { model: Model },
      ],
like this

    type Options = Omit<ChatCompletionParseParams, 'model'> & { model: Model }
    
    options: [Options, Options]

There are no comments on this comment yet.