Defines Zod schemas for AI response and mention search results.
// Source: https://github.com/corsairdev/corsair | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';
import {
Bool,
Filters,
Location,
MonthlySearches,
Num,
OrderBy,
Strings,
Tag,
Text,
} from './shared';
const LlmResponseItem = z.object({
type: z.enum(['message', 'reasoning']),
sections: z
.array(
z.object({
type: Text,
text: Text,
annotations: z
.array(
z.object({
title: Text,
url: Text,
direct_url: Text,
start_index: Num,
end_index: Num,
text: Text,
}),
)
.nullish(),
}),
)
.nullish(),
});
export const LlmResponseResult = z.object({
model_name: Text,
i
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key