DefaultSupportedTypes
: override InferenceType
[Get] |
Signature
override InferenceType DefaultSupportedTypes |
SupportsVision
: bool
[Get] |
Indicates whether this provider prepares and sends image inputs for supported multimodal models.
Disable for pure-text models to reduce request overhead and validation checks.
See IChatTask and your model's capabilities on the provider dashboard.
Signature
bool SupportsVision |
ChatAsync
(
req
, stream
, ct
)
|
Sends a chat turn to a Hugging Face Inference endpoint and returns assistant text.
Supports optional image inputs when the selected model is multimodal.
See IChatTask. HF Inference: https://huggingface.co/docs/api-inference/index
Signature
async Task< ChatResponse > ChatAsync(ChatRequest req, IProgress< ChatDelta > stream=null, CancellationToken ct=default) Parameters stream: IProgress< ChatDelta >
Optional progress receiver for partial tokens; final text is always delivered.
ct: CancellationToken
Cancellation token for request assembly and HTTP.
|
DetectAsync
(
imageJpgOrPng
, ct
)
|
Runs object detection using a Hugging Face model and returns structured detections.
Handles tensor or JSON outputs depending on the model’s task definition.
See IObjectDetectionTask. HF Tasks: https://huggingface.co/docs/inference-providers/tasks/object-detection
Signature
async Task< string > DetectAsync(byte[] imageJpgOrPng, CancellationToken ct=default) Parameters imageJpgOrPng: byte[]
Encoded image data (e.g., JPG/PNG). Must be non-empty.
ct: CancellationToken
Cancellation token to abort pre-processing or HTTP.
Returns async Task< string >
Normalized detection set (boxes, scores, class ids) for downstream visualization.
|
DetectAsync
(
src
, ct
)
|
Performs object detection on a RenderTexture by encoding it to JPEG and calling the byte[] overload.
This provides compatibility with the IObjectDetectionTask interface while adapting to cloud providers.
Signature
async Task< byte[]> DetectAsync(RenderTexture src, CancellationToken ct=default) Parameters src: RenderTexture
Source RenderTexture to analyze.
ct: CancellationToken
Cancellation token for aborting the operation.
Returns async Task< byte[]>
UTF-8 encoded JSON string as byte array containing detection results.
|