131 lines
3.3 KiB
C#
131 lines
3.3 KiB
C#
using BeWo.Core;
|
|
using BeWo.Core.Commands;
|
|
using BeWo.ServiceProxy;
|
|
using BS.Shared;
|
|
using BS.Shared.DataContracts.Feature.AI;
|
|
using BS.Shared.Extensions;
|
|
using ChatController.Utilities.Extensions;
|
|
using DevExpress.Mvvm;
|
|
using DevExpress.Xpf.Editors;
|
|
using DevExpress.XtraPrinting.Native;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Runtime.Remoting.Contexts;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
using System.Windows.Input;
|
|
using System.Windows.Markup;
|
|
using System.Windows.Threading;
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
{
|
|
public class AiConversationListVM : AbstractDCListMapperVM<AiConversationDC, AiConversationVM>
|
|
{
|
|
public AiConversationListVM() : this(null)
|
|
{
|
|
if (BeWoApp.IsInDesignMode)
|
|
{
|
|
InitDesigner();
|
|
}
|
|
}
|
|
|
|
public AiConversationListVM(List<AiConversationDC> pDCs) : base(pDCs)
|
|
{
|
|
|
|
}
|
|
|
|
#region Designer
|
|
private void InitDesigner()
|
|
{
|
|
var model = new AiModelDC()
|
|
{
|
|
ModelName = "N llama3.2"
|
|
};
|
|
|
|
var message_dc = new AiConversationMessageDC()
|
|
{
|
|
Created = DateTime.Now,
|
|
Message = "Nu bist eine intelligente Einheit mit ganz ganz vielen Eingaben: value1, value2, value3, value4\r\nTest",
|
|
Role = BS.Shared.AiConversationMessageRole.System
|
|
};
|
|
|
|
var message_dc2 = new AiConversationMessageDC()
|
|
{
|
|
Created = DateTime.Now,
|
|
Message = "N. Dies ist eine Design Frage: Du sollst ganz viele Sachen machen. Dabei sollst du auf ganz viele Sachen achten: Zum Beispiel:\r\nSache 1\r\nSchritt 2",
|
|
Role = BS.Shared.AiConversationMessageRole.User,
|
|
ShowMessage = true
|
|
};
|
|
|
|
var message_dc3 = new AiConversationMessageDC()
|
|
{
|
|
Created = DateTime.Now,
|
|
Message = "N. Deine Antwort. Dies ist eine Design Antwort. Du hast ganz viele Sachen angefragt. Dabei soll ich auf ganz viele Sachen achten. Wie Test, test, tEst und tesT.\r\nTest\r\nTest\r\nTest",
|
|
Role = BS.Shared.AiConversationMessageRole.Assistent,
|
|
ModelName = model.ModelName,
|
|
Duration = 10,
|
|
};
|
|
|
|
var messages_dc = new List<AiConversationMessageDC>()
|
|
{
|
|
message_dc,
|
|
message_dc2,
|
|
message_dc3,
|
|
message_dc2,
|
|
message_dc3,
|
|
message_dc2,
|
|
message_dc3,
|
|
message_dc2,
|
|
message_dc3,
|
|
};
|
|
|
|
var conversation_dc = new AiConversationDC()
|
|
{
|
|
Created = DateTime.Now,
|
|
Displayname = "Displayname Megamegalange Deluxe Op 3000",
|
|
Messages = messages_dc,
|
|
Modell = model,
|
|
ActionType = AiActionType.ServiceRecordDocumentation,
|
|
Updated = DateTime.Now,
|
|
};
|
|
|
|
var conversation_vm = new AiConversationVM(conversation_dc);
|
|
|
|
VMList.Add(conversation_vm);
|
|
|
|
InitDummyConversations(10);
|
|
|
|
//SelectedVM = conversation_vm;
|
|
}
|
|
private void InitDummyConversations(int count)
|
|
{
|
|
var model = new AiModelDC()
|
|
{
|
|
ModelName = "llama3.2"
|
|
};
|
|
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
var conversation_dc2 = new AiConversationDC()
|
|
{
|
|
Created = DateTime.Now,
|
|
Displayname = "Dummy Num " + i.ToString(),
|
|
Modell = model,
|
|
ActionType = AiActionType.ServiceRecordDocumentation,
|
|
Updated = DateTime.Now,
|
|
};
|
|
|
|
var conversation_vm2 = new AiConversationVM(conversation_dc2);
|
|
|
|
VMList.Add(conversation_vm2);
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|