|
|
|
@@ -27,7 +27,7 @@ namespace LLama.Abstractions |
|
|
|
/// <summary> |
|
|
|
/// List of images: Image filen path, uri or image byte array. See ImageData. |
|
|
|
/// </summary> |
|
|
|
public List<byte[]> Images { get; } |
|
|
|
public List<ImageData> Images { get; } |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Asynchronously infers a response from the model. |
|
|
|
@@ -38,4 +38,46 @@ namespace LLama.Abstractions |
|
|
|
/// <returns></returns> |
|
|
|
IAsyncEnumerable<string> InferAsync(string text, IInferenceParams? inferenceParams = null, CancellationToken token = default); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Holds image data |
|
|
|
/// </summary> |
|
|
|
public class ImageData |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// constructor |
|
|
|
/// </summary> |
|
|
|
/// <param name="type"></param> |
|
|
|
/// <param name="data"></param> |
|
|
|
public ImageData(DataType type, object data) { Type = type; Data = data; } |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// the possible types of image data |
|
|
|
/// </summary> |
|
|
|
public enum DataType |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// file path |
|
|
|
/// </summary> |
|
|
|
ImagePath, |
|
|
|
/// <summary> |
|
|
|
/// byte array |
|
|
|
/// </summary> |
|
|
|
ImageBytes, |
|
|
|
/// <summary> |
|
|
|
/// uri |
|
|
|
/// </summary> |
|
|
|
ImageURL |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// the type of this image data |
|
|
|
/// </summary> |
|
|
|
public DataType Type { get; set; } |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// the image data (string, byte array or uri) |
|
|
|
/// </summary> |
|
|
|
public object? Data { get; set; } |
|
|
|
} |
|
|
|
} |