Table of Contents

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

model string

The model identifier for the request.

task string

The task associated with the request.

apiKey string

The API key used for authentication.

stream bool

A value indicating whether the request should use streaming.

baseUrl string

The base URL for the API endpoint.

version string

The 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

string

BaseUrl

Gets or sets the base URL for the API endpoint.

public string BaseUrl { get; set; }

Property Value

string

Model

Gets or sets the model identifier for the request.

public string Model { get; set; }

Property Value

string

Stream

Gets or sets a value indicating whether the request should use streaming.

public bool Stream { get; set; }

Property Value

bool

Task

Gets or sets the task associated with the request.

public string Task { get; set; }

Property Value

string

Version

Gets or sets the version of the API to be used.

public string Version { get; set; }

Property Value

string

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

apiKey string

The 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

d RequestUrl

The RequestUrl instance.

Returns

string