Skip to content

Releases: Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution

3.2.3

18 Nov 12:08
Compare
Choose a tag to compare
  • Renamed semanticSearchForFood to searchForFoodSemantic.
  • Renamed fetchNextPredictedIngredients to predictNextIngredients.

3.2.2

14 Nov 08:13
Compare
Choose a tag to compare

Added APIs:

  • Added semantic search API
/// Semantic search for food will return a list of alternate search and search result
    /// - Parameters:
    ///   - byText: User typed text
    ///   - completion: ``SearchResponse``, which containts list of alternate search and its results
    public func semanticSearchForFood(searchTerm: String,
                                      completion: @escaping (PassioNutritionAISDK.SearchResponse?) -> Void)
  • Added fetch next predicted ingredients API
/// Returns possible ingredients for a given food item
    /// - Parameters:
    ///   - ingredients: List of food ingredients name
    ///   - completion: ``PassioPredictedIngredients``, PassioPredictedIngredients responds with a success or error response. If the response is successful, you will receive an array of ``PassioAdvisorFoodInfo`` ingredients showing what might be contained in the given food.
    public func fetchNextPredictedIngredients(ingredients: [String], 
                                              completion: @escaping PassioNutritionAISDK.PassioPredictedIngredients)
  • Added method for setting unit on PassioFoodItem
public func setSelectedUnit(_ unit: String) -> Bool
  • Added method for setting quantity on PassioFoodItem
public func setSelectedQuantity(_ quantity: Double)

Updated APIs:

  • Change fetchTagsFor API to accept the refCode
/// Fetch the tags from the ref code
    /// - Parameters:
    ///   - refCode: Reference code of food item
    ///   - completion: Tag as a list of strings
    public func fetchTagsFor(refCode: String, 
                             completion: @escaping ([String]?) -> Void)
  • Change fetchInflammatoryEffectData API to accept the refCode
/// Fetch the list of nutrients with their inflammatory score
    /// - Parameters:
    ///   - refCode: Reference code of food item
    ///   - completion: List of `InflammatoryEffectData` objects
    public func fetchInflammatoryEffectData(refCode: String, 
                                            completion: @escaping ([PassioNutritionAISDK.InflammatoryEffectData]?) -> Void)

3.2.1

04 Oct 15:01
Compare
Choose a tag to compare

V3.2.1

New APIs:

  • Added report food API
/**
     Use this method to report incorrect food item
     
     - Parameters:
        - refCode: Reference code of food item
        - productCode: Product code
        - notes: Note if any (optional)
        - completion: You will receive ``PassioResult`` in completion.
     
     - Precondition: Either `refCode` or `productCode` must be present
     - Returns: It returns ``PassioResult`` that can be either an `errorMessage` or the `boolean` noting the success of the operation.
     */
     public func reportFoodItem(refCode: String = "",
                               productCode: String = "",
                               notes: [String]? = nil,
                               completion: @escaping PassioResult)
  • Submit User Created Food
/// Use this method to submit User Created Food. The method will return `true` if the uploading of user food is successfull.
    /// - Parameters:
    ///   - item: Pass ``PassioFoodItem`` to sumbit it to Passio
    ///   - completion: You will receive ``PassioResult`` in completion.
    public func submitUserCreatedFood(item: PassioFoodItem, completion: @escaping PassioResult)

3.2.0

13 Sep 06:29
Compare
Choose a tag to compare

What’s new in the version: 3.2.0

New APIs:

  • Added remote recognition of nutrition facts
/// Use this method for scanning nutrients from Packaged Product. This method returns ``PassioFoodItem``.
    /// - Parameters:
    ///   - image: Image for detecting nutrients
    ///   - resolution: Image resoultion for detection. Default Image resoultion is `512`, see ``PassioImageResolution`` for more options.
    ///   - completion: If the response is successful, you will receive ``PassioFoodItem`` or else you will receive nil value.
    public func recognizeNutritionFactsRemote(image: UIImage,
                                              resolution: PassioImageResolution = .res_512,
                                              completion: @escaping (PassioFoodItem?) -> Void)
  • Added support for localization
