Skip to content

Commit

Permalink
- Release version 3.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik7u committed Nov 14, 2024
1 parent 5b73992 commit a1190c6
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
],
targets: [
.binaryTarget(name: "PassioNutritionAISDK",
url: "https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution/raw/3.2.1/PassioNutritionAISDK.xcframework.zip",
checksum: "ef472088bac3b4a08214514c72f04877567e3358bb7e4a9e2495a8c94e5c243c")
url: "https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution/raw/3.2.2/PassioNutritionAISDK.xcframework.zip",
checksum: "f59814bad86518cf0067932e5854c16e1fa0f994f44f9130afa6300a9998ac1b")
]
)
Binary file modified PassioNutritionAISDK.xcframework.zip
Binary file not shown.
53 changes: 52 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Passio SDK Release Notes

## V3.2.2
### New APIs:

- Added semantic search API
```swift
/// 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
```swift
/// 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)

```

### Updated APIs:

- Change fetchTagsFor API to accept the refCode
```swift
/// Fetch the tags from the ref code
/// - Parameters:
/// - refCode: Reference code of food item
/// - completion: Tag as a list of strings
```

- Change fetchInflammatoryEffectData API to accept the refCode
```swift
/// Fetch the list of nutrients with their inflammatory score
/// - Parameters:
/// - refCode: Reference code of food item
/// - completion: List of `InflammatoryEffectData` objects
```

## V3.2.1
### New APIs:

Expand All @@ -16,7 +59,12 @@
- 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 PassioNutritionAISDK.PassioResult)
*/
```

- Submit User Created Food
Expand All @@ -25,6 +73,9 @@
/// - Parameters:
/// - item: Pass ``PassioFoodItem`` to sumbit it to Passio
/// - completion: You will receive ``PassioResult`` in completion.
public func submitUserCreatedFood(item: PassioNutritionAISDK.PassioFoodItem,
completion: @escaping PassioNutritionAISDK.PassioResult)

