diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs
index 6a263c1b1..c4f41b203 100644
--- a/BeWo/BeWoApp.xaml.cs
+++ b/BeWo/BeWoApp.xaml.cs
@@ -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));
diff --git a/BeWo/DebugConfig.cs b/BeWo/DebugConfig.cs
index d9ee21cb8..b58bf6e66 100644
--- a/BeWo/DebugConfig.cs
+++ b/BeWo/DebugConfig.cs
@@ -144,7 +144,7 @@ namespace BeWo
new DebugConfig()
{
DebugConfigMode = DebugConfigMode.FeatureAiModule,
- AutoLogin = true,
+ AutoLogin = false,
SelectView = UIContext.Customer,
//SelectIndex = 8,
//DefaultLoginUsername = "m1",
diff --git a/BeWo/ViewModel/View/AiConversationChatViewModel.cs b/BeWo/ViewModel/View/AiConversationChatViewModel.cs
index 3b4c25972..b916b520e 100644
--- a/BeWo/ViewModel/View/AiConversationChatViewModel.cs
+++ b/BeWo/ViewModel/View/AiConversationChatViewModel.cs
@@ -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)
{
diff --git a/Host/Web.config b/Host/Web.config
index 3e9953e0a..480e8f19a 100644
--- a/Host/Web.config
+++ b/Host/Web.config
@@ -309,6 +309,7 @@
+
diff --git a/Service/ServiceImplementations/AiEnhancedServiceImp.cs b/Service/ServiceImplementations/AiEnhancedServiceImp.cs
index 2fc481b1f..92fd272d9 100644
--- a/Service/ServiceImplementations/AiEnhancedServiceImp.cs
+++ b/Service/ServiceImplementations/AiEnhancedServiceImp.cs
@@ -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());
+ File.WriteAllText(MergedConfig.GetSetting("AiServiceLogFilePath"), json);
+ }
+
var result = response.GetResponseData();
// Antwort
diff --git a/Service/ServiceProxy/OpenWebApiClient.cs b/Service/ServiceProxy/OpenWebApiClient.cs
index 444b7c585..ee5923648 100644
--- a/Service/ServiceProxy/OpenWebApiClient.cs
+++ b/Service/ServiceProxy/OpenWebApiClient.cs
@@ -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();
+
var json = response.GetResponseData();
foreach (var choice in json.choices)
diff --git a/Shared/Core/Facade/HttpClientFacade.cs b/Shared/Core/Facade/HttpClientFacade.cs
index 03ba4a2af..3f1b405f4 100644
--- a/Shared/Core/Facade/HttpClientFacade.cs
+++ b/Shared/Core/Facade/HttpClientFacade.cs
@@ -55,7 +55,7 @@ namespace BS.Shared.Core.Facade
if (!http_response.IsSuccessStatusCode)
{
- return ApiResponse.FailureResponse(AppError.ApiResponseFailed, http_response.ReasonPhrase);
+ return ApiResponse.FailureResponse(AppError.ApiResponseFailed, http_response.ReasonPhrase, (int)http_response.StatusCode);
}
var json = await http_response.Content.ReadAsStringAsync().ConfigureAwait(false);
diff --git a/Shared/Extensions/ApiResponseExtension.cs b/Shared/Extensions/ApiResponseExtension.cs
index 9aedad829..7ab75a991 100644
--- a/Shared/Extensions/ApiResponseExtension.cs
+++ b/Shared/Extensions/ApiResponseExtension.cs
@@ -14,7 +14,9 @@ namespace BS.Shared.Extensions
public static T GetResponseData(this ApiResponse data)
{
if (!data.Success)
+ {
throw new BeWoInvalidOperationException(AppError.ApiResponseFailed);
+ }
return data.Data;
}