Skip to content
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

.Net: Phase 1 of the declarative agent schema for review #10260

Open
wants to merge 31 commits into
base: feature-declarative-agents
Choose a base branch
from

Conversation

markwallace-microsoft
Copy link
Member

@markwallace-microsoft markwallace-microsoft commented Jan 22, 2025

Motivation and Context

Related #10224

Includes following

  • Model classes for the Agent Definition
  • An Agent Factory abstraction which is used to create an Agent instance from it's serialised form
  • Agent Factory implementations for Chat Completion, OpenAI Assistant and AzureAI Agent implementations

Description

Contribution Checklist

@markwallace-microsoft markwallace-microsoft force-pushed the users/markwallace/adr_declarative_agents branch from c624bbd to e800600 Compare January 28, 2025 09:19
@joslat
Copy link
Contributor

joslat commented Feb 5, 2025

Hi @markwallace-microsoft,
here is some feedback, hope it helps... I think it is great to support Declarative formats, maybe I'd make some base support for YAML and JSON as "base declarative formats" and implement custom plugins on top that support the existing declarative formats supported and the proposed Microsoft 365 copilot. this could make it easier to implement and add any new declarative format.

Maybe support:

  • Copilot Studio Agents? (I thnink a format json-yaml is generated below the hood to drive behavior...)
  • Azure AI Foundry Agents / Azure AI Agents (I believe this is code but with declarative style, though haven't explored it yet... still need to check Chris bits added some days ago - essentially I don't know what I am talking about and making an hypothesis)
  • AutoGen (in the studio there is a yaml/json definition that is used to persist an agent, so that could, might be a thing)
  • Other: unsure other frameworks like langgraph, langchain, crew ai, swarm, amazon bedrock or google services have a declarative format...

Unsure this helps, pretty much high level.

@markwallace-microsoft
Copy link
Member Author

Hi @markwallace-microsoft, here is some feedback, hope it helps... I think it is great to support Declarative formats, maybe I'd make some base support for YAML and JSON as "base declarative formats" and implement custom plugins on top that support the existing declarative formats supported and the proposed Microsoft 365 copilot. this could make it easier to implement and add any new declarative format.

Maybe support:

  • Copilot Studio Agents? (I thnink a format json-yaml is generated below the hood to drive behavior...)
  • Azure AI Foundry Agents / Azure AI Agents (I believe this is code but with declarative style, though haven't explored it yet... still need to check Chris bits added some days ago - essentially I don't know what I am talking about and making an hypothesis)
  • AutoGen (in the studio there is a yaml/json definition that is used to persist an agent, so that could, might be a thing)
  • Other: unsure other frameworks like langgraph, langchain, crew ai, swarm, amazon bedrock or google services have a declarative format...

Unsure this helps, pretty much high level.

Thanks for the feedback @joslat

  • I'm using YAML in the document for my samples nut JSON would also be supported
  • The goal is to have a format which is Agent Service agnostic and will support Azure AI Agents, OpenAI Assistants, Chat Completion Agents, AutoGen, etc.
  • Another goal to be able able to convert from other formats to this one.

@markwallace-microsoft markwallace-microsoft requested a review from a team as a code owner February 19, 2025 14:00
@markwallace-microsoft markwallace-microsoft changed the base branch from main to feature-declarative-agents February 20, 2025 14:57
@markwallace-microsoft markwallace-microsoft changed the title Initial draft of the declarative agent schema for review Phase 1 of the declarative agent schema for review Feb 20, 2025
@markwallace-microsoft markwallace-microsoft changed the base branch from feature-declarative-agents to main February 20, 2025 18:04
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Feb 21, 2025
@markwallace-microsoft markwallace-microsoft changed the title Phase 1 of the declarative agent schema for review .NET: Phase 1 of the declarative agent schema for review Feb 21, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 79 out of 79 changed files in this pull request and generated 3 comments.

if (agentDefinition.Type?.Equals(OpenAIAssistantAgentType, System.StringComparison.Ordinal) ?? false)
{
var clientProvider = kernel.GetOpenAIClientProvider(agentDefinition);
AssistantClient client = clientProvider.Client.GetAssistantClient();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client-provider pattern is being deprecated in favor of direct client usage.

KernelAgent? kernelAgent = null;
if (agentDefinition.Type?.Equals(AzureAIAgentType, System.StringComparison.Ordinal) ?? false)
{
var clientProvider = kernel.GetAzureAIClientProvider(agentDefinition);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client-provider pattern is being deprecated in favor of direct client usage.

@crickman
Copy link
Contributor

Adding support for BedrockAgent?

@crickman
Copy link
Contributor

Be nice to see some comprehensive samples on this.

@crickman
Copy link
Contributor

Any thoughts on reconciling the support for the PromptTemplateConfig with this new pattern? (Will both be supported or will we be preferring this new pattern for agents?)

@crickman
Copy link
Contributor

Is this going to be released as "GA" or have an experimental tag defined?

{
var hasEndpoint = configuration.TryGetValue(Endpoint, out var endpoint) && endpoint is not null;
var hasApiKey = configuration.TryGetValue(ApiKey, out var apiKey) && apiKey is not null;
if (hasApiKey && hasEndpoint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic may be overly brittle. Isn't there the case where a non-azure endpoint can be targeted that requires an endpoint (such as a model gateway)?

It might be prudent to require explicit knowledge on whether Azure or OpenAI is intended.

@markwallace-microsoft
Copy link
Member Author

Adding support for BedrockAgent?

Yes, this will be added in a seperate PR. Limiting scope in this PR to make it easier to review.

This PR is targeting a feature branch and there is more to come before this is ready for merge to main.

@markwallace-microsoft
Copy link
Member Author

Is this going to be released as "GA" or have an experimental tag defined?

This will all be experimental initially. I'll add those flags before merging to main.

@markwallace-microsoft
Copy link
Member Author

Any thoughts on reconciling the support for the PromptTemplateConfig with this new pattern? (Will both be supported or will we be preferring this new pattern for agents?)

We will be favouring this pattern going forward. The existing PromptTemplateConfig will continue to be supported but Agents will use this new format. This specification will be supported by multiple teams.

@markwallace-microsoft
Copy link
Member Author

Be nice to see some comprehensive samples on this.

This will come in a follow up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants