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: New Feature: Support for structured output through Prompty file #10131

Open
husseinkorly opened this issue Jan 8, 2025 · 0 comments
Open
Labels
.NET Issue or Pull requests regarding .NET code triage

Comments

@husseinkorly
Copy link


name: Feature request
about: Adding support for structured output through Prompty


Currently, we can set the response_format property programmatically in code, as shown below:

var settings = new OpenAIPromptExecutionSettings
{
    MaxTokens = 16384,
    Temperature = 0.0,
    TopP = 0.00,
    PresencePenalty = 0.0,
    FrequencyPenalty = 0.0,
    ResponseFormat = typeof(InvoiceData)
};

This configuration ensures that the response from the Large Language Model (LLM) aligns with the specified format (InvoiceData in this example).

Request:
I was wondering, if possible, to do the same through Prompty template for example:

name: InvoiceDocumentExtraction
description: This prompt is used to extract information from an invoice document.
authors:
  - HK
model:
  api: chat
  configuration:
    type: azure_openai
  parameters:
    max_tokens: 16384
    temperature: 0.0
    top_p: 0.0
    frequency_penalty: 0.0
    presence_penalty: 0.0
    response_format: <reference to a file>

the file could reference a predefined response format (e.g., InvoiceData class or schema), ensuring consistent structure in the LLM's output. This is particularly useful for tasks like extracting structured data from documents.

I see Prompty support the following

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Jan 8, 2025
@github-actions github-actions bot changed the title New Feature: Support for structured output through Prompty file .Net: New Feature: Support for structured output through Prompty file Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code triage
Projects
None yet
Development

No branches or pull requests

2 participants