Skip to content

.Net Agents - Support Prompt Template - #8631

Merged
Chris (crickman) merged 71 commits into
mainfrom
feature_agent_template
Sep 23, 2024
Merged

Chris (crickman) merged 71 commits into
mainfrom
feature_agent_template

Conversation

@crickman

@crickman Chris (crickman) commented Sep 9, 2024 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Support ability to paramaterize agent instructions (à la IKernelTemplate).

This also includes the ability to initialize an agent using a yaml based prompt-template.

Description

Core:

  • Update ChatCompletionAgent and OpenAIAssistantAgent to support initialization via PromptTemplateConfig.
  • Also allow both agent types to support semantic-kernel template format for string based Instructions
  • Formalize templating contracts on KernelAgent (base class)
  • Added GettingStartedWithAgents samples using yaml template: Step01 & Step08
  • Added templating samples under Concepts/Agents to explore full range of templating patterns

Structural:

  • Split off OpenAIAssistantCapabilities from OpenAIAssistantDefinition to clarify creation via PromptTemplateConfig
  • Re-ordered method parameters for OpenAIAssistant.CreateAsync and RetrieveAsync to rationalize functional grouping and optionality.
  • Externalized internal AssistantCreationOptionsFactory (from private OpenAIAssistant method) for clarity and ease of testing
  • Persisting template-format as part of assistant metadata for retrieval case (in the event of any ambiguity)

Additionally:

  • Updated/added comments where appropriate
  • Updated sample conventions (argument labels, explicit types)
  • Updated all call sites for creating OpenAIAssistantAgent (due to parameter ordering)
  • Added test coverage where able

Contribution Checklist

@markwallace-microsoft Mark Wallace (markwallace-microsoft) added the .NET Issue or Pull requests regarding .NET code label Sep 9, 2024
@crickman Chris (crickman) added PR: in progress Under development and/or addressing feedback experimental Associated with an experimental feature enhancement agents labels Sep 9, 2024
@crickman Chris (crickman) self-assigned this Sep 9, 2024

@moonbox3 Evan Mattson (moonbox3) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some small comments/a question but LGTM.

@crickman
Chris (crickman) added this pull request to the merge queue Sep 20, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@crickman
Chris (crickman) added this pull request to the merge queue Sep 20, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@crickman
Chris (crickman) added this pull request to the merge queue Sep 20, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@crickman
Chris (crickman) added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit a5570b1 Sep 23, 2024

This branch was previously deployed

1 inactive deployment
integration — 74ab4707 Deployed Sep 20, 2024 by crickman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents enhancement experimental Associated with an experimental feature kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

.Net [Agents] Support prompt template config by any agent.

4 participants