export type GuardrailsSettings = {exception_message?: string | undefined, show_violated_responses?: boolean | undefined, guardrails_on_transcriptions?: boolean | undefined, vision_guardrails_enabled?: boolean | undefined, guardrails_vision_llm?: string | undefined, column_redaction_config?: Array> | undefined, disallowed_regex_patterns?: Array | undefined, presidio_labels_to_flag?: Array | undefined, pii_labels_to_flag?: Array | undefined, pii_detection_parse_action?: ('allow' | 'redact' | 'fail') | undefined, pii_detection_llm_input_action?: ('allow' | 'redact' | 'fail') | undefined, pii_detection_llm_output_action?: ('allow' | 'redact' | 'fail') | undefined, prompt_guard_labels_to_flag?: Array | undefined, guardrails_labels_to_flag?: Array | undefined, guardrails_llm?: string | undefined, guardrails_safe_category?: string | undefined, guardrails_entities?: {[key: string]: string} | undefined, column_redaction_custom_entities_to_flag?: Array | undefined, column_redaction_custom_entities?: {[key: string]: string} | undefined, custom_pii_entities_to_flag?: Array | undefined, custom_pii_entities?: {[key: string]: string} | undefined}; export type CollectionSettings = {max_tokens_per_chunk?: number | undefined, chunk_overlap_tokens?: number | undefined, gen_doc_summaries?: boolean | undefined, gen_doc_questions?: boolean | undefined, audio_input_language?: string | undefined, ocr_model?: string | undefined, tesseract_lang?: string | undefined, keep_tables_as_one_chunk?: boolean | undefined, chunk_by_page?: boolean | undefined, handwriting_check?: boolean | undefined, ingest_mode?: ('standard' | 'lite' | 'agent_only') | undefined, follow_links?: boolean | undefined, max_depth?: number | undefined, max_documents?: number | undefined, root_dir?: string | undefined, copy_document?: boolean | undefined, guardrails_settings?: GuardrailsSettings | undefined, expiry_timezone?: string | undefined}; export type UpdateApiCollectionsCollectionIdSettingsArgs = {collection_id: string, body: CollectionSettings}; export type UpdateApiCollectionsCollectionIdSettingsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates collection settings. * * PUT /collections/{collection_id}/settings */ export const updateApiCollectionsCollectionIdSettings = async (args: UpdateApiCollectionsCollectionIdSettingsArgs, options?: UpdateApiCollectionsCollectionIdSettingsOptions) => { const {baseUrl = "https://h2ogpte.genai.h2o.ai/api/v1", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/collections/${encodeURIComponent(String(args.collection_id))}/settings${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 };