Skip to content

Commit f76be13

Browse files
authored
Assistants pagination methods (#631)
1 parent b60d658 commit f76be13

File tree

73 files changed

+13180
-12301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+13180
-12301
lines changed

api/OpenAI.net8.0.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,39 +128,31 @@ public class AssistantClient {
128128
public virtual Task<ClientResult> GetAssistantAsync(string assistantId, RequestOptions options);
129129
public virtual Task<ClientResult<Assistant>> GetAssistantAsync(string assistantId, CancellationToken cancellationToken = default);
130130
public virtual CollectionResult<Assistant> GetAssistants(AssistantCollectionOptions options = null, CancellationToken cancellationToken = default);
131-
public virtual CollectionResult<Assistant> GetAssistants(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
132131
public virtual CollectionResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options);
133132
public virtual AsyncCollectionResult<Assistant> GetAssistantsAsync(AssistantCollectionOptions options = null, CancellationToken cancellationToken = default);
134-
public virtual AsyncCollectionResult<Assistant> GetAssistantsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
135133
public virtual AsyncCollectionResult GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options);
136134
public virtual ClientResult GetMessage(string threadId, string messageId, RequestOptions options);
137135
public virtual ClientResult<ThreadMessage> GetMessage(string threadId, string messageId, CancellationToken cancellationToken = default);
138136
public virtual Task<ClientResult> GetMessageAsync(string threadId, string messageId, RequestOptions options);
139137
public virtual Task<ClientResult<ThreadMessage>> GetMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default);
140-
public virtual CollectionResult<ThreadMessage> GetMessages(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
141138
public virtual CollectionResult<ThreadMessage> GetMessages(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default);
142139
public virtual CollectionResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options);
143-
public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
144140
public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default);
145141
public virtual AsyncCollectionResult GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options);
146142
public virtual ClientResult GetRun(string threadId, string runId, RequestOptions options);
147143
public virtual ClientResult<ThreadRun> GetRun(string threadId, string runId, CancellationToken cancellationToken = default);
148144
public virtual Task<ClientResult> GetRunAsync(string threadId, string runId, RequestOptions options);
149145
public virtual Task<ClientResult<ThreadRun>> GetRunAsync(string threadId, string runId, CancellationToken cancellationToken = default);
150-
public virtual CollectionResult<ThreadRun> GetRuns(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
151146
public virtual CollectionResult<ThreadRun> GetRuns(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default);
152147
public virtual CollectionResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options);
153-
public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
154148
public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default);
155149
public virtual AsyncCollectionResult GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options);
156150
public virtual ClientResult GetRunStep(string threadId, string runId, string stepId, RequestOptions options);
157151
public virtual ClientResult<RunStep> GetRunStep(string threadId, string runId, string stepId, CancellationToken cancellationToken = default);
158152
public virtual Task<ClientResult> GetRunStepAsync(string threadId, string runId, string stepId, RequestOptions options);
159153
public virtual Task<ClientResult<RunStep>> GetRunStepAsync(string threadId, string runId, string stepId, CancellationToken cancellationToken = default);
160-
public virtual CollectionResult<RunStep> GetRunSteps(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
161154
public virtual CollectionResult<RunStep> GetRunSteps(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default);
162155
public virtual CollectionResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options);
163-
public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
164156
public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default);
165157
public virtual AsyncCollectionResult GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options);
166158
public virtual ClientResult GetThread(string threadId, RequestOptions options);
@@ -189,11 +181,15 @@ public class AssistantClient {
189181
public virtual AsyncCollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreamingAsync(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default);
190182
}
191183
[Experimental("OPENAI001")]
192-
public class AssistantCollectionOptions {
184+
public class AssistantCollectionOptions : IJsonModel<AssistantCollectionOptions>, IPersistableModel<AssistantCollectionOptions> {
193185
public string AfterId { get; set; }
194186
public string BeforeId { get; set; }
195187
public AssistantCollectionOrder? Order { get; set; }
196188
public int? PageSizeLimit { get; set; }
189+
protected virtual AssistantCollectionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
190+
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
191+
protected virtual AssistantCollectionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
192+
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
197193
}
198194
[Experimental("OPENAI001")]
199195
public readonly partial struct AssistantCollectionOrder : IEquatable<AssistantCollectionOrder> {
@@ -207,6 +203,7 @@ public class AssistantCollectionOptions {
207203
public override readonly int GetHashCode();
208204
public static bool operator ==(AssistantCollectionOrder left, AssistantCollectionOrder right);
209205
public static implicit operator AssistantCollectionOrder(string value);
206+
public static implicit operator AssistantCollectionOrder?(string value);
210207
public static bool operator !=(AssistantCollectionOrder left, AssistantCollectionOrder right);
211208
public override readonly string ToString();
212209
}
@@ -369,11 +366,15 @@ public class FunctionToolDefinition : ToolDefinition, IJsonModel<FunctionToolDef
369366
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
370367
}
371368
[Experimental("OPENAI001")]
372-
public class MessageCollectionOptions {
369+
public class MessageCollectionOptions : IJsonModel<MessageCollectionOptions>, IPersistableModel<MessageCollectionOptions> {
373370
public string AfterId { get; set; }
374371
public string BeforeId { get; set; }
375372
public MessageCollectionOrder? Order { get; set; }
376373
public int? PageSizeLimit { get; set; }
374+
protected virtual MessageCollectionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
375+
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
376+
protected virtual MessageCollectionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
377+
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
377378
}
378379
[Experimental("OPENAI001")]
379380
public readonly partial struct MessageCollectionOrder : IEquatable<MessageCollectionOrder> {
@@ -387,6 +388,7 @@ public class MessageCollectionOptions {
387388
public override readonly int GetHashCode();
388389
public static bool operator ==(MessageCollectionOrder left, MessageCollectionOrder right);
389390
public static implicit operator MessageCollectionOrder(string value);
391+
public static implicit operator MessageCollectionOrder?(string value);
390392
public static bool operator !=(MessageCollectionOrder left, MessageCollectionOrder right);
391393
public override readonly string ToString();
392394
}
@@ -527,11 +529,15 @@ public class RequiredActionUpdate : RunUpdate {
527529
public ThreadRun GetThreadRun();
528530
}
529531
[Experimental("OPENAI001")]
530-
public class RunCollectionOptions {
532+
public class RunCollectionOptions : IJsonModel<RunCollectionOptions>, IPersistableModel<RunCollectionOptions> {
531533
public string AfterId { get; set; }
532534
public string BeforeId { get; set; }
533535
public RunCollectionOrder? Order { get; set; }
534536
public int? PageSizeLimit { get; set; }
537+
protected virtual RunCollectionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
538+
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
539+
protected virtual RunCollectionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
540+
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
535541
}
536542
[Experimental("OPENAI001")]
537543
public readonly partial struct RunCollectionOrder : IEquatable<RunCollectionOrder> {
@@ -545,6 +551,7 @@ public class RunCollectionOptions {
545551
public override readonly int GetHashCode();
546552
public static bool operator ==(RunCollectionOrder left, RunCollectionOrder right);
547553
public static implicit operator RunCollectionOrder(string value);
554+
public static implicit operator RunCollectionOrder?(string value);
548555
public static bool operator !=(RunCollectionOrder left, RunCollectionOrder right);
549556
public override readonly string ToString();
550557
}
@@ -684,11 +691,15 @@ public abstract class RunStepCodeInterpreterOutput : IJsonModel<RunStepCodeInter
684691
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
685692
}
686693
[Experimental("OPENAI001")]
687-
public class RunStepCollectionOptions {
694+
public class RunStepCollectionOptions : IJsonModel<RunStepCollectionOptions>, IPersistableModel<RunStepCollectionOptions> {
688695
public string AfterId { get; set; }
689696
public string BeforeId { get; set; }
690697
public RunStepCollectionOrder? Order { get; set; }
691698
public int? PageSizeLimit { get; set; }
699+
protected virtual RunStepCollectionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
700+
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
701+
protected virtual RunStepCollectionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
702+
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
692703
}
693704
[Experimental("OPENAI001")]
694705
public readonly partial struct RunStepCollectionOrder : IEquatable<RunStepCollectionOrder> {
@@ -702,6 +713,7 @@ public class RunStepCollectionOptions {
702713
public override readonly int GetHashCode();
703714
public static bool operator ==(RunStepCollectionOrder left, RunStepCollectionOrder right);
704715
public static implicit operator RunStepCollectionOrder(string value);
716+
public static implicit operator RunStepCollectionOrder?(string value);
705717
public static bool operator !=(RunStepCollectionOrder left, RunStepCollectionOrder right);
706718
public override readonly string ToString();
707719
}

0 commit comments

Comments
 (0)