Skip to content

Commit f60acb4

Browse files
authored
[AI] [Projects] Add sample for GetThreads API (Azure#49440)
* [AI] [Projects] Add sample for GetThreads API * correct sample auth class
1 parent 3eed9f6 commit f60acb4

11 files changed

+59
-111
lines changed

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,8 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG
279279
public virtual Azure.Response<Azure.AI.Projects.AgentThread> GetThread(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
280280
public virtual System.Threading.Tasks.Task<Azure.Response> GetThreadAsync(string threadId, Azure.RequestContext context) { throw null; }
281281
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.AgentThread>> GetThreadAsync(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
282-
public virtual Azure.Response<Azure.AI.Projects.OpenAIPageableListOfAgentThread> GetThreads(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
283-
public virtual Azure.Response GetThreads(int? limit, string order, string after, string before, Azure.RequestContext context) { throw null; }
284-
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.OpenAIPageableListOfAgentThread>> GetThreadsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
285-
public virtual System.Threading.Tasks.Task<Azure.Response> GetThreadsAsync(int? limit, string order, string after, string before, Azure.RequestContext context) { throw null; }
282+
public virtual Azure.Response<Azure.AI.Projects.PageableList<Azure.AI.Projects.AgentThread>> GetThreads(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
283+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.PageableList<Azure.AI.Projects.AgentThread>>> GetThreadsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
286284
public virtual Azure.Response GetVectorStore(string vectorStoreId, Azure.RequestContext context) { throw null; }
287285
public virtual Azure.Response<Azure.AI.Projects.VectorStore> GetVectorStore(string vectorStoreId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
288286
public virtual System.Threading.Tasks.Task<Azure.Response> GetVectorStoreAsync(string vectorStoreId, Azure.RequestContext context) { throw null; }
@@ -521,7 +519,6 @@ public static partial class AIProjectsModelFactory
521519
public static Azure.AI.Projects.MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null) { throw null; }
522520
public static Azure.AI.Projects.MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, Azure.AI.Projects.MessageTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; }
523521
public static Azure.AI.Projects.MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) { throw null; }
524-
public static Azure.AI.Projects.OpenAIPageableListOfAgentThread OpenAIPageableListOfAgentThread(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject @object = default(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject), System.Collections.Generic.IEnumerable<Azure.AI.Projects.AgentThread> data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; }
525522
public static Azure.AI.Projects.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; }
526523
public static Azure.AI.Projects.ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType type = default(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType), Azure.AI.Projects.ResponseFormatJsonSchema jsonSchema = null) { throw null; }
527524
public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; }
@@ -1704,38 +1701,6 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write
17041701
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.MicrosoftFabricToolDefinition>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
17051702
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.MicrosoftFabricToolDefinition>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
17061703
}
1707-
public partial class OpenAIPageableListOfAgentThread : System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>
1708-
{
1709-
internal OpenAIPageableListOfAgentThread() { }
1710-
public System.Collections.Generic.IReadOnlyList<Azure.AI.Projects.AgentThread> Data { get { throw null; } }
1711-
public string FirstId { get { throw null; } }
1712-
public bool HasMore { get { throw null; } }
1713-
public string LastId { get { throw null; } }
1714-
public Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject Object { get { throw null; } }
1715-
protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
1716-
Azure.AI.Projects.OpenAIPageableListOfAgentThread System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1717-
void System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
1718-
Azure.AI.Projects.OpenAIPageableListOfAgentThread System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1719-
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1720-
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1721-
}
1722-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
1723-
public readonly partial struct OpenAIPageableListOfAgentThreadObject : System.IEquatable<Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject>
1724-
{
1725-
private readonly object _dummy;
1726-
private readonly int _dummyPrimitive;
1727-
public OpenAIPageableListOfAgentThreadObject(string value) { throw null; }
1728-
public static Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject List { get { throw null; } }
1729-
public bool Equals(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject other) { throw null; }
1730-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1731-
public override bool Equals(object obj) { throw null; }
1732-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1733-
public override int GetHashCode() { throw null; }
1734-
public static bool operator ==(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject left, Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject right) { throw null; }
1735-
public static implicit operator Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject (string value) { throw null; }
1736-
public static bool operator !=(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject left, Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject right) { throw null; }
1737-
public override string ToString() { throw null; }
1738-
}
17391704
public partial class OpenApiAnonymousAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenApiAnonymousAuthDetails>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenApiAnonymousAuthDetails>
17401705
{
17411706
public OpenApiAnonymousAuthDetails() { }

sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,8 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG
279279
public virtual Azure.Response<Azure.AI.Projects.AgentThread> GetThread(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
280280
public virtual System.Threading.Tasks.Task<Azure.Response> GetThreadAsync(string threadId, Azure.RequestContext context) { throw null; }
281281
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.AgentThread>> GetThreadAsync(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
282-
public virtual Azure.Response<Azure.AI.Projects.OpenAIPageableListOfAgentThread> GetThreads(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
283-
public virtual Azure.Response GetThreads(int? limit, string order, string after, string before, Azure.RequestContext context) { throw null; }
284-
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.OpenAIPageableListOfAgentThread>> GetThreadsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
285-
public virtual System.Threading.Tasks.Task<Azure.Response> GetThreadsAsync(int? limit, string order, string after, string before, Azure.RequestContext context) { throw null; }
282+
public virtual Azure.Response<Azure.AI.Projects.PageableList<Azure.AI.Projects.AgentThread>> GetThreads(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
283+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Projects.PageableList<Azure.AI.Projects.AgentThread>>> GetThreadsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
286284
public virtual Azure.Response GetVectorStore(string vectorStoreId, Azure.RequestContext context) { throw null; }
287285
public virtual Azure.Response<Azure.AI.Projects.VectorStore> GetVectorStore(string vectorStoreId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
288286
public virtual System.Threading.Tasks.Task<Azure.Response> GetVectorStoreAsync(string vectorStoreId, Azure.RequestContext context) { throw null; }
@@ -521,7 +519,6 @@ public static partial class AIProjectsModelFactory
521519
public static Azure.AI.Projects.MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null) { throw null; }
522520
public static Azure.AI.Projects.MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, Azure.AI.Projects.MessageTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; }
523521
public static Azure.AI.Projects.MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) { throw null; }
524-
public static Azure.AI.Projects.OpenAIPageableListOfAgentThread OpenAIPageableListOfAgentThread(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject @object = default(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject), System.Collections.Generic.IEnumerable<Azure.AI.Projects.AgentThread> data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; }
525522
public static Azure.AI.Projects.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; }
526523
public static Azure.AI.Projects.ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType type = default(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType), Azure.AI.Projects.ResponseFormatJsonSchema jsonSchema = null) { throw null; }
527524
public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; }
@@ -1704,38 +1701,6 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write
17041701
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.MicrosoftFabricToolDefinition>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
17051702
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.MicrosoftFabricToolDefinition>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
17061703
}
1707-
public partial class OpenAIPageableListOfAgentThread : System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>
1708-
{
1709-
internal OpenAIPageableListOfAgentThread() { }
1710-
public System.Collections.Generic.IReadOnlyList<Azure.AI.Projects.AgentThread> Data { get { throw null; } }
1711-
public string FirstId { get { throw null; } }
1712-
public bool HasMore { get { throw null; } }
1713-
public string LastId { get { throw null; } }
1714-
public Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject Object { get { throw null; } }
1715-
protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
1716-
Azure.AI.Projects.OpenAIPageableListOfAgentThread System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1717-
void System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
1718-
Azure.AI.Projects.OpenAIPageableListOfAgentThread System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1719-
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1720-
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenAIPageableListOfAgentThread>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
1721-
}
1722-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
1723-
public readonly partial struct OpenAIPageableListOfAgentThreadObject : System.IEquatable<Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject>
1724-
{
1725-
private readonly object _dummy;
1726-
private readonly int _dummyPrimitive;
1727-
public OpenAIPageableListOfAgentThreadObject(string value) { throw null; }
1728-
public static Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject List { get { throw null; } }
1729-
public bool Equals(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject other) { throw null; }
1730-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1731-
public override bool Equals(object obj) { throw null; }
1732-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1733-
public override int GetHashCode() { throw null; }
1734-
public static bool operator ==(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject left, Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject right) { throw null; }
1735-
public static implicit operator Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject (string value) { throw null; }
1736-
public static bool operator !=(Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject left, Azure.AI.Projects.OpenAIPageableListOfAgentThreadObject right) { throw null; }
1737-
public override string ToString() { throw null; }
1738-
}
17391704
public partial class OpenApiAnonymousAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.OpenApiAnonymousAuthDetails>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.OpenApiAnonymousAuthDetails>
17401705
{
17411706
public OpenApiAnonymousAuthDetails() { }

0 commit comments

Comments
 (0)