Path: blob/master/src/packages/next/lib/api/schema/guesslang.ts
1449 views
import { z } from "../framework";12import { FailedAPIOperationSchema } from "./common";34// OpenAPI spec5//6export const GuesslangInputSchema = z7.object({8code: z.string().describe("A snippet of code."),9cutoff: z10.number()11.positive()12.default(5)13.describe("Maximum number of results to return."),14})15.describe(16`Use a sophisticated machine learning model (see17\`@vscode/vscode-languagedetection\`) to guess the language of a snippet of18code.`,19);2021export const GuesslangOutputSchema = z.union([22FailedAPIOperationSchema,23z.object({24result: z25.array(z.string())26.describe(27`List of likely guesses for the type of code, from most likely to least28likely.`,29),30}),31]);3233export type GuesslangInput = z.infer<typeof GuesslangInputSchema>;34export type GuesslangOutput = z.infer<typeof GuesslangOutputSchema>;353637