Class GenerateSqlClient
Service client instance for GenerateSql.
Implements
Inherited Members
Namespace: Oci.GenerativeaidataService
Assembly: OCI.DotNetSDK.Generativeaidata.dll
Syntax
public class GenerateSqlClient : RegionalClientBase, IDisposable
Constructors
GenerateSqlClient(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 GenerateSqlClient(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. |
Properties
Waiters
Declaration
public GenerateSqlWaiters Waiters { get; }
Property Value
| Type | Description |
|---|---|
| GenerateSqlWaiters |
Methods
GenerateSqlFromNl(GenerateSqlFromNlRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Generates a SQL query from a natural language input for the specified SemanticStore. <br/> This operation creates a GenerateSqlFromNlJob. The request can either be processed as a background job or wait for completion, depending on completionMode. <br/> If modelId is provided, the service validates it and uses it for schema-linking in table selection, SQL generation, and SQL refinement. If modelId is omitted, the service default model is used. The response includes the modelId used for generation. <br/> Clients should inspect lifecycleState in the response:
- If lifecycleState is SUCCEEDED, SQL generation is complete and the result is available in jobOutput.
- If lifecycleState is ACCEPTED or IN_PROGRESS, poll GetGenerateSqlFromNlJob using the returned job id.
- If lifecycleState is FAILED or CANCELED, SQL generation did not complete. See lifecycleDetails for more information. <br/> The GetGenerateSqlFromNlJob endpoint is the source of truth for final job state and result availability.
Declaration
public Task<GenerateSqlFromNlResponse> GenerateSqlFromNl(GenerateSqlFromNlRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
| Type | Name | Description |
|---|---|---|
| GenerateSqlFromNlRequest | 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<GenerateSqlFromNlResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use GenerateSqlFromNl API.
GetGenerateSqlFromNlJob(GetGenerateSqlFromNlJobRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Retrieves the current state of a GenerateSqlFromNlJob. Clients should poll this endpoint until lifecycleState is SUCCEEDED or FAILED. When lifecycleState is SUCCEEDED, the result is available in jobOutput. The returned job includes the modelId used for generation.
Declaration
public Task<GetGenerateSqlFromNlJobResponse> GetGenerateSqlFromNlJob(GetGenerateSqlFromNlJobRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
| Type | Name | Description |
|---|---|---|
| GetGenerateSqlFromNlJobRequest | 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<GetGenerateSqlFromNlJobResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use GetGenerateSqlFromNlJob API.