Algorithm

public class Algorithm

Represents an Algorithmia algorithm that can be called

  • Set option

    Declaration

    Swift

    public func setOption(_ option:AlgoOption) -> Self

    Parameters

    option

    option to set, eg. timeout, stdout, output

    Return Value

    Algorithm object

  • Set timeout option for algorithm

    Declaration

    Swift

    public func set(timeout:Int) -> Self

    Parameters

    timeout

    timeout for algorithm

    Return Value

    Algorithm object

  • Undocumented

    Declaration

    Swift

    public class Algorithm
  • Calls the Alogirhtmia API for given input

    Declaration

    Swift

    @discardableResult public func pipe(text:String!, completion:@escaping AlgoCompletionHandler) -> AlgoRequest?

    Parameters

    text

    algorithm text input

    completion

    completion handler, return response and error. For output, check getText(), getJson(), getData() in AlgoResponse object.

    Return Value

    Request object

  • Calls the Alogirhtmia API for given input

    Declaration

    Swift

    @discardableResult public func pipe(json:Any!, completion:@escaping AlgoCompletionHandler) -> AlgoRequest?

    Parameters

    text

    algorithm json input, can be Any which is serializable in Json - eg. Array, Dictionary

    completion

    completion handler, return response and error. For output, check getText(), getJson(), getData() in AlgoResponse object.

    Return Value

    Request object

  • Calls the Alogirhtmia API for given input

    Declaration

    Swift

    @discardableResult public func pipe(rawJson:String!, completion:@escaping AlgoCompletionHandler) -> AlgoRequest?

    Parameters

    rawJson

    algorithm raw json input, eg. [alice,json]

    completion

    completion handler, return response and error. For output, check getText(), getJson(), getData() in AlgoResponse object.

    Return Value

    Request object

  • Calls the Alogirhtmia API for given input

    Declaration

    Swift

    @discardableResult public func pipe(data:Data!, completion:@escaping AlgoCompletionHandler) -> AlgoRequest?

    Parameters

    data

    algorithm binary input, Data

    completion

    completion handler, return response and error. For output, check getText(), getJson(), getData() in AlgoResponse object.

    Return Value

    Request object