///
/// LLMGenerationConfig.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

import NitroModules

/**
 * Represents an instance of `LLMGenerationConfig`, backed by a C++ struct.
 */
public typealias LLMGenerationConfig = margelo.nitro.mlxreactnative.LLMGenerationConfig

public extension LLMGenerationConfig {
  private typealias bridge = margelo.nitro.mlxreactnative.bridge.swift

  /**
   * Create a new instance of `LLMGenerationConfig`.
   */
  init(maxTokens: Double?, maxKVSize: Double?, kvBits: Double?, kvGroupSize: Double?, quantizedKVStart: Double?, temperature: Double?, topP: Double?, repetitionPenalty: Double?, repetitionContextSize: Double?, prefillStepSize: Double?) {
    self.init({ () -> bridge.std__optional_double_ in
      if let __unwrappedValue = maxTokens {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = maxKVSize {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = kvBits {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = kvGroupSize {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = quantizedKVStart {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = temperature {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = topP {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = repetitionPenalty {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = repetitionContextSize {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = prefillStepSize {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var maxTokens: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__maxTokens) {
        let __unwrapped = bridge.get_std__optional_double_(self.__maxTokens)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var maxKVSize: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__maxKVSize) {
        let __unwrapped = bridge.get_std__optional_double_(self.__maxKVSize)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var kvBits: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__kvBits) {
        let __unwrapped = bridge.get_std__optional_double_(self.__kvBits)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var kvGroupSize: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__kvGroupSize) {
        let __unwrapped = bridge.get_std__optional_double_(self.__kvGroupSize)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var quantizedKVStart: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__quantizedKVStart) {
        let __unwrapped = bridge.get_std__optional_double_(self.__quantizedKVStart)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var temperature: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__temperature) {
        let __unwrapped = bridge.get_std__optional_double_(self.__temperature)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var topP: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__topP) {
        let __unwrapped = bridge.get_std__optional_double_(self.__topP)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var repetitionPenalty: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__repetitionPenalty) {
        let __unwrapped = bridge.get_std__optional_double_(self.__repetitionPenalty)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var repetitionContextSize: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__repetitionContextSize) {
        let __unwrapped = bridge.get_std__optional_double_(self.__repetitionContextSize)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var prefillStepSize: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__prefillStepSize) {
        let __unwrapped = bridge.get_std__optional_double_(self.__prefillStepSize)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
}
