diff --git a/.github/_typos.toml b/.github/_typos.toml index 9eeb2d7..90c2495 100644 --- a/.github/_typos.toml +++ b/.github/_typos.toml @@ -8,6 +8,7 @@ [files] extend-exclude = [ "_typos.toml", - "LM-Kit-Maestro/wwwroot/*" + "LM-Kit-Maestro/wwwroot/*", + "LM-Kit-Maestro/Resources/*" ] diff --git a/LM-Kit-Maestro/Handlers/StatefulContentViewHandler.Apple.cs b/LM-Kit-Maestro/Handlers/StatefulContentViewHandler.Apple.cs index 0c12d15..7bdd875 100644 --- a/LM-Kit-Maestro/Handlers/StatefulContentViewHandler.Apple.cs +++ b/LM-Kit-Maestro/Handlers/StatefulContentViewHandler.Apple.cs @@ -18,7 +18,7 @@ protected override Microsoft.Maui.Platform.ContentView CreatePlatformView() protected override void ConnectHandler(Microsoft.Maui.Platform.ContentView platformView) { - platformView.AddGestureRecognizer(new UIContinousGestureRecognizer(Tapped)); + platformView.AddGestureRecognizer(new UIContinuousGestureRecognizer(Tapped)); if (OperatingSystem.IsIOSVersionAtLeast(13)) { platformView.AddGestureRecognizer(new UIHoverGestureRecognizer(OnHover)); @@ -83,11 +83,11 @@ private void Tapped(UIGestureRecognizer recognizer) } // TODO: Move it to the different file - internal class UIContinousGestureRecognizer : UIGestureRecognizer + internal class UIContinuousGestureRecognizer : UIGestureRecognizer { private readonly Action action; - public UIContinousGestureRecognizer(Action action) + public UIContinuousGestureRecognizer(Action action) { this.action = action; } diff --git a/LM-Kit-Maestro/LM-Kit-Maestro.csproj b/LM-Kit-Maestro/LM-Kit-Maestro.csproj index 5de6861..3e25a6f 100644 --- a/LM-Kit-Maestro/LM-Kit-Maestro.csproj +++ b/LM-Kit-Maestro/LM-Kit-Maestro.csproj @@ -1,6 +1,6 @@  - net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst + net9.0;net9.0-maccatalyst $(TargetFrameworks);net9.0-windows10.0.19041.0 @@ -20,8 +20,9 @@ false enable true - None + Maestro + Maestro Maestro @@ -33,12 +34,9 @@ 1.0 1 - 15.0 15.0 - 24.0 10.0.17763.0 10.0.17763.0 - 6.5 diff --git a/LM-Kit-Maestro/Platforms/Android/AndroidManifest.xml b/LM-Kit-Maestro/Platforms/Android/AndroidManifest.xml deleted file mode 100644 index bdec9b5..0000000 --- a/LM-Kit-Maestro/Platforms/Android/AndroidManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/LM-Kit-Maestro/Platforms/Android/MainActivity.cs b/LM-Kit-Maestro/Platforms/Android/MainActivity.cs deleted file mode 100644 index f2e7376..0000000 --- a/LM-Kit-Maestro/Platforms/Android/MainActivity.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Android.App; -using Android.Content.PM; -using Android.OS; - -namespace LMKit.Maestro -{ - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] - public class MainActivity : MauiAppCompatActivity - { - } -} diff --git a/LM-Kit-Maestro/Platforms/Android/MainApplication.cs b/LM-Kit-Maestro/Platforms/Android/MainApplication.cs deleted file mode 100644 index 37874b4..0000000 --- a/LM-Kit-Maestro/Platforms/Android/MainApplication.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Android.App; -using Android.Runtime; - -namespace LMKit.Maestro -{ - [Application] - public class MainApplication : MauiApplication - { - public MainApplication(IntPtr handle, JniHandleOwnership ownership) - : base(handle, ownership) - { - } - - protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); - } -} diff --git a/LM-Kit-Maestro/Platforms/Android/Resources/values/colors.xml b/LM-Kit-Maestro/Platforms/Android/Resources/values/colors.xml deleted file mode 100644 index 5cd1604..0000000 --- a/LM-Kit-Maestro/Platforms/Android/Resources/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #512BD4 - #2B0B98 - #2B0B98 - \ No newline at end of file diff --git a/LM-Kit-Maestro/Platforms/Tizen/Main.cs b/LM-Kit-Maestro/Platforms/Tizen/Main.cs deleted file mode 100644 index 7fa9148..0000000 --- a/LM-Kit-Maestro/Platforms/Tizen/Main.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Microsoft.Maui; -using Microsoft.Maui.Hosting; - -namespace LMKit.Maestro -{ - internal class Program : MauiApplication - { - protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); - - static void Main(string[] args) - { - var app = new Program(); - app.Run(args); - } - } -} diff --git a/LM-Kit-Maestro/Platforms/Tizen/tizen-manifest.xml b/LM-Kit-Maestro/Platforms/Tizen/tizen-manifest.xml deleted file mode 100644 index afdfe1a..0000000 --- a/LM-Kit-Maestro/Platforms/Tizen/tizen-manifest.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - maui-appicon-placeholder - - - - - http://tizen.org/privilege/internet - - - - \ No newline at end of file diff --git a/LM-Kit-Maestro/Platforms/iOS/AppDelegate.cs b/LM-Kit-Maestro/Platforms/iOS/AppDelegate.cs deleted file mode 100644 index d44c057..0000000 --- a/LM-Kit-Maestro/Platforms/iOS/AppDelegate.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Foundation; - -namespace LMKit.Maestro -{ - [Register("AppDelegate")] - public class AppDelegate : MauiUIApplicationDelegate - { - protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); - } -} diff --git a/LM-Kit-Maestro/Platforms/iOS/Info.plist b/LM-Kit-Maestro/Platforms/iOS/Info.plist deleted file mode 100644 index 358337b..0000000 --- a/LM-Kit-Maestro/Platforms/iOS/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - LSRequiresIPhoneOS - - UIDeviceFamily - - 1 - 2 - - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - XSAppIconAssets - Assets.xcassets/appicon.appiconset - - diff --git a/LM-Kit-Maestro/Platforms/iOS/Program.cs b/LM-Kit-Maestro/Platforms/iOS/Program.cs deleted file mode 100644 index 89d7227..0000000 --- a/LM-Kit-Maestro/Platforms/iOS/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using ObjCRuntime; -using UIKit; - -namespace LMKit.Maestro -{ - public class Program - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof(AppDelegate)); - } - } -} diff --git a/LM-Kit-Maestro/Platforms/iOS/Resources/PrivacyInfo.xcprivacy b/LM-Kit-Maestro/Platforms/iOS/Resources/PrivacyInfo.xcprivacy deleted file mode 100644 index 1ea3a5d..0000000 --- a/LM-Kit-Maestro/Platforms/iOS/Resources/PrivacyInfo.xcprivacy +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - NSPrivacyAccessedAPITypes - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp - NSPrivacyAccessedAPITypeReasons - - C617.1 - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategorySystemBootTime - NSPrivacyAccessedAPITypeReasons - - 35F9.1 - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryDiskSpace - NSPrivacyAccessedAPITypeReasons - - E174.1 - - - - - - diff --git a/LM-Kit-Maestro/Services/LMKitService.cs b/LM-Kit-Maestro/Services/LMKitService.cs index 9279a83..7ef1291 100644 --- a/LM-Kit-Maestro/Services/LMKitService.cs +++ b/LM-Kit-Maestro/Services/LMKitService.cs @@ -423,7 +423,7 @@ private void BeforeSubmittingPrompt(Conversation conversation) { ChatHistory? chatHistory = shouldUseCurrentChatHistory ? conversation.ChatHistory : ChatHistory.Deserialize(conversation.LatestChatHistoryData, _model); - _multiTurnConversation = new MultiTurnConversation(_model, chatHistory) + _multiTurnConversation = new MultiTurnConversation(_model, chatHistory, LMKitConfig.ContextSize) { SamplingMode = GetTokenSampling(LMKitConfig), MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens, @@ -443,6 +443,17 @@ private void BeforeSubmittingPrompt(Conversation conversation) conversation.LastUsedModelUri = LMKitConfig.LoadedModelUri; _lastConversationUsed = conversation; } + else //updating sampling options, if any. + { + //todo: Implement a mechanism to determine whether SamplingMode and MaximumCompletionTokens need to be updated. + _multiTurnConversation.SamplingMode = GetTokenSampling(LMKitConfig); + _multiTurnConversation.MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens; + + if (LMKitConfig.ContextSize != _multiTurnConversation.ContextSize) + { + //todo: implement context size update. + } + } if (_singleTurnConversation == null) {