[페이지 분류 강화 작업]
This commit is contained in:
@@ -86,6 +86,26 @@ export function isCrawlTerminal(status: string): boolean {
|
||||
return TERMINAL_CRAWL_STATUSES.has(status);
|
||||
}
|
||||
|
||||
export const extractorModelsResponseSchema = z.object({
|
||||
ok: z.boolean(),
|
||||
error: z.string().optional(),
|
||||
models: z
|
||||
.array(
|
||||
z
|
||||
.object({
|
||||
id: z.string(),
|
||||
owned_by: z.string().optional(),
|
||||
})
|
||||
.passthrough(),
|
||||
)
|
||||
.optional()
|
||||
.default([]),
|
||||
});
|
||||
|
||||
export type ExtractorModelsResponse = z.infer<
|
||||
typeof extractorModelsResponseSchema
|
||||
>;
|
||||
|
||||
export const crawlApi = {
|
||||
startByProject: (body: StartSiteCrawlRequest) =>
|
||||
apiClient.post("/crawl-site/by-project", crawlJobSchema, body),
|
||||
@@ -99,4 +119,9 @@ export const crawlApi = {
|
||||
`/crawl-site/jobs/${encodeURIComponent(jobId)}/cancel`,
|
||||
crawlJobSchema,
|
||||
),
|
||||
listExtractorModels: (provider: string, baseUrl?: string | null) =>
|
||||
apiClient.post("/extractors/models", extractorModelsResponseSchema, {
|
||||
provider,
|
||||
base_url: baseUrl || null,
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user