HybridModel
public struct HybridModel : LanguageModelA hybrid model combining a primary, or main, model and a secondary, or fallback, model.
Public Preview: This API is a public preview and may be subject to change.
-
[Public Preview] Creates a
HybridModelfor the specified models.Warning
This API is a public preview and may be subject to change.
Declaration
Swift
public init(primary: any LanguageModel, secondary: any LanguageModel)Parameters
primaryThe main, or default, model to use.
secondaryThe backup model to fallback to if the
primarymodel is unavailable.
-
Returns the name of the model.
Declaration
Swift
public var _modelName: String { get } -
Returns a new session for this model.
Declaration
Swift
public func _startSession(tools: [any ToolRepresentable]?, instructions: String?) throws -> any _ModelSession