ApiBase Class

Base class for handling API requests and responses.

Definition

Namespace: GenerativeAI.Core
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public abstract class ApiBase
Inheritance
Object    ApiBase
Derived

Constructors

ApiBase Initializes a new instance of the ApiBase class.

Properties

HttpClient 
Logger 
SerializerOptions JSON serialization options used for API requests and responses.

Methods

AddAuthorizationHeader Adds authorization headers to an HTTP request.
CheckAndHandleErrors 
DeleteAsync Sends a DELETE request to the specified URL.
DeserializeT(HttpResponseMessage) Deserializes a JSON string into an object of the specified type.
DeserializeT(String) Deserializes a JSON string into an object of the specified type.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetAsyncT Sends a GET request to the specified URL.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
SendAsyncTRequest, TResponse Sends an HTTP request (e.g., POST, PUT, or PATCH) to the specified URL.
StreamAsyncTRequest, TResponse Streams responses by sending an HTTP request with a JSON payload and yielding the deserialized items as they arrive.
ToStringReturns a string that represents the current object.
(Inherited from Object)
UploadFileWithProgressAsync(String, String, ActionDouble, DictionaryString, String, CancellationToken) Uploads a file to the specified URL with progress reporting.
UploadFileWithProgressAsync(Stream, String, String, String, ActionDouble, DictionaryString, String, CancellationToken) 

See Also