forked from asklar/OpenAI.WinRT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PromptTemplate.h
48 lines (35 loc) · 1.73 KB
/
PromptTemplate.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include "PromptTemplate.g.h"
#include "FewShotTemplate.g.h"
#include "OpenAIClient.h"
namespace winrt::OpenAI::implementation
{
struct TemplateBase {
winrt::OpenAI::OpenAIClient m_client;
};
struct PromptTemplate : PromptTemplateT<PromptTemplate>, TemplateBase
{
PromptTemplate() = default;
winrt::hstring Template() const { return m_template; }
void Template(winrt::hstring value) { m_template = value; }
Windows::Foundation::IAsyncOperation<winrt::hstring> FormatAsync(winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::hstring> parameters);
winrt::hstring m_template;
};
struct FewShotTemplate : FewShotTemplateT<FewShotTemplate>, TemplateBase
{
std::vector<std::wstring> m_parameters;
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::hstring>> Examples() {
return m_examples;
}
void Examples(winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::hstring>> value) { m_examples = value; }
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::hstring>> m_examples;
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::hstring> > ExecuteAsync(winrt::hstring input);
};
}
namespace winrt::OpenAI::factory_implementation
{
struct PromptTemplate : PromptTemplateT<PromptTemplate, implementation::PromptTemplate>
{
};
struct FewShotTemplate : FewShotTemplateT<FewShotTemplate, implementation::FewShotTemplate>{};
}