-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathIJsonTranslatorPrompts.cs
30 lines (27 loc) · 1.27 KB
/
IJsonTranslatorPrompts.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft. All rights reserved.
namespace Microsoft.TypeChat;
/// <summary>
/// Json Translators use a request Prompt and a repair Prompt. This interface lets you customize both.
/// A repair prompt
/// </summary>
public interface IJsonTranslatorPrompts
{
/// <summary>
/// Creates a prompt from the given request, instructing the AI language mode to
/// translate the request into JSON using the supplied schema
/// </summary>
/// <param name="schema">Schema for the JSON the model should return</param>
/// <param name="request">request</param>
/// <param name="preamble">Preamble/additional instructions to send to the model</param>
/// <returns></returns>
Prompt CreateRequestPrompt(TypeSchema schema, Prompt request, IList<IPromptSection> preamble);
/// <summary>
/// Creates a repair prompt to append to an original prompt/response in order to repair a JSON object that
/// failed to validate.
/// </summary>
/// <param name="schema">Schema for the JSON the model should return</param>
/// <param name="json">The json returned by the model</param>
/// <param name="validationError"></param>
/// <returns></returns>
string CreateRepairPrompt(TypeSchema schema, string json, string validationError);
}