Files
BeWoPlaner/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs

131 lines
3.3 KiB
C#
Raw Normal View History

2025-04-24 10:40:22 +02:00
using BeWo.Core;
2025-06-11 12:51:32 +02:00
using BeWo.Core.Commands;
2025-04-24 10:40:22 +02:00
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts.Feature.AI;
2025-03-19 16:30:27 +01:00
using BS.Shared.Extensions;
using ChatController.Utilities.Extensions;
using DevExpress.Mvvm;
2025-04-24 10:40:22 +02:00
using DevExpress.Xpf.Editors;
2025-03-19 16:30:27 +01:00
using DevExpress.XtraPrinting.Native;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
2025-04-03 16:47:50 +02:00
using System.Diagnostics;
2025-03-19 16:30:27 +01:00
using System.Linq;
2025-03-28 10:05:29 +01:00
using System.Runtime.Remoting.Contexts;
2025-03-19 16:30:27 +01:00
using System.Text;
using System.Threading.Tasks;
2025-04-24 16:02:13 +02:00
using System.Windows;
using System.Windows.Data;
2025-04-24 16:02:13 +02:00
using System.Windows.Input;
using System.Windows.Markup;
2025-03-19 16:30:27 +01:00
using System.Windows.Threading;
namespace BeWo.ViewModel.ListViewModel
{
public class AiConversationListVM : AbstractDCListMapperVM<AiConversationDC, AiConversationVM>
{
2025-04-24 10:50:31 +02:00
public AiConversationListVM() : this(null)
2025-03-19 16:30:27 +01:00
{
2025-04-03 16:47:50 +02:00
if (BeWoApp.IsInDesignMode)
{
InitDesigner();
}
2025-03-19 16:30:27 +01:00
}
2025-04-03 16:47:50 +02:00
2025-03-19 16:30:27 +01:00
public AiConversationListVM(List<AiConversationDC> pDCs) : base(pDCs)
{
2025-04-24 10:40:22 +02:00
}
2025-03-28 10:05:29 +01:00
#region Designer
2025-04-03 16:47:50 +02:00
private void InitDesigner()
{
var model = new AiModelDC()
{
2025-04-09 15:54:28 +02:00
ModelName = "N llama3.2"
};
2025-04-03 16:47:50 +02:00
var message_dc = new AiConversationMessageDC()
{
Created = DateTime.Now,
2025-04-09 15:54:28 +02:00
Message = "Nu bist eine intelligente Einheit mit ganz ganz vielen Eingaben: value1, value2, value3, value4\r\nTest",
2025-04-03 16:47:50 +02:00
Role = BS.Shared.AiConversationMessageRole.System
};
var message_dc2 = new AiConversationMessageDC()
{
Created = DateTime.Now,
2025-04-09 15:54:28 +02:00
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",
2025-04-03 16:47:50 +02:00
Role = BS.Shared.AiConversationMessageRole.User
};
var message_dc3 = new AiConversationMessageDC()
{
Created = DateTime.Now,
2025-04-09 15:54:28 +02:00
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,
2025-04-03 16:47:50 +02:00
};
var messages_dc = new List<AiConversationMessageDC>()
{
message_dc,
message_dc2,
message_dc3,
message_dc2,
message_dc3,
message_dc2,
message_dc3,
message_dc2,
message_dc3,
2025-04-03 16:47:50 +02:00
};
2025-04-24 10:50:31 +02:00
2025-04-03 16:47:50 +02:00
var conversation_dc = new AiConversationDC()
{
Created = DateTime.Now,
2025-04-08 10:22:22 +02:00
Displayname = "Displayname Megamegalange Deluxe Op 3000",
2025-04-03 16:47:50 +02:00
Messages = messages_dc,
Modell = model,
2026-05-26 12:30:29 +02:00
ActionType = AiActionType.ServiceRecordDocumentation,
2025-04-03 16:47:50 +02:00
Updated = DateTime.Now,
};
var conversation_vm = new AiConversationVM(conversation_dc);
VMList.Add(conversation_vm);
2025-04-08 10:22:22 +02:00
InitDummyConversations(10);
2025-05-13 11:10:24 +02:00
//SelectedVM = conversation_vm;
2025-04-03 16:47:50 +02:00
}
2025-04-08 10:22:22 +02:00
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,
2026-05-26 12:30:29 +02:00
ActionType = AiActionType.ServiceRecordDocumentation,
2025-04-08 10:22:22 +02:00
Updated = DateTime.Now,
};
var conversation_vm2 = new AiConversationVM(conversation_dc2);
VMList.Add(conversation_vm2);
}
}
#endregion
2025-03-19 16:30:27 +01:00
}
}