diff --git a/BeWo/Styles/Colors/Colors.xaml b/BeWo/Styles/Colors/Colors.xaml
index 4b888ffa5..76c1162e0 100644
--- a/BeWo/Styles/Colors/Colors.xaml
+++ b/BeWo/Styles/Colors/Colors.xaml
@@ -112,11 +112,11 @@
#FF5C1919
#FF993B3B
- #FF5C1919
+ #FF893535
#FF5C1919
#FF993B3B
- #FF5C1919
+ #FF893535
#FF19485C
#FF3B7799
diff --git a/Service/Plugins/AiService2.cs b/Service/Plugins/AiService2.cs
index b1e08228c..9839425b1 100644
--- a/Service/Plugins/AiService2.cs
+++ b/Service/Plugins/AiService2.cs
@@ -21,7 +21,6 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Extensions;
-using Microsoft.ML.Tokenizers;
using Newtonsoft.Json;
namespace BeWo.Service.Plugins
@@ -309,7 +308,10 @@ namespace BeWo.Service.Plugins
};
// Check Token Size
- checkTokenSize(conv.Messages, configModelName);
+ if(!checkTokenSize(conv.Messages, configModelName))
+ {
+ throw new Exception();
+ }
// Updated
conv.Updated = DateTime.Now;
@@ -360,28 +362,30 @@ namespace BeWo.Service.Plugins
return new AiConversationMessageDC[] { user_msg_dc, assi_msg_dc };
}
- private void checkTokenSize(IList messages, string configModelName)
+ private bool checkTokenSize(IList messages, string configModelName)
{
- Tokenizer tokenizer = TiktokenTokenizer.CreateForModel(configModelName);
- int tokens = countChatTokens(messages, tokenizer);
+ return true;
+ //Tokenizer tokenizer = TiktokenTokenizer.CreateForModel(configModelName);
+
+ //int tokens = countChatTokens(messages, tokenizer);
}
- private int countChatTokens(IList messages, Tokenizer tokenizer)
- {
- int tokensPerMessage = 4; // OpenAI Overhead
- int tokensPerReply = 2;
+ //private int countChatTokens(IList messages, Tokenizer tokenizer)
+ //{
+ // int tokensPerMessage = 4; // OpenAI Overhead
+ // int tokensPerReply = 2;
- int total = 0;
+ // int total = 0;
- foreach (var msg in messages)
- {
- total += tokensPerMessage;
- total += tokenizer.CountTokens(msg.Role.ToString());
- total += tokenizer.CountTokens(msg.Message);
- }
+ // foreach (var msg in messages)
+ // {
+ // total += tokensPerMessage;
+ // total += tokenizer.CountTokens(msg.Role.ToString());
+ // total += tokenizer.CountTokens(msg.Message);
+ // }
- return total + tokensPerReply;
- }
+ // return total + tokensPerReply;
+ //}
}
}
\ No newline at end of file