export type Tag = {key?: string | undefined, type?: string | undefined, value?: string | undefined}; export type MessageTemplate = {createTime?: number | undefined, createdBy?: string | undefined, description?: string | undefined, integrations?: Array | undefined, name?: string | undefined, ownerApp?: string | undefined, responseFormat?: string | undefined, stopWords?: Array | undefined, tags?: Array | undefined, temperature?: number | undefined, template?: string | undefined, topP?: number | undefined, updateTime?: number | undefined, updatedBy?: string | undefined, variables?: Array | undefined, version?: number | undefined}; export type UpdateApiApiPromptsV2NameArgs = {name: string, body: MessageTemplate}; export type UpdateApiApiPromptsV2NameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a template with full configuration (v2) * * PUT /api/prompts/v2/{name} */ export const updateApiApiPromptsV2Name = async (args: UpdateApiApiPromptsV2NameArgs, options?: UpdateApiApiPromptsV2NameOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/prompts/v2/${encodeURIComponent(String(args.name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };