mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +08:00
feat(types): add CreateAgentResponse type and update AgentService return type
This commit is contained in:
parent
0d0ab4dcf5
commit
5a71807cc9
@ -1,7 +1,14 @@
|
||||
import path from 'node:path'
|
||||
|
||||
import { getDataPath } from '@main/utils'
|
||||
import type { AgentEntity, CreateAgentRequest, GetAgentResponse, ListOptions, UpdateAgentRequest } from '@types'
|
||||
import type {
|
||||
AgentEntity,
|
||||
CreateAgentRequest,
|
||||
CreateAgentResponse,
|
||||
GetAgentResponse,
|
||||
ListOptions,
|
||||
UpdateAgentRequest
|
||||
} from '@types'
|
||||
import { count, eq } from 'drizzle-orm'
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
@ -23,7 +30,7 @@ export class AgentService extends BaseService {
|
||||
}
|
||||
|
||||
// Agent Methods
|
||||
async createAgent(req: CreateAgentRequest): Promise<AgentEntity> {
|
||||
async createAgent(req: CreateAgentRequest): Promise<CreateAgentResponse> {
|
||||
this.ensureInitialized()
|
||||
|
||||
const id = `agent_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`
|
||||
|
||||
@ -108,6 +108,8 @@ export interface CreateAgentRequest extends AgentBase {
|
||||
type: AgentType
|
||||
}
|
||||
|
||||
export type CreateAgentResponse = AgentEntity
|
||||
|
||||
export interface UpdateAgentRequest extends Partial<AgentBase> {}
|
||||
|
||||
export interface GetAgentResponse extends AgentEntity {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user