```

## V3.2.0
Expand Down
56 changes: 43 additions & 13 deletions SDK_API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PassioNutritionAISDK

## Version 3.2.0
## Version 3.2.2

```Swift
import AVFoundation
Expand All @@ -11,6 +11,7 @@ import CoreMedia
import CoreMotion
import DeveloperToolsSupport
import Foundation
import MLCompute
import Metal
import MetalPerformanceShaders
import SQLite3
Expand Down Expand Up @@ -542,6 +543,8 @@ extension IconSize : RawRepresentable {
/// InflammatoryEffectData for nutrients data
public struct InflammatoryEffectData : Codable {

public let foodName: String

public let name: String

public let amount: Double
Expand Down Expand Up @@ -1194,9 +1197,9 @@ public struct PassioConfiguration : Equatable {

public struct PassioFoodAmount : Codable {

public let servingSizes: [PassioNutritionAISDK.PassioServingSize]
public var servingSizes: [PassioNutritionAISDK.PassioServingSize]

public let servingUnits: [PassioNutritionAISDK.PassioServingUnit]
public var servingUnits: [PassioNutritionAISDK.PassioServingUnit]

public var selectedUnit: String

Expand Down Expand Up @@ -1310,6 +1313,14 @@ public struct PassioFoodItem : Codable {

public func ingredientWeight() -> Measurement<UnitMass>

@discardableResult
public mutating func setSelected(unit: String, quantity: Double) -> Bool

@discardableResult
public mutating func setSelectedUnit(_ unit: String) -> Bool

public mutating func setSelectedQuantity(_ quantity: Double)

/// Encodes this value into the given encoder.
///
/// If the value fails to encode anything, `encoder` will encode an empty
Expand Down Expand Up @@ -1562,6 +1573,8 @@ public struct PassioFoodOrigin : Codable, Equatable {

public var licenseCopy: String?

public init(id: String, source: String, licenseCopy: String? = nil)

/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
Expand Down Expand Up @@ -1938,7 +1951,7 @@ public struct PassioIngredient : Codable {

public var amount: PassioNutritionAISDK.PassioFoodAmount

public let referenceNutrients: PassioNutritionAISDK.PassioNutrients
public var referenceNutrients: PassioNutritionAISDK.PassioNutrients

public var metadata: PassioNutritionAISDK.PassioFoodMetadata

Expand All @@ -1952,6 +1965,8 @@ public struct PassioIngredient : Codable {

public func weight() -> Measurement<UnitMass>

public mutating func setFoodIngredientServing(unit: String, quantity: Double) -> Bool

/// Encodes this value into the given encoder.
///
/// If the value fails to encode anything, `encoder` will encode an empty
Expand Down Expand Up @@ -2426,6 +2441,8 @@ public class PassioNutritionAI {

case four

case max

/// Creates a new instance with the specified raw value.
///
/// If there is no value of the type that corresponds with the specified raw
Expand Down Expand Up @@ -2576,6 +2593,12 @@ public class PassioNutritionAI {
/// - completion: ``SearchResponse``, which containts list of alternate search and its results
public func searchForFood(byText: String, completion: @escaping (PassioNutritionAISDK.SearchResponse?) -> Void)

/// 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)

/// Fetch ``PassioFoodItem`` for given ``PassioFoodDataInfo`` and servingQuantity and servingUnit.
/// - Parameters:
/// - foodDataInfo: ``PassioFoodDataInfo``
Expand Down Expand Up @@ -2634,17 +2657,17 @@ public class PassioNutritionAI {
/// - Returns: Optional URL
public func iconURLFor(passioID: PassioNutritionAISDK.PassioID, size: PassioNutritionAISDK.IconSize = IconSize.px90) -> URL?

/// Beta API/Function
/// Fetch the tags from the ref code
/// - Parameters:
/// - passioID: passioID
/// - completion: tag as a list of strings.
public func fetchTagsFor(passioID: PassioNutritionAISDK.PassioID, completion: @escaping ([String]?) -> Void)
/// - refCode: Reference code of food item
/// - completion: Tag as a list of strings
public func fetchTagsFor(refCode: String, completion: @escaping ([String]?) -> Void)

/// Returns fetchNutrientsFor
/// Fetch the list of nutrients with their inflammatory score
/// - Parameters:
/// - passioID: passioID
/// - completion: tag as a list of strings.
public func fetchInflammatoryEffectData(passioID: PassioNutritionAISDK.PassioID, completion: @escaping ([PassioNutritionAISDK.InflammatoryEffectData]?) -> Void)
/// - refCode: Reference code of food item
/// - completion: List of `InflammatoryEffectData` objects
public func fetchInflammatoryEffectData(refCode: String, completion: @escaping ([PassioNutritionAISDK.InflammatoryEffectData]?) -> Void)

/// Return a sorted list of available Volume Detections mode.
/// Recommended mode is .auto
Expand Down Expand Up @@ -2696,6 +2719,12 @@ public class PassioNutritionAI {
/// - completion: ``NutritionAdvisorIngredientsResponse``, NutritionAdvisor 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 fetchPossibleIngredients(foodName: String, completion: @escaping PassioNutritionAISDK.NutritionAdvisorIngredientsResponse)

/// 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)

/// Use this method for scanning nutrients from Packaged Product. This method returns ``PassioFoodItem``.
/// - Parameters:
/// - image: Image for detecting nutrients
Expand Down Expand Up @@ -2971,6 +3000,8 @@ extension PassioNutritionFacts.ServingSizeUnit : Hashable {
extension PassioNutritionFacts.ServingSizeUnit : RawRepresentable {
}

public typealias PassioPredictedIngredients = (Result<[PassioNutritionAISDK.PassioAdvisorFoodInfo], PassioNutritionAISDK.NetworkError>) -> Void

public typealias PassioResult = (Result<Bool, PassioNutritionAISDK.NetworkError>) -> Void

/// PassioSDKError will return the error with errorDescription if the configuration has failed.
Expand Down Expand Up @@ -3973,5 +4004,4 @@ infix operator .+ : DefaultPrecedence

infix operator ./ : DefaultPrecedence


```

0 comments on commit a1190c6

Please sign in to comment.