/// Use this method to retrieve localized food data. The method will return `true` if the language setting is applied successfully.
    /// - Parameters:
    ///   - languageCode: A two-character string representing the ISO 639-1 language code (e.g., 'en' for English, 'fr' for French, 'de' for German).
    public func updateLanguage(languageCode: String) -> Bool

Updated APIs.

  • Added remoteOnly property in PassioConfiguration struct
/// If you set this option to true, the SDK will not download the ML models and Visual and Packaged food detection won't work, only Barcode and NutritionFacts will work.
    public var remoteOnly = false
  • Added barcode and nutrition facts scanning to the recognizeImageRemote function.
/// Use this method to retrieve ``PassioAdvisorFoodInfo`` by providing an image. You can provide any image, including those of regular food, barcodes, or nutrition facts printed on a product, to obtain the corresponding ``PassioAdvisorFoodInfo``
    /// - Parameters:
    ///   - image: UIImage for recognizing Food, Barcodes or Nutrition Facts
    ///   - resolution: Image resoultion for detection. Default Image resoultion is 512, see ``PassioImageResolution`` for more options.
    ///   - completion: Returns Array of ``PassioAdvisorFoodInfo`` if any or empty array if unable to recognize food in image
    public func recognizeImageRemote(image: UIImage,
                                     resolution: PassioImageResolution = .res_512,
                                     message: String? = nil,
                                     completion: @escaping ([PassioAdvisorFoodInfo]) -> Void)
  • Added new tags property in PassioFoodDataInfo
public let tags: [String]?
  • Added new Vitamin A RAE with μ unit in PassioNutrients struct
public func vitaminA_RAE() ->  Measurement<UnitMass>?
  • Added new apiName property in PassioTokenBudget struct
public let apiName: String

3.1.4

19 Jul 10:36
Compare
Choose a tag to compare

What’s new in the version: 3.1.4

New APIs.

  • Added Token Usage API to track token usage.
/// Delegate to track account usage updates. Used to monitor total monthly
/// tokens, used tokens and how many tokens the last request used.
public weak var accountDelegate: PassioAccountDelegate?

/// Implement to receive account usage updates. Used to monitor total monthly
/// tokens, used tokens and how many tokens the last request used.
public protocol PassioAccountDelegate: AnyObject {
    func tokenBudgetUpdated(tokenBudget: PassioTokenBudget)
}

public struct PassioTokenBudget: Codable {
    public let budgetCap: Int
    public let periodUsage: Int
    public let requestUsage: Int
    public var usedPercent: Float { get }
    public func toString() -> String
    public func debugPrint()
}
  • Added Flashlight API to turn Flashlight on/off.
/// Use this method to turn Flashlight on/off.
/// - Parameters:
///   - enabled: Pass true to turn flashlight on or pass false to turn in off.
///   - torchLevel: Sets the illumination level when in Flashlight mode. This value must be a floating-point number between 0.0 and 1.0.
public func enableFlashlight(enabled: Bool, level torchLevel: Float)

V3.1.3

05 Jul 07:35
Compare
Choose a tag to compare

What’s new in the version: 3.1.3

New APIs.

  • Added missing suggarAdded nutrient in the PassioNutrients.

V3.1.1

18 Jun 10:06
Compare
Choose a tag to compare

What’s new in the version: 3.1.1

New APIs.

  • Added fetchHiddenIngredients, fetchVisualAlternatives and fetchPossibleIngredients APIs.
public func fetchHiddenIngredients(
    foodName: String,
    completion: @escaping NutritionAdvisorIngredientsResponse
)
public func fetchVisualAlternatives(
    foodName: String,
    completion: @escaping NutritionAdvisorIngredientsResponse
)
public func fetchPossibleIngredients(
    foodName: String,
    completion: @escaping NutritionAdvisorIngredientsResponse
)

