export type AiChatRejectToolRequest = {toolUseIds: Array, message?: string | undefined}; export type CreateApiV1OrgOrgIdAiChatChatIdRejectToolArgs = {orgId: string, chatId: string, body: AiChatRejectToolRequest}; export type CreateApiV1OrgOrgIdAiChatChatIdRejectToolOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reject pending tool calls in an AI chat * * POST /v1/org/{orgId}/ai/chat/{chatId}/reject-tool */ export const createApiV1OrgOrgIdAiChatChatIdRejectTool = async (args: CreateApiV1OrgOrgIdAiChatChatIdRejectToolArgs, options?: CreateApiV1OrgOrgIdAiChatChatIdRejectToolOptions) => { const {baseUrl = "https://localhost", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/org/${encodeURIComponent(String(args.orgId))}/ai/chat/${encodeURIComponent(String(args.chatId))}/reject-tool${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };