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 Agents - Support Prompt Template #8631

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open

Conversation

crickman
Copy link
Contributor

@crickman crickman commented Sep 9, 2024

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 markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Sep 9, 2024
@crickman crickman added PR: in progress Under development and/or addressing feedback experimental Associated with an experimental feature enhancement agents labels Sep 9, 2024
@crickman crickman self-assigned this Sep 9, 2024
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
Status: Sprint: In Review
Development

Successfully merging this pull request may close these issues.

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