mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
feat(types): add UpdateAgentResponse type and schema
Update agent service to use new response type for consistency
This commit is contained in:
parent
f9fb0f9125
commit
230205d210
@ -8,7 +8,8 @@ import type {
|
||||
GetAgentResponse,
|
||||
ListAgentsResponse,
|
||||
ListOptions,
|
||||
UpdateAgentRequest
|
||||
UpdateAgentRequest,
|
||||
UpdateAgentResponse
|
||||
} from '@types'
|
||||
import { count, eq } from 'drizzle-orm'
|
||||
|
||||
@ -111,7 +112,7 @@ export class AgentService extends BaseService {
|
||||
return { agents, total: totalResult[0].count }
|
||||
}
|
||||
|
||||
async updateAgent(id: string, updates: UpdateAgentRequest): Promise<GetAgentResponse | null> {
|
||||
async updateAgent(id: string, updates: UpdateAgentRequest): Promise<UpdateAgentResponse | null> {
|
||||
this.ensureInitialized()
|
||||
|
||||
// Check if agent exists
|
||||
|
||||
@ -138,6 +138,10 @@ export const ListAgentsResponseSchema = z.object({
|
||||
|
||||
export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>
|
||||
|
||||
export const UpdateAgentResponseSchema = GetAgentResponseSchema
|
||||
|
||||
export type UpdateAgentResponse = GetAgentResponse
|
||||
|
||||
export type CreateSessionRequest = AgentBase
|
||||
|
||||
export interface UpdateSessionRequest extends Partial<AgentBase> {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user