mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
feat(contracts): add llmSetupStatus schema and llm_setup on create response
This commit is contained in:
parent
6a5b62de65
commit
be626dff05
2 changed files with 11 additions and 1 deletions
|
|
@ -111,6 +111,12 @@ export const globalLlmConfigStatus = z.object({
|
||||||
exists: z.boolean(),
|
exists: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const llmSetupStatus = z.object({
|
||||||
|
status: z.enum(["ready", "needs_setup"]),
|
||||||
|
source: z.enum(["global_config", "models", "none"]),
|
||||||
|
can_configure: z.boolean(),
|
||||||
|
});
|
||||||
|
|
||||||
export const modelProviderRead = z.object({
|
export const modelProviderRead = z.object({
|
||||||
provider: z.string(),
|
provider: z.string(),
|
||||||
transport: z.string(),
|
transport: z.string(),
|
||||||
|
|
@ -140,5 +146,6 @@ export type ModelUpdateRequest = z.infer<typeof modelUpdateRequest>;
|
||||||
export type ModelsBulkUpdateRequest = z.infer<typeof modelsBulkUpdateRequest>;
|
export type ModelsBulkUpdateRequest = z.infer<typeof modelsBulkUpdateRequest>;
|
||||||
export type ModelRoles = z.infer<typeof modelRoles>;
|
export type ModelRoles = z.infer<typeof modelRoles>;
|
||||||
export type GlobalLlmConfigStatus = z.infer<typeof globalLlmConfigStatus>;
|
export type GlobalLlmConfigStatus = z.infer<typeof globalLlmConfigStatus>;
|
||||||
|
export type LlmSetupStatus = z.infer<typeof llmSetupStatus>;
|
||||||
export type VerifyConnectionResponse = z.infer<typeof verifyConnectionResponse>;
|
export type VerifyConnectionResponse = z.infer<typeof verifyConnectionResponse>;
|
||||||
export type ModelProviderRead = z.infer<typeof modelProviderRead>;
|
export type ModelProviderRead = z.infer<typeof modelProviderRead>;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { paginationQueryParams } from ".";
|
import { paginationQueryParams } from ".";
|
||||||
|
import { llmSetupStatus } from "./model-connections.types";
|
||||||
|
|
||||||
export const workspace = z.object({
|
export const workspace = z.object({
|
||||||
id: z.number(),
|
id: z.number(),
|
||||||
|
|
@ -36,7 +37,9 @@ export const createWorkspaceRequest = workspace.pick({ name: true, description:
|
||||||
qna_custom_instructions: z.string().nullable().optional(),
|
qna_custom_instructions: z.string().nullable().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const createWorkspaceResponse = workspace.omit({ member_count: true, is_owner: true });
|
export const createWorkspaceResponse = workspace
|
||||||
|
.omit({ member_count: true, is_owner: true })
|
||||||
|
.extend({ llm_setup: llmSetupStatus.nullable().optional() });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get workspace
|
* Get workspace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue