/**
 * Alibaba Cloud Model Studio Node - Version 1
 * Discriminator: resource=text, operation=message
 */


interface Credentials {
  alibabaCloudApi: CredentialReference;
}

/** Create a completion with a Qwen model */
export type LcAlibabaCloudV1TextMessageParams = {
  resource: 'text';
  operation: 'message';
/**
 * The model to use for generation
 * @default qwen3.5-flash
 */
    modelId?: 'qwen3-max' | 'qwen3-max-2026-01-23' | 'qwen3.5-122b-a10b' | 'qwen3.5-27b' | 'qwen3.5-35b-a3b' | 'qwen3.5-397b-a17b' | 'qwen3.5-flash' | 'qwen3.5-flash-2026-02-23' | 'qwen3.5-plus' | 'qwen3.5-plus-2026-02-15' | Expression<string>;
/**
 * Messages
 * @default {"messageValues":[{"content":"","role":"user"}]}
 */
    messages?: {
        /** Message
     */
    messageValues?: Array<{
      /** The content of the message
       */
      content?: string | Expression<string> | PlaceholderValue;
      /** The role of the message sender
       * @default user
       */
      role?: 'user' | 'assistant' | Expression<string>;
    }>;
  };
/**
 * Whether to return a simplified version of the response instead of the raw data
 * @default true
 */
    simplify?: boolean | Expression<boolean>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Whether to enable web search for up-to-date information
     * @default false
     */
    enableSearch?: boolean | Expression<boolean>;
    /** Maximum number of tokens to generate
     * @default 2000
     */
    maxTokens?: number | Expression<number>;
    /** Maximum number of tool-calling iterations before stopping. Set to 0 for unlimited.
     * @default 15
     */
    maxToolsIterations?: number | Expression<number>;
    /** Penalty for token repetition. Higher values reduce repetition.
     * @default 1.1
     */
    repetitionPenalty?: number | Expression<number>;
    /** Random seed for reproducible outputs
     * @default 1234
     */
    seed?: number | Expression<number>;
    /** Comma-separated list of sequences where the API will stop generating
     */
    stop?: string | Expression<string> | PlaceholderValue;
    /** System Message
     */
    system?: string | Expression<string> | PlaceholderValue;
    /** Controls randomness in the output. Lower values make output more focused and deterministic.
     * @default 1
     */
    temperature?: number | Expression<number>;
    /** Limits the sampling pool to top K tokens
     * @default 50
     */
    topK?: number | Expression<number>;
    /** Nucleus sampling parameter. Lower values make output more focused.
     * @default 0.9
     */
    topP?: number | Expression<number>;
  };
};

export interface LcAlibabaCloudV1TextMessageSubnodeConfig {
  tools?: ToolInstance[];
}

export type LcAlibabaCloudV1TextMessageNode = {
  type: '@n8n/n8n-nodes-langchain.alibabaCloud';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<LcAlibabaCloudV1TextMessageParams> & { subnodes?: LcAlibabaCloudV1TextMessageSubnodeConfig };
};