Functions§
- content_
to_ provider_ value - Convert Content into a JSON value suitable for generic providers.
- health_
check - Simple health check helper for provider base URLs. Tries to GET {base_url}/models (common OpenAI-compatible endpoint) or the base URL and returns Ok(()) if reachable and returns an AiLibError otherwise.
- upload_
file_ inline - Upload or inline a local file path; current default behavior is to inline as data URL Returns a data URL string if successful, or None on failure.
- upload_
file_ to_ provider - Upload a local file to the provider’s upload endpoint using multipart/form-data.
This function is conservative: it only attempts an upload when an
upload_url
is provided. Returns the provider-hosted file URL on success. - upload_
file_ with_ transport - Upload a file using an injected transport if available.
If
transport
is Some, it will be used to post a multipart form. Otherwise, falls back toupload_file_to_provider
which constructs its own client.