// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; export class EnhancePrompt extends APIResource { /** * Improve a user's prompt for a given chatbot using an LLM-based rewrite. */ enhancePrompt( params: EnhancePromptEnhancePromptParams, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.post('/enhance-prompt', { body, ...options, headers: buildHeaders([ { 'Content-Type': 'application/x-www-form-urlencoded', ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } export type EnhancePromptEnhancePromptResponse = { [key: string]: unknown }; export interface EnhancePromptEnhancePromptParams { /** * Body param */ chatbot_id: string; /** * Body param */ message: string; /** * Body param */ anonymize_lm?: boolean; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace EnhancePrompt { export { type EnhancePromptEnhancePromptResponse as EnhancePromptEnhancePromptResponse, type EnhancePromptEnhancePromptParams as EnhancePromptEnhancePromptParams, }; }