Class GenerativeAiInferenceClient
Service client instance for GenerativeAiInference.
Implements
Inherited Members
Namespace: Oci.GenerativeaiinferenceService
Assembly: OCI.DotNetSDK.Generativeaiinference.dll
Syntax
public class GenerativeAiInferenceClient : RegionalClientBase, IDisposable
Constructors
GenerativeAiInferenceClient(IBasicAuthenticationDetailsProvider, ClientConfiguration, string)
Creates a new service instance using the given authentication provider and/or client configuration and/or endpoint. A client configuration can also be provided optionally to adjust REST client behaviors.
Declaration
public GenerativeAiInferenceClient(IBasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration clientConfiguration = null, string endpoint = null)
Parameters
Type | Name | Description |
---|---|---|
IBasicAuthenticationDetailsProvider | authenticationDetailsProvider | The authentication details provider. Required. |
ClientConfiguration | clientConfiguration | The client configuration that contains settings to adjust REST client behaviors. Optional. |
string | endpoint | The endpoint of the service. If not provided and the client is a regional client, the endpoint will be constructed based on region information. Optional. |
Methods
Chat(ChatRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Creates a response for the given conversation.
Declaration
public Task<ChatResponse> Chat(ChatRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
ChatRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<ChatResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use Chat API.
EmbedText(EmbedTextRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Produces embeddings for the inputs. <br/> An embedding is numeric representation of a piece of text. This text can be a phrase, a sentence, or one or more paragraphs. The Generative AI embedding model transforms each phrase, sentence, or paragraph that you input, into an array with 1024 numbers. You can use these embeddings for finding similarity in your input text such as finding phrases that are similar in context or category. Embeddings are mostly used for semantic searches where the search function focuses on the meaning of the text that it's searching through rather than finding results based on keywords.
Declaration
public Task<EmbedTextResponse> EmbedText(EmbedTextRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
EmbedTextRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<EmbedTextResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use EmbedText API.
GenerateText(GenerateTextRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Generates a text response based on the user prompt.
Declaration
public Task<GenerateTextResponse> GenerateText(GenerateTextRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
GenerateTextRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<GenerateTextResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use GenerateText API.
SummarizeText(SummarizeTextRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Summarizes the input text.
Declaration
public Task<SummarizeTextResponse> SummarizeText(SummarizeTextRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
SummarizeTextRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<SummarizeTextResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use SummarizeText API.