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:
icarus 2025-09-18 13:17:32 +08:00
parent 5c578c191b
commit 0f777e357d

View File

@ -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