diff --git a/voice/voice-ai/Voice AI.xcodeproj/project.pbxproj b/voice/voice-ai/Voice AI.xcodeproj/project.pbxproj index 521f4a514..ef4da4b5c 100644 --- a/voice/voice-ai/Voice AI.xcodeproj/project.pbxproj +++ b/voice/voice-ai/Voice AI.xcodeproj/project.pbxproj @@ -84,13 +84,16 @@ A46B5A8C2AE73D5C00C874ED /* DashboardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD0D13392ADA73B300031EDD /* DashboardView.swift */; }; A4C5E8632AF6BF8E00B273E4 /* Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22CC4D7D2AF3C1C10072EC39 /* Store.swift */; }; A4C5E8642AF6BF9100B273E4 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22CC4D792AF3AD900072EC39 /* Persistence.swift */; }; + A4E2080C2B02B56C000909C5 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = A4E2080B2B02B56C000909C5 /* AppConfig.plist */; }; + A4E2080D2B02B56C000909C5 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = A4E2080B2B02B56C000909C5 /* AppConfig.plist */; }; + A4E2080E2B02B56C000909C5 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = A4E2080B2B02B56C000909C5 /* AppConfig.plist */; }; + A4E2080F2B02B56C000909C5 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = A4E2080B2B02B56C000909C5 /* AppConfig.plist */; }; B31CDCE32AFC561C00AB39EE /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B3BA792AFB40A300D8F8C6 /* Theme.swift */; }; B31CDCE42AFC565400AB39EE /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B346DF772AF562020023FC87 /* ThemeManager.swift */; }; B31CDCE52AFC565800AB39EE /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B3BA792AFB40A300D8F8C6 /* Theme.swift */; }; B346DF782AF562020023FC87 /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B346DF772AF562020023FC87 /* ThemeManager.swift */; }; B36367562AFC69F2000409FC /* RandomFactTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B31CDCE62AFC644D00AB39EE /* RandomFactTests.swift */; }; B36367572AFC6A04000409FC /* MockGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F1150D2AF825F700BC191C /* MockGenerator.swift */; }; - B38ADB9D2AFE0A0F006BDC93 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = F72708412AFD672E000DE81D /* AppConfig.plist */; }; B3C083B32AF1BADB0069232C /* MessageContextTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3C083B22AF1BADB0069232C /* MessageContextTests.swift */; }; B3D0A3442AF29B1B00E8B0DA /* MockNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3D0A3432AF29B1B00E8B0DA /* MockNetworkService.swift */; }; B91681282AFBA3A80006E463 /* ReviewRequester.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9B331A02AFB803500F6A9C9 /* ReviewRequester.swift */; }; @@ -158,7 +161,6 @@ F67E43342AFAC16C001B72CD /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = F67E43332AFAC16C001B72CD /* Sentry */; }; F723CC1F2AFECE2000B2A23A /* TextToSpeechConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F723CC1E2AFECE2000B2A23A /* TextToSpeechConverterTests.swift */; }; F723CC212AFEFFA400B2A23A /* MockAVSpeechSynthesizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F723CC202AFEFFA400B2A23A /* MockAVSpeechSynthesizer.swift */; }; - F72708422AFD672E000DE81D /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = F72708412AFD672E000DE81D /* AppConfig.plist */; }; F7C16FE82AFC576000D11529 /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B346DF772AF562020023FC87 /* ThemeManager.swift */; }; F7F115052AF8173300BC191C /* SpeechRecognitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F114F52AF8172800BC191C /* SpeechRecognitionTests.swift */; }; F7F115062AF8173300BC191C /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F114F72AF8172800BC191C /* StringTests.swift */; }; @@ -230,6 +232,7 @@ A46B5A632AE73B9D00C874ED /* sunUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = sunUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A46B5A672AE73B9D00C874ED /* sunUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = sunUITests.swift; sourceTree = ""; }; A46B5A692AE73B9D00C874ED /* sunUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = sunUITestsLaunchTests.swift; sourceTree = ""; }; + A4E2080B2B02B56C000909C5 /* AppConfig.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = AppConfig.plist; sourceTree = ""; }; B31CDCE62AFC644D00AB39EE /* RandomFactTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomFactTests.swift; sourceTree = ""; }; B346DF772AF562020023FC87 /* ThemeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeManager.swift; sourceTree = ""; }; B3B3BA792AFB40A300D8F8C6 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; @@ -281,7 +284,6 @@ F61049092AF02D820087F745 /* OpenAIStreamService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenAIStreamService.swift; sourceTree = ""; }; F723CC1E2AFECE2000B2A23A /* TextToSpeechConverterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextToSpeechConverterTests.swift; sourceTree = ""; }; F723CC202AFEFFA400B2A23A /* MockAVSpeechSynthesizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockAVSpeechSynthesizer.swift; sourceTree = ""; }; - F72708412AFD672E000DE81D /* AppConfig.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = AppConfig.plist; sourceTree = ""; }; F7F114F52AF8172800BC191C /* SpeechRecognitionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpeechRecognitionTests.swift; sourceTree = ""; }; F7F114F62AF8172800BC191C /* PermissionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PermissionTests.swift; sourceTree = ""; }; F7F114F72AF8172800BC191C /* StringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringTests.swift; sourceTree = ""; }; @@ -573,7 +575,7 @@ CD0D13402ADA73B400031EDD /* Preview Content */, 22CC4D752AF3AC300072EC39 /* Products.storekit */, 22A9883A2AF8FE0D00A32B1A /* SyncedProducts.storekit */, - F72708412AFD672E000DE81D /* AppConfig.plist */, + A4E2080B2B02B56C000909C5 /* AppConfig.plist */, ); path = x; sourceTree = ""; @@ -820,6 +822,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A4E2080F2B02B56C000909C5 /* AppConfig.plist in Resources */, A46B5A542AE73B9D00C874ED /* Preview Assets.xcassets in Resources */, A4680D9F2AE9C8A600F5F8ED /* beep.mp3 in Resources */, A46B5A782AE73CD300C874ED /* Dotrice-Bold.otf in Resources */, @@ -849,7 +852,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - F72708422AFD672E000DE81D /* AppConfig.plist in Resources */, + A4E2080C2B02B56C000909C5 /* AppConfig.plist in Resources */, CD0D13422ADA73B400031EDD /* Preview Assets.xcassets in Resources */, 22A9883B2AF8FE0D00A32B1A /* SyncedProducts.storekit in Resources */, CD0D133E2ADA73B400031EDD /* Assets.xcassets in Resources */, @@ -868,7 +871,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - B38ADB9D2AFE0A0F006BDC93 /* AppConfig.plist in Resources */, + A4E2080D2B02B56C000909C5 /* AppConfig.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -876,6 +879,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A4E2080E2B02B56C000909C5 /* AppConfig.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/voice/voice-ai/x/OpenAIService/OpenAIStreamService.swift b/voice/voice-ai/x/OpenAIService/OpenAIStreamService.swift index 3f9e630b4..08c38a9f8 100644 --- a/voice/voice-ai/x/OpenAIService/OpenAIStreamService.swift +++ b/voice/voice-ai/x/OpenAIService/OpenAIStreamService.swift @@ -96,7 +96,7 @@ class OpenAIStreamService: NSObject, URLSessionDataDelegate { "stream": true ] print("[OpenAI] Model used: \(model); Minutes elaspsed: \(miutesElasped)") - + print("[OpenAI] sent \(body)") // Validate the URL guard let url = URL(string: "https://api.openai.com/v1/chat/completions") else { diff --git a/voice/voice-ai/x/SpeechRecognition/SpeechRecognition.swift b/voice/voice-ai/x/SpeechRecognition/SpeechRecognition.swift index eabbf01fa..1300e4fd1 100644 --- a/voice/voice-ai/x/SpeechRecognition/SpeechRecognition.swift +++ b/voice/voice-ai/x/SpeechRecognition/SpeechRecognition.swift @@ -347,7 +347,6 @@ class SpeechRecognition: NSObject, ObservableObject, SpeechRecognitionProtocol { // ensure streams that do not have a whitespace in front are appended to the previous one (part of the previous stream) if !initialFlush { if self.speechDelimitingPunctuations.contains(currWord.last!) || buf.count == self.initialCapacity { - print("############ INITIAL FLUSH") flushBuf() initialFlush = true } @@ -367,7 +366,8 @@ class SpeechRecognition: NSObject, ObservableObject, SpeechRecognitionProtocol { } } - let limitedConversation = OpenAIUtils.limitConversationContext(conversation, charactersCount: 512) + var limitedConversation = OpenAIUtils.limitConversationContext(conversation, charactersCount: 512) + limitedConversation.append(contentsOf: OpenAIStreamService.setConversationContext()) pendingOpenAIStream?.query(conversation: limitedConversation) }