-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathMultiModelSampleNavigationParameters.cs
32 lines (27 loc) · 1.36 KB
/
MultiModelSampleNavigationParameters.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
31
32
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using AIDevGallery.Samples.SharedCode;
using AIDevGallery.Telemetry.Events;
using System.Threading;
using System.Threading.Tasks;
namespace AIDevGallery.Models;
internal class MultiModelSampleNavigationParameters(
string sampleId,
string[] modelIds,
string[] modelPaths,
HardwareAccelerator[] hardwareAccelerators,
LlmPromptTemplate?[] promptTemplates,
TaskCompletionSource sampleLoadedCompletionSource,
CancellationToken loadingCanceledToken)
: BaseSampleNavigationParameters(sampleLoadedCompletionSource, loadingCanceledToken)
{
public string[] ModelPaths { get; } = modelPaths;
public HardwareAccelerator[] HardwareAccelerators { get; } = hardwareAccelerators;
protected override string ChatClientModelPath => ModelPaths[0];
protected override HardwareAccelerator ChatClientHardwareAccelerator => HardwareAccelerators[0];
protected override LlmPromptTemplate? ChatClientPromptTemplate => promptTemplates[0];
internal override void SendSampleInteractionEvent(string? customInfo = null)
{
SampleInteractionEvent.Log(sampleId, model1Id: modelIds[0], hardwareAccelerator1: HardwareAccelerators[0], model2Id: ModelPaths[1], hardwareAccelerator2: HardwareAccelerators[1], customInfo);
}
}