mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 13:59:28 +08:00
refactor(types): convert GetAgentSessionResponse interface to zod schema
Improve type safety by using zod schema definition and inference instead of manual interface
This commit is contained in:
parent
5c578c191b
commit
0f777e357d
@ -135,10 +135,12 @@ export type CreateSessionRequest = AgentBase
|
||||
|
||||
export interface UpdateSessionRequest extends Partial<AgentBase> {}
|
||||
|
||||
export interface GetAgentSessionResponse extends AgentSessionEntity {
|
||||
built_in_tools?: Tool[] // Built-in tools available to the agent
|
||||
messages: AgentSessionMessageEntity[] // Messages in the session
|
||||
}
|
||||
export const GetAgentSessionResponseSchema = AgentSessionEntitySchema.extend({
|
||||
built_in_tools: z.array(ToolSchema).optional(), // Built-in tools available to the agent
|
||||
messages: z.array(AgentSessionMessageEntitySchema) // Messages in the session
|
||||
})
|
||||
|
||||
export type GetAgentSessionResponse = z.infer<typeof GetAgentSessionResponseSchema>
|
||||
|
||||
export interface CreateSessionMessageRequest {
|
||||
content: string
|
||||
|
||||
Loading…
Reference in New Issue
Block a user