version 1.1

This commit is contained in:
2025-07-04 14:27:08 +02:00
parent dff071b9ec
commit cef7ae3cc2
8 changed files with 25 additions and 7 deletions

View File

@@ -59,7 +59,7 @@ namespace BeWo
public static string ShortVersion = "3.26";
public static string Version = "Version 3.26";
public static string Version = "Version 3.26 - 1.1 Test";
public static int RenderTier = 0;
public static bool IsInDesignMode = DesignerProperties.GetIsInDesignMode(new DependencyObject());
@@ -752,7 +752,7 @@ namespace BeWo
//}
if (url.IndexOf("/service") < 0)
{
url += "/service";
url += "/service2";
}
return new Uri(String.Format("https://{0}", url));

View File

@@ -144,7 +144,7 @@ namespace BeWo
new DebugConfig()
{
DebugConfigMode = DebugConfigMode.FeatureAiModule,
AutoLogin = true,
AutoLogin = false,
SelectView = UIContext.Customer,
//SelectIndex = 8,
//DefaultLoginUsername = "m1",

View File

@@ -181,7 +181,11 @@ namespace BeWo.ViewModel.View
ServiceFacade.DoAiEnhancedServiceAsnyc(
x => x.CreateAiConversationWithMessage(conv, Config.SelectedModel.Oid.Value, message),
dc => UpdateConverstion(vm, dc),
e => EndSending());
e => {
EndSending();
ListVM.VMList.Remove(vm);
}
);
}
catch (Exception ex)
{

View File

@@ -309,6 +309,7 @@
<add key="OpenWebUIUrl" value="https://owui1.ownsoft.de/"/>
<add key="AiSystemPromptPath" value="C:\BeWoPlaner\AI\systemPrompts\customSystemPrompt.txt"/>
<add key="AiServiceLogFilePath" value="C:\BeWoPlaner\logs2\server\aiservice.log.txt"/>
</appSettings>
<!-- <> <> <> Appsettings <> <> <> -->
<devExpress>

View File

@@ -3,6 +3,7 @@ using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.AI;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceContracts;
using BeWo.Service.ServiceProxy;
@@ -18,6 +19,7 @@ using DevExpress.XtraCharts.Native;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Security.Cryptography;
@@ -213,7 +215,6 @@ namespace BeWo.Service.ServiceImplementations
return SendNewMessage(conv, message);
}
private AiConversationMessageDC[] SendNewMessage(AiConversation conv, string message)
{
// Updated
@@ -240,6 +241,13 @@ namespace BeWo.Service.ServiceImplementations
// Send Request, wait for Response
var dt_before_request = DateTime.Now;
var response = ServiceFacade.OpenWebApiClient.SendAiMessageRequest(conv_dc, config, out var message2, out var model, out var duration);
if (!response.Success)
{
var json = JsonConvert.SerializeObject(response.Copy<string>());
File.WriteAllText(MergedConfig.GetSetting("AiServiceLogFilePath"), json);
}
var result = response.GetResponseData();
// Antwort

View File

@@ -102,7 +102,10 @@ namespace BeWo.Service.ServiceProxy
_PostClientFacade.JsonObject = payload;
var response = _PostClientFacade.GetAnonymousTypeAsync(sub_url, response_format, _ErrorExtractor).GetAwaiter().GetResult();
if (!response.Success)
return response.Copy<string>();
var json = response.GetResponseData();
foreach (var choice in json.choices)

View File

@@ -55,7 +55,7 @@ namespace BS.Shared.Core.Facade
if (!http_response.IsSuccessStatusCode)
{
return ApiResponse<T>.FailureResponse(AppError.ApiResponseFailed, http_response.ReasonPhrase);
return ApiResponse<T>.FailureResponse(AppError.ApiResponseFailed, http_response.ReasonPhrase, (int)http_response.StatusCode);
}
var json = await http_response.Content.ReadAsStringAsync().ConfigureAwait(false);

View File

@@ -14,7 +14,9 @@ namespace BS.Shared.Extensions
public static T GetResponseData<T>(this ApiResponse<T> data)
{
if (!data.Success)
{
throw new BeWoInvalidOperationException(AppError.ApiResponseFailed);
}
return data.Data;
}