-
Notifications
You must be signed in to change notification settings - Fork 632
Integration for Azure.AI.projects #7819
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
base: main
Are you sure you want to change the base?
Conversation
This allows you to integrate with Azure AI Agent Service, and other services available via the SDK. Fixes dotnet#7768
Note - there is a new NuGet package required for this that isn't in the proxy package feed, |
|
||
if (string.IsNullOrEmpty(connectionString) && settings.Endpoint is not null) | ||
{ | ||
connectionString = $"{settings.Endpoint.Host};{settings.SubscriptionId};{settings.ResourceGroupName};{settings.ProjectName}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really make sense to piece this connection string apart in Parse, just to connect it back together here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just coming back to this, and I think there might be a misunderstanding in the connection string, or maybe my design isn't as ideal as it could be.
In AI Foundry when you access a Project, the "connection string" is in the above format, endpoint;sub id;rg name;project name
. This formatted value needs to be provided to the AIProjectClient
when created.
The approach I was targeting in the settings object design was that you could provide the "connection string" in the format like you've copy/pasted from the web UI, or if you'd prefer you can provide each of the four parts as settings properties and we'll format it correctly for you. This is because there doesn't seem to be a way in Bicep to get the formatted value, you must do that yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be something that AzureAIProjectSettings
should be responsible for at the ParseConnectionString-time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so, if you think it makes more sense to be able to go settings.ConnectionString
and have it essentially non-nullable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep a simple ConnectionString {get; set;}
and just do validation in the ParseConnectionString
to set it to ConnectionString
. If it's set the client will use it. If it's not set if will create one from the other properties from the settings after validating they are correct (all required, and format is fine).
This way when the host sets the connection string, the ParseConnectionString
is invoked and can assign the ConnectionString
setting. When it's not set the custom properties are used.
@aaronpowell do you plan to address feedback above? |
Yep, I was talking with @sebastienros and will look to pick this up again, so I'll address the feedback, update the branch, and tackle the other gaps. |
@sebastienros this should be good to review with the AI work |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
We need to add the NuGet package |
I did that yesterday, that's why I triggered the build manually |
src/Components/Aspire.Azure.AI.Projects/AzureAIProjectExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Aspire.Azure.AI.Projects/AzureAIProjectExtensions.cs
Outdated
Show resolved
Hide resolved
Please also add a README and update the files https://github.com/dotnet/aspire/blob/main/src/Components/Telemetry.md and https://github.com/dotnet/aspire/blob/main/src/Components/Aspire_Components_Progress.md |
Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
<Description>A client for Azure AI Agent Service that integrates with Aspire, including logging and telemetry.</Description> | ||
<PackageIconFullPath>$(SharedDir)Azure_256x.png</PackageIconFullPath> | ||
<NoWarn>$(NoWarn);SYSLIB1100;SYSLIB1101</NoWarn> | ||
<!-- In preview until the public API is validated and the Microsoft.Extensions.AI integration is designed.. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- In preview until the public API is validated and the Microsoft.Extensions.AI integration is designed.. --> | |
<!-- In preview until the public API is validated and the package is stable. --> |
If you are motivated could you please also update the Aspire.Azure.AI.OpenAI and Aspire.OpenAI project where this string is coming from?
src/Components/Aspire.Azure.AI.Projects/AzureAIProjectSettings.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
A client integration for working with the Azure.AI.Projects SDK, which allows you to create agents using Agent Service.
Currently, the integration added
AIProjectClient
to the service collection, and from that you can create anAgentClient
(see the sample app), but I wonder if we should have a way to register theAgentClient
as part of the initial registration (and similarly expand out to the other available clients, I just haven't used them yet).Fixes #7768
Related to #7868 for hosting
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):