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
16 changes: 8 additions & 8 deletions src/libs/Replicate/Generated/JsonSerializerContextTypes.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,35 +114,35 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::Replicate.AccountGetResponse? Type22 { get; set; }
public global::System.DateTime? Type22 { get; set; }
/// <summary>
///
/// </summary>
public global::Replicate.AccountGetResponseType? Type23 { get; set; }
public global::Replicate.AccountGetResponse? Type23 { get; set; }
/// <summary>
///
/// </summary>
public global::Replicate.DeploymentsListResponse? Type24 { get; set; }
public global::Replicate.AccountGetResponseType? Type24 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::Replicate.DeploymentsListResponseResult>? Type25 { get; set; }
public global::Replicate.DeploymentsListResponse? Type25 { get; set; }
/// <summary>
///
/// </summary>
public global::Replicate.DeploymentsListResponseResult? Type26 { get; set; }
public global::System.Collections.Generic.IList<global::Replicate.DeploymentsListResponseResult>? Type26 { get; set; }
/// <summary>
///
/// </summary>
public global::Replicate.DeploymentsListResponseResultCurrentRelease? Type27 { get; set; }
public global::Replicate.DeploymentsListResponseResult? Type27 { get; set; }
/// <summary>
///
/// </summary>
public global::Replicate.DeploymentsListResponseResultCurrentReleaseConfiguration? Type28 { get; set; }
public global::Replicate.DeploymentsListResponseResultCurrentRelease? Type28 { get; set; }
/// <summary>
///
/// </summary>
public global::System.DateTime? Type29 { get; set; }
public global::Replicate.DeploymentsListResponseResultCurrentReleaseConfiguration? Type29 { get; set; }
/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ public partial interface IReplicateApi
/// `version` will be the unique ID of model version used to create the prediction.<br/>
/// `data_removed` will be `true` if the input and output data has been deleted.
/// </summary>
/// <param name="createdAfter"></param>
/// <param name="createdBefore"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Replicate.ApiException"></exception>
global::System.Threading.Tasks.Task PredictionsListAsync(
global::System.DateTime? createdAfter = default,
global::System.DateTime? createdBefore = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ namespace Replicate
public partial class ReplicateApi
{
partial void PreparePredictionsListArguments(
global::System.Net.Http.HttpClient httpClient);
global::System.Net.Http.HttpClient httpClient,
ref global::System.DateTime? createdAfter,
ref global::System.DateTime? createdBefore);
partial void PreparePredictionsListRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage);
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::System.DateTime? createdAfter,
global::System.DateTime? createdBefore);
partial void ProcessPredictionsListResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand Down Expand Up @@ -64,19 +68,29 @@ partial void ProcessPredictionsListResponse(
/// `version` will be the unique ID of model version used to create the prediction.<br/>
/// `data_removed` will be `true` if the input and output data has been deleted.
/// </summary>
/// <param name="createdAfter"></param>
/// <param name="createdBefore"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Replicate.ApiException"></exception>
public async global::System.Threading.Tasks.Task PredictionsListAsync(
global::System.DateTime? createdAfter = default,
global::System.DateTime? createdBefore = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
PreparePredictionsListArguments(
httpClient: HttpClient);
httpClient: HttpClient,
createdAfter: ref createdAfter,
createdBefore: ref createdBefore);

var __pathBuilder = new PathBuilder(
path: "/predictions",
baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("created_after", createdAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ"))
.AddOptionalParameter("created_before", createdBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ"))
;
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
Expand Down Expand Up @@ -107,7 +121,9 @@ partial void ProcessPredictionsListResponse(
request: __httpRequest);
PreparePredictionsListRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest);
httpRequestMessage: __httpRequest,
createdAfter: createdAfter,
createdBefore: createdBefore);

using var __response = await HttpClient.SendAsync(
request: __httpRequest,
Expand Down
15 changes: 15 additions & 0 deletions src/libs/Replicate/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,21 @@ paths:
summary: List predictions
description: "Get a paginated list of all predictions created by the user or organization associated with the provided API token.\n\nThis will include predictions created from the API and the website. It will return 100 records per page.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/predictions\n```\n\nThe response will be a paginated JSON array of prediction objects, sorted with the most recent prediction first:\n\n```json\n{\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"completed_at\": \"2023-09-08T16:19:34.791859Z\",\n \"created_at\": \"2023-09-08T16:19:34.907244Z\",\n \"data_removed\": false,\n \"error\": null,\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"metrics\": {\n \"predict_time\": 0.012683\n },\n \"output\": \"hello Alice\",\n \"started_at\": \"2023-09-08T16:19:34.779176Z\",\n \"source\": \"api\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\"\n },\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n }\n ]\n}\n```\n\n`id` will be the unique ID of the prediction.\n\n`source` will indicate how the prediction was created. Possible values are `web` or `api`.\n\n`status` will be the status of the prediction. Refer to [get a single prediction](#predictions.get) for possible values.\n\n`urls` will be a convenience object that can be used to construct new API requests for the given prediction. If the requested model version supports streaming, this will have a `stream` entry with an HTTPS URL that you can use to construct an [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource).\n\n`model` will be the model identifier string in the format of `{model_owner}/{model_name}`.\n\n`version` will be the unique ID of model version used to create the prediction.\n\n`data_removed` will be `true` if the input and output data has been deleted.\n"
operationId: predictions.list
parameters:
- name: created_after
in: query
description: 'Include only predictions created at or after this date-time, in ISO 8601 format.'
schema:
type: string
format: date-time
example: '2025-01-01T00:00:00.0000000+00:00'
- name: created_before
in: query
description: 'Include only predictions created before this date-time, in ISO 8601 format.'
schema:
type: string
format: date-time
example: '2025-02-01T00:00:00.0000000+00:00'
responses:
'200':
description: Success
Expand Down