-
Notifications
You must be signed in to change notification settings - Fork 5k
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
dmytrostruk
wants to merge
14
commits into
Azure:main
Choose a base branch
from
dmytrostruk:persistent-agent-chat-client
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+899
−5
Open
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eaee471
Added PersistentAgentsChatClient implementation
dmytrostruk 893a3df
Added tests
dmytrostruk d5f38a4
Added sample
dmytrostruk c8e2f46
Public API additions
dmytrostruk d10f507
Update sdk/ai/Azure.AI.Agents.Persistent/src/Custom/PersistentAgentsC…
dmytrostruk 1c02042
Fixed typo
dmytrostruk 4b03497
Merge branch 'persistent-agent-chat-client' of https://github.com/dmy…
dmytrostruk b222b1e
Addressed PR feedback
dmytrostruk f45c76d
Added conditional block for dependency
dmytrostruk c4c711e
Small improvements
dmytrostruk 70083fd
Merge branch 'main' into persistent-agent-chat-client
dmytrostruk 11669bd
Updated assets tag
dmytrostruk 136c3ac
Updated assets tag
dmytrostruk 0461245
Updated assets tag
dmytrostruk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
450 changes: 450 additions & 0 deletions
450
sdk/ai/Azure.AI.Agents.Persistent/src/Custom/PersistentAgentsChatClient.cs
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
sdk/ai/Azure.AI.Agents.Persistent/src/Custom/PersistentAgentsClientExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable enable | ||
|
||
using Microsoft.Extensions.AI; | ||
|
||
namespace Azure.AI.Agents.Persistent | ||
{ | ||
/// <summary> | ||
/// Provides extension methods for <see cref="PersistentAgentsClient"/>. | ||
/// </summary> | ||
public static class PersistentAgentsClientExtensions | ||
{ | ||
/// <summary> | ||
/// Creates an <see cref="IChatClient"/> for a <see cref="PersistentAgentsClient"/> client for interacting with a specific agent. | ||
/// </summary> | ||
/// <param name="client">The <see cref="PersistentAgentsClient"/> instance to be accessed as an <see cref="IChatClient"/>.</param> | ||
/// <param name="agentId">The unique identifier of the agent with which to interact.</param> | ||
/// <param name="defaultThreadId"> | ||
/// An optional existing thread identifier for the chat session. This serves as a default, and may be overridden per call to | ||
/// <see cref="IChatClient.GetResponseAsync"/> or <see cref="IChatClient.GetStreamingResponseAsync"/> via the <see cref="ChatOptions.ConversationId"/> | ||
/// property. If no thread ID is provided via either mechanism, a new thread will be created for the request. | ||
/// </param> | ||
/// <returns>An <see cref="IChatClient"/> instance configured to interact with the specified agent and thread.</returns> | ||
public static IChatClient AsIChatClient(this PersistentAgentsClient client, string agentId, string? defaultThreadId = null) => | ||
new PersistentAgentsChatClient(client, agentId, defaultThreadId); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.