Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public partial interface IResembleAIClient : global::System.IDisposable
/// </summary>
public TermSubstitutionsClient TermSubstitutions { get; }

/// <summary>
///
/// </summary>
public TextDetectionClient TextDetection { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#nullable enable

namespace ResembleAI
{
public partial interface ITextDetectionClient
{
/// <summary>
/// Authorize using bearer authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingBearer(
string apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#nullable enable

namespace ResembleAI
{
public partial interface ITextDetectionClient
{
/// <summary>
/// Detect AI-generated text<br/>
/// Submit a passage of text and classify it as AI-generated or human-written.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`,<br/>
/// and you can poll `GET /text_detect/{uuid}` or supply a `callback_url` to be notified. Send the<br/>
/// `Prefer: wait` header to block until the verdict is available and receive the completed item in the<br/>
/// same response. Allow a generous client timeout when waiting, since the first request after a period<br/>
/// of inactivity can take several minutes while the model warms up.<br/>
/// Requests are rejected with a 400 when `text` is missing, exceeds 100,000 characters, or contains<br/>
/// fewer than 25 words. Each successfully scored request bills one Text Detection unit; abstained<br/>
/// (`uncertain`) results are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.TextDetectResponse> CreateTextDetectionAsync(

global::ResembleAI.TextDetectRequest request,
global::ResembleAI.TextDetectPostParametersPrefer? prefer = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Detect AI-generated text<br/>
/// Submit a passage of text and classify it as AI-generated or human-written.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`,<br/>
/// and you can poll `GET /text_detect/{uuid}` or supply a `callback_url` to be notified. Send the<br/>
/// `Prefer: wait` header to block until the verdict is available and receive the completed item in the<br/>
/// same response. Allow a generous client timeout when waiting, since the first request after a period<br/>
/// of inactivity can take several minutes while the model warms up.<br/>
/// Requests are rejected with a 400 when `text` is missing, exceeds 100,000 characters, or contains<br/>
/// fewer than 25 words. Each successfully scored request bills one Text Detection unit; abstained<br/>
/// (`uncertain`) results are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.AutoSDKHttpResponse<global::ResembleAI.TextDetectResponse>> CreateTextDetectionAsResponseAsync(

global::ResembleAI.TextDetectRequest request,
global::ResembleAI.TextDetectPostParametersPrefer? prefer = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Detect AI-generated text<br/>
/// Submit a passage of text and classify it as AI-generated or human-written.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`,<br/>
/// and you can poll `GET /text_detect/{uuid}` or supply a `callback_url` to be notified. Send the<br/>
/// `Prefer: wait` header to block until the verdict is available and receive the completed item in the<br/>
/// same response. Allow a generous client timeout when waiting, since the first request after a period<br/>
/// of inactivity can take several minutes while the model warms up.<br/>
/// Requests are rejected with a 400 when `text` is missing, exceeds 100,000 characters, or contains<br/>
/// fewer than 25 words. Each successfully scored request bills one Text Detection unit; abstained<br/>
/// (`uncertain`) results are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="text">
/// The text to analyze. Must contain at least 25 words (whitespace-delimited) and at most 100,000 characters. Shorter passages are rejected with a 400 because no threshold reliably separates casual human writing from AI-generated text below that length.
/// </param>
/// <param name="thinking">
/// How much reasoning effort the detector spends on the passage. Higher levels can improve accuracy on ambiguous text at the cost of latency.<br/>
/// Default Value: low
/// </param>
/// <param name="threshold">
/// Probability cutoff used to turn the AI-likelihood score into the `ai` or `human` prediction. Scores at or above the threshold are reported as `ai`.
/// </param>
/// <param name="callbackUrl">
/// POST destination for the result once processing finishes. The body matches the response of `GET /text_detect/{uuid}` with an additional top-level `error` field when analysis failed.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.TextDetectResponse> CreateTextDetectionAsync(
string text,
global::ResembleAI.TextDetectPostParametersPrefer? prefer = default,
global::ResembleAI.TextDetectRequestThinking? thinking = default,
double? threshold = default,
string? callbackUrl = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#nullable enable

namespace ResembleAI
{
public partial interface ITextDetectionClient
{
/// <summary>
/// Get text detection<br/>
/// Retrieve a text detection by UUID. Poll this endpoint until `status` is `completed` or `failed`.
/// </summary>
/// <param name="uuid"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.TextDetectResponse> GetTextDetectionAsync(
string uuid,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get text detection<br/>
/// Retrieve a text detection by UUID. Poll this endpoint until `status` is `completed` or `failed`.
/// </summary>
/// <param name="uuid"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.AutoSDKHttpResponse<global::ResembleAI.TextDetectResponse>> GetTextDetectionAsResponseAsync(
string uuid,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#nullable enable

namespace ResembleAI
{
public partial interface ITextDetectionClient
{
/// <summary>
/// List text detections<br/>
/// Retrieve a paginated list of text detections for the authenticated user's team, newest first.
/// </summary>
/// <param name="page"></param>
/// <param name="pageSize">
/// Default Value: 10
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.TextDetectListResponse> ListTextDetectionsAsync(
int page,
int? pageSize = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// List text detections<br/>
/// Retrieve a paginated list of text detections for the authenticated user's team, newest first.
/// </summary>
/// <param name="page"></param>
/// <param name="pageSize">
/// Default Value: 10
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.AutoSDKHttpResponse<global::ResembleAI.TextDetectListResponse>> ListTextDetectionsAsResponseAsync(
int page,
int? pageSize = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
48 changes: 48 additions & 0 deletions src/libs/ResembleAI/Generated/ResembleAI.ITextDetectionClient.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#nullable enable

namespace ResembleAI
{
/// <summary>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public partial interface ITextDetectionClient : global::System.IDisposable
{
/// <summary>
/// The HttpClient instance.
/// </summary>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <summary>
/// The base URL for the API.
/// </summary>
public System.Uri? BaseUri { get; }

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
public global::System.Collections.Generic.List<global::ResembleAI.EndPointAuthorization> Authorizations { get; }

/// <summary>
/// Gets or sets a value indicating whether the response content should be read as a string.
/// True by default in debug builds, false otherwise.
/// When false, successful responses are deserialized directly from the response stream for better performance.
/// Error responses are always read as strings regardless of this setting,
/// ensuring <see cref="ApiException.ResponseBody"/> is populated.
/// </summary>
public bool ReadResponseAsString { get; set; }
/// <summary>
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// </summary>
public global::ResembleAI.AutoSDKClientOptions Options { get; }


/// <summary>
///
/// </summary>
global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace ResembleAI.JsonConverters
{
/// <inheritdoc />
public sealed class TextDetectItemPredictionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::ResembleAI.TextDetectItemPrediction>
{
/// <inheritdoc />
public override global::ResembleAI.TextDetectItemPrediction Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::ResembleAI.TextDetectItemPredictionExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::ResembleAI.TextDetectItemPrediction)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::ResembleAI.TextDetectItemPrediction);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::ResembleAI.TextDetectItemPrediction value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::ResembleAI.TextDetectItemPredictionExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace ResembleAI.JsonConverters
{
/// <inheritdoc />
public sealed class TextDetectItemPredictionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::ResembleAI.TextDetectItemPrediction?>
{
/// <inheritdoc />
public override global::ResembleAI.TextDetectItemPrediction? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::ResembleAI.TextDetectItemPredictionExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::ResembleAI.TextDetectItemPrediction)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::ResembleAI.TextDetectItemPrediction?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::ResembleAI.TextDetectItemPrediction? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::ResembleAI.TextDetectItemPredictionExtensions.ToValueString(value.Value));
}
}
}
}
Loading
Loading