export type PatchApiV20AiagentsAiAgentIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, aiAgentId: string, body: {name?: string | undefined, image?: string | undefined, imageOptimizedFormat?: boolean | undefined, knowledgeReferenceId?: (string | null) | undefined, description?: string | undefined, speakingStyle?: ({completeness?: string | undefined, formality?: string | undefined}) | undefined, voiceConfigs?: ({ttsVoice?: string | undefined, ttsLanguage?: string | undefined, ttsVendor?: ('aws' | 'deepgram' | 'elevenlabs' | 'google' | 'microsoft' | 'nuance' | 'default' | 'custom' | 'none') | undefined, ttsModel?: string | undefined, ttsLabel?: string | undefined, ttsDisableCache?: boolean | undefined}) | undefined, enableVoiceConfigs?: boolean | undefined, enableAutoLanguageDetection?: boolean | undefined, safetySettings?: ({avoidHarmfulContent?: boolean | undefined, avoidUngroundedContent?: boolean | undefined, avoidCopyrightInfringements?: boolean | undefined, preventJailbreakAndManipulation?: boolean | undefined}) | undefined, contactProfilesOption?: ('none' | 'selectedProfileFields' | 'completeProfile' | 'profileMemoriesOnly') | undefined, contactProfilesSelected?: Array | undefined, instructions?: string | undefined}}; export type PatchApiV20AiagentsAiAgentIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an AI Agent * * PATCH /v2.0/aiagents/{aiAgentId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const patchApiV20AiagentsAiAgentId = async (args: PatchApiV20AiagentsAiAgentIdArgs, options?: PatchApiV20AiagentsAiAgentIdOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/aiagents/${encodeURIComponent(String(args.aiAgentId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };