Skip to content

Added IChatClient implementation for PersistentAgentsClient #50898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Update="Microsoft.Extensions.AI.Abstractions" Version="9.6.0"/>
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3"/>

<!-- Azure SDK packages -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,15 @@ public enum ServiceVersion
V2025_05_15_Preview = 3,
}
}
public partial class PersistentAgentsChatClient : Microsoft.Extensions.AI.IChatClient, System.IDisposable
{
protected PersistentAgentsChatClient() { }
public PersistentAgentsChatClient(Azure.AI.Agents.Persistent.PersistentAgentsClient client, string agentId, string? defaultThreadId = null) { }
public void Dispose() { }
public virtual System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse> GetResponseAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual object? GetService(System.Type serviceType, object? serviceKey = null) { throw null; }
public virtual System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> GetStreamingResponseAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options = null, [System.Runtime.CompilerServices.EnumeratorCancellationAttribute] System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class PersistentAgentsClient
{
protected PersistentAgentsClient() { }
Expand All @@ -1159,6 +1168,10 @@ public PersistentAgentsClient(string endpoint, Azure.Core.TokenCredential creden
public virtual Azure.Response<Azure.AI.Agents.Persistent.ThreadRun> CreateThreadAndRun(string assistantId, Azure.AI.Agents.Persistent.ThreadAndRunOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Agents.Persistent.ThreadRun>> CreateThreadAndRunAsync(string assistantId, Azure.AI.Agents.Persistent.ThreadAndRunOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public static partial class PersistentAgentsClientExtensions
{
public static Microsoft.Extensions.AI.IChatClient AsIChatClient(this Azure.AI.Agents.Persistent.PersistentAgentsClient client, string agentId, string? defaultThreadId = null) { throw null; }
}
public static partial class PersistentAgentsExtensions
{
public static Azure.AI.Agents.Persistent.PersistentAgentsClient GetPersistentAgentsClient(this System.ClientModel.Primitives.ClientConnectionProvider provider) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,15 @@ public enum ServiceVersion
V2025_05_15_Preview = 3,
}
}
public partial class PersistentAgentsChatClient : Microsoft.Extensions.AI.IChatClient, System.IDisposable
{
protected PersistentAgentsChatClient() { }
public PersistentAgentsChatClient(Azure.AI.Agents.Persistent.PersistentAgentsClient client, string agentId, string? defaultThreadId = null) { }
public void Dispose() { }
public virtual System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse> GetResponseAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual object? GetService(System.Type serviceType, object? serviceKey = null) { throw null; }
public virtual System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> GetStreamingResponseAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options = null, [System.Runtime.CompilerServices.EnumeratorCancellationAttribute] System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class PersistentAgentsClient
{
protected PersistentAgentsClient() { }
Expand All @@ -1159,6 +1168,10 @@ public PersistentAgentsClient(string endpoint, Azure.Core.TokenCredential creden
public virtual Azure.Response<Azure.AI.Agents.Persistent.ThreadRun> CreateThreadAndRun(string assistantId, Azure.AI.Agents.Persistent.ThreadAndRunOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Agents.Persistent.ThreadRun>> CreateThreadAndRunAsync(string assistantId, Azure.AI.Agents.Persistent.ThreadAndRunOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public static partial class PersistentAgentsClientExtensions
{
public static Microsoft.Extensions.AI.IChatClient AsIChatClient(this Azure.AI.Agents.Persistent.PersistentAgentsClient client, string agentId, string? defaultThreadId = null) { throw null; }
}
public static partial class PersistentAgentsExtensions
{
public static Azure.AI.Agents.Persistent.PersistentAgentsClient GetPersistentAgentsClient(this System.ClientModel.Primitives.ClientConnectionProvider provider) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" />
</ItemGroup>

<!-- Shared source from Azure.Core -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace Azure.AI.Agents.Persistent
public partial class PersistentAgentsAdministrationClient
{
private static readonly bool s_is_test_run = AppContextSwitchHelper.GetConfigValue(
PersistantAgensConstants.UseOldConnectionString,
PersistantAgensConstants.UseOldConnectionStringEnvVar);
PersistentAgentsConstants.UseOldConnectionString,
PersistentAgentsConstants.UseOldConnectionStringEnvVar);
/// <summary> The ClientDiagnostics is used to provide tracing support for the client library. </summary>
internal virtual ClientDiagnostics ClientDiagnostics { get; }
// TODO: Replace project connections string by PROJECT_ENDPOINT when 1DP will be available.
Expand Down
Loading
Loading