// 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'; import { path } from '../../../internal/utils/path'; export class Models extends APIResource { /** * List models supported by a chatbot, including full model configuration for each * entry. */ list( chatbotID: string, params: ModelListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.get(path`/v2/chatbots/${chatbotID}/models`, { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Model for a chatbot model item. * * Attributes: name (str): The name of the chatbot model. display_name (str): The * display name of the chatbot model. description (str): A brief description of the * chatbot model. icon (str): The icon representing the chatbot model. * supported_attachments (dict[str, list[str]]): Supported attachment types and * formats. */ export interface ChatbotModelItem { /** * A brief description of the chatbot model */ description: string; /** * The display name of the chatbot model */ display_name: string; /** * The icon representing the chatbot model */ icon: string; /** * The name of the chatbot model */ name: string; /** * Supported attachment types and formats */ supported_attachments: { [key: string]: Array }; } /** * Response model for listing chatbot models (`GET /v2/chatbots/{id}/models`). */ export interface ModelListResponse { models: Array; } export interface ModelListParams { 'Accept-Language'?: string; /** * 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 Models { export { type ChatbotModelItem as ChatbotModelItem, type ModelListResponse as ModelListResponse, type ModelListParams as ModelListParams, }; }