Class RequestUrl
- Namespace
- GenerativeAI.Core
- Assembly
- GenerativeAI.dll
Represents a request URL for interacting with a generative AI service.
public class RequestUrl
- Inheritance
-
RequestUrl
- Inherited Members
- Extension Methods
Constructors
RequestUrl(string, string, string, bool, string, string)
Initializes a new instance of the RequestUrl class with the specified parameters.
public RequestUrl(string model, string task, string apiKey, bool stream, string baseUrl, string version = "v1")
Parameters
modelstringThe model identifier for the request.
taskstringThe task associated with the request.
apiKeystringThe API key used for authentication.
streamboolA value indicating whether the request should use streaming.
baseUrlstringThe base URL for the API endpoint.
versionstringThe version of the API to be used. Defaults to "v1".
Properties
ApiKey
Gets or sets the API key used for authentication.
public string ApiKey { get; set; }
Property Value
BaseUrl
Gets or sets the base URL for the API endpoint.
public string BaseUrl { get; set; }
Property Value
Model
Gets or sets the model identifier for the request.
public string Model { get; set; }
Property Value
Stream
Gets or sets a value indicating whether the request should use streaming.
public bool Stream { get; set; }
Property Value
Task
Gets or sets the task associated with the request.
public string Task { get; set; }
Property Value
Version
Gets or sets the version of the API to be used.
public string Version { get; set; }
Property Value
Methods
ToString()
Converts the request data to its string representation, with a placeholder for the API key.
public override string ToString()
Returns
- string
The string representation of the request URL.
ToString(string)
Converts the request data to its string representation, using the specified API key.
public string ToString(string apiKey)
Parameters
apiKeystringThe API key to include in the URL.
Returns
- string
The string representation of the request URL.
Operators
implicit operator string(RequestUrl)
Defines an implicit conversion from a RequestUrl instance to its string representation.
public static implicit operator string(RequestUrl d)
Parameters
dRequestUrlThe RequestUrl instance.