mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +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
|
// AgentSession entity representing a conversation session with one or more agents
|
||||||
export interface AgentSessionEntity extends AgentBase {
|
export const AgentSessionEntitySchema = AgentBaseSchema.extend({
|
||||||
id: string
|
id: z.string(),
|
||||||
agent_id: string // Primary agent ID for the session
|
agent_id: z.string(), // Primary agent ID for the session
|
||||||
agent_type: AgentType
|
agent_type: AgentTypeSchema,
|
||||||
// sub_agent_ids?: string[] // Array of sub-agent IDs involved in the session
|
// sub_agent_ids?: string[] // Array of sub-agent IDs involved in the session
|
||||||
|
|
||||||
created_at: string
|
created_at: z.iso.datetime(),
|
||||||
updated_at: string
|
updated_at: z.iso.datetime()
|
||||||
}
|
})
|
||||||
|
|
||||||
|
export type AgentSessionEntity = z.infer<typeof AgentSessionEntitySchema>
|
||||||
|
|
||||||
// AgentSessionMessageEntity representing a message within a session
|
// AgentSessionMessageEntity representing a message within a session
|
||||||
export interface AgentSessionMessageEntity {
|
export interface AgentSessionMessageEntity {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user