SmythOS SDK
    Preparing search index...

    Type Alias TModelFactory

    TModelFactory: {
        (modelId: string, modelParams?: TLLMInstanceParams): any;
        (
            modelParams: TLLMInstanceParams & {
                model: string | TLLMModel | TCustomLLMModel;
            },
        ): any;
    }

    Model factory functions for each LLM provider.

    Supported calling patterns:

    • Model.provider(modelId, modelParams) - specify model ID and optional parameters
    • Model.provider(modelParams) - specify model ID within modelParams object

    Type declaration

      • (modelId: string, modelParams?: TLLMInstanceParams): any
      • Create a model with explicit model ID and optional parameters.

        Parameters

        • modelId: string

          The model identifier (e.g., 'gpt-4', 'claude-3-sonnet')

        • OptionalmodelParams: TLLMInstanceParams

          Optional model parameters (temperature, maxTokens, etc.)

        Returns any

        Configured model object

      • (
            modelParams: TLLMInstanceParams & {
                model: string | TLLMModel | TCustomLLMModel;
            },
        ): any
      • Create a model with parameters object containing model ID.

        Parameters

        • modelParams: TLLMInstanceParams & { model: string | TLLMModel | TCustomLLMModel }

          Model parameters including the required model field

        Returns any

        Configured model object

    // Pattern 1: Explicit model ID
    const model1 = Model.openai('gpt-4', { temperature: 0.7 });

    // Pattern 2: Model ID in params
    const model2 = Model.openai({ model: 'gpt-4', temperature: 0.7 });