mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 19:30:17 +08:00
refactor(types): convert AgentSessionEntity interface to zod schema
Use zod schema for better type safety and validation capabilities
This commit is contained in:
parent
71a1daddef
commit
7a4952f773
@ -78,15 +78,17 @@ export interface ListOptions {
|
||||
}
|
||||
|
||||
// AgentSession entity representing a conversation session with one or more agents
|
||||
export interface AgentSessionEntity extends AgentBase {
|
||||
id: string
|
||||
agent_id: string // Primary agent ID for the session
|
||||
agent_type: AgentType
|
||||
export const AgentSessionEntitySchema = AgentBaseSchema.extend({
|
||||
id: z.string(),
|
||||
agent_id: z.string(), // Primary agent ID for the session
|
||||
agent_type: AgentTypeSchema,
|
||||
// sub_agent_ids?: string[] // Array of sub-agent IDs involved in the session
|
||||
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
created_at: z.iso.datetime(),
|
||||
updated_at: z.iso.datetime()
|
||||
})
|
||||
|
||||
export type AgentSessionEntity = z.infer<typeof AgentSessionEntitySchema>
|
||||
|
||||
// AgentSessionMessageEntity representing a message within a session
|
||||
export interface AgentSessionMessageEntity {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user