Updated APIs.

  • Added new PassioImageResolution parameter to recognizeImageRemote API.
public func recognizeImageRemote(
    image: UIImage,
    resolution: PassioImageResolution = .res_512,
    message: String? = nil,
    completion: @escaping ([PassioAdvisorFoodInfo]) -> Void
)

V3.1.0-patch

22 May 08:44
Compare
Choose a tag to compare

V3.1.0-patch

  • Removed sdk V2 demo apps from Swift Package

V3.1.0

17 May 10:32
Compare
Choose a tag to compare

V3.1.0

  • Added Nutrition Advsior API
/// Use this method to configure Nutrition Advisor
/// - Parameters:
///   - licenceKey: Licence Key for configuration
///   - completion: NutritionAdvisorResult with sucess or error message
public func configure(licenceKey: String, completion: @escaping NutritionAdvisorStatus)
/// Initiate converstion with Nutrition Advisor
/// - Parameters:
///   - completion: NutritionAdvisorResult with sucess or error message
public func initConversation(completion: @escaping NutritionAdvisorStatus)
/// Use this method to send message to Nutrition Advisor
/// - Parameters:
///   - message: Message you want to send
///   - completion: NutritionAdvisor responds with a success or error response. If the response is successful, you will receive PassioAdvisorResponse containing food information.
public func sendMessage(message: String, completion: @escaping NutritionAdvisorResponse)
/// Use this method to send image to Nutrition Advisor
/// - Parameters:
///   - image: UIImage you want to send
///   - completion: NutritionAdvisor responds with a success or error response. If the response is successful, you will receive PassioAdvisorResponse containing food information.
public func sendImage(image: UIImage, completion: @escaping NutritionAdvisorResponse)
/// Use this method to fetch ingredients
/// - Parameters:
///   - advisorResponse: Pass PassioAdvisorResponse
///   - completion: NutritionAdvisor responds with a success or error response. If the response is successful, you will receive PassioAdvisorResponse containing food information.
public func fetchIngridients(from advisorResponse: PassioAdvisorResponse, completion: @escaping NutritionAdvisorResponse)
  • Refactored Nutrition Facts API
/// Use this function to detect Nutrition Facts via pointing the camera at Nutrition Facts
/// - Parameters:
///   - nutritionfactsDelegate: Add self to implement the NutritionFactsDelegate
///   - completion: success or failure of the startNutritionFactsDetection
func startNutritionFactsDetection(
    nutritionfactsDelegate: NutritionFactsDelegate?,
    capturingDeviceType: CapturingDeviceType = .defaultCapturing(),
    completion: @escaping (Bool) -> Void
)
  • Added fetchFoodItemLegacy API
/// Fetch PassioFoodItem for a v2 PassioID
/// - Parameter passioID: PassioID
/// - Parameter completion: Receive a closure with optional PassioFoodItem
public func fetchFoodItemLegacy(from passioID: PassioID, completion: @escaping (PassioFoodItem?) -> Void)

V3.0.5

16 May 11:02
Compare
Choose a tag to compare
  • Fixed XCFramework issue
  • Refactored PassioSearchNutritionPreview
public struct PassioSearchNutritionPreview: Codable {
    public var calories: Int
    public let carbs: Double
    public let fat: Double
    public let protein: Double
    public var servingUnit: String
    public var servingQuantity: Double
    public var weightUnit: String
    public var weightQuantity: Double
}
  • Added refCode as an attribute to the PassioFoodItem and PassioIngredient classes.
  • Added method to fetch a food item using just the refCode attribute
/// Lookup fetchFoodItem from RefCode
/// - Parameter RefCode: String
/// - Returns: PassioFoodItem
public func fetchFoodItemFor(refCode: String, completion: @escaping (PassioNutritionAISDK.PassioFoodItem?) -> Void)