├── Brain ├── src │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ ├── brain_exception.py │ │ └── program_type.py │ ├── model │ │ ├── __init__.py │ │ ├── requests │ │ │ └── __init__.py │ │ ├── basic_model.py │ │ ├── image_model.py │ │ ├── sms_model.py │ │ ├── train_model.py │ │ ├── feedback_model.py │ │ ├── message_model.py │ │ ├── contact_model.py │ │ ├── chat_response_model.py │ │ └── req_model.py │ ├── router │ │ └── __init__.py │ ├── static │ │ └── __init__.py │ ├── commands │ │ └── __init__.py │ ├── firebase │ │ └── __init__.py │ ├── log_cycle │ │ ├── __init__.py │ │ └── json_handler.py │ ├── service │ │ ├── __init__.py │ │ ├── llm │ │ │ ├── __init__.py │ │ │ └── base.py │ │ ├── command_service.py │ │ ├── twilio_service.py │ │ ├── browser_service.py │ │ ├── auto_task_service.py │ │ ├── BabyAGIService.py │ │ └── feedback_service.py │ ├── rising_plugin │ │ ├── __init__.py │ │ ├── llm │ │ │ ├── __init__.py │ │ │ ├── gpt_llm.py │ │ │ └── falcon_llm.py │ │ ├── guardrails-config │ │ │ ├── __init__.py │ │ │ ├── actions │ │ │ │ ├── __init__.py │ │ │ │ └── actions.py │ │ │ ├── off-security.co │ │ │ ├── general.co │ │ │ └── config.yml │ │ ├── rails_validate.py │ │ └── csv_embed.py │ ├── singletone.py │ └── gradio_debug.py ├── tests │ ├── __init__.py │ ├── functional │ │ └── __init__.py │ └── conftest.py ├── assets │ └── img │ │ ├── logo.png │ │ ├── mvvp-arch.png │ │ ├── android_desc.png │ │ ├── brain-diagram.png │ │ ├── extension_desc.png │ │ ├── instruction.png │ │ ├── extension&watch.png │ │ ├── extension-diagram.png │ │ ├── extension-functionality.png │ │ └── .gitattributes ├── app.json └── README.md ├── Android ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── attrs.xml │ │ │ │ │ └── colors.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── gpt_icon.png │ │ │ │ │ ├── gpt_icon_round.png │ │ │ │ │ └── gpt_icon_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── gpt_icon.png │ │ │ │ │ ├── gpt_icon_round.png │ │ │ │ │ └── gpt_icon_foreground.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── gpt_icon.png │ │ │ │ │ ├── gpt_icon_round.png │ │ │ │ │ └── gpt_icon_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── gpt_icon.png │ │ │ │ │ ├── gpt_icon_round.png │ │ │ │ │ └── gpt_icon_foreground.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── gpt_icon.png │ │ │ │ │ ├── gpt_icon_round.png │ │ │ │ │ └── gpt_icon_foreground.png │ │ │ │ ├── drawable │ │ │ │ │ ├── image_logo.png │ │ │ │ │ ├── image_default_avatar.png │ │ │ │ │ ├── bg_dialog_confirm.xml │ │ │ │ │ ├── bg_circle_button_schedule_alarm_day.xml │ │ │ │ │ ├── bg_circle_button_schedule_alarm_day_selected.xml │ │ │ │ │ ├── bg_item_sent_message.xml │ │ │ │ │ ├── bg_item_error_message.xml │ │ │ │ │ ├── bg_item_received_message.xml │ │ │ │ │ ├── ic_arrow_left_thick.xml │ │ │ │ │ ├── bg_edittext_radius_small.xml │ │ │ │ │ ├── bg_item_chat_tool_radius.xml │ │ │ │ │ ├── ic_arrow_right_thick.xml │ │ │ │ │ ├── bg_circle_button_chat_control.xml │ │ │ │ │ ├── ic_upload.xml │ │ │ │ │ ├── ic_video.xml │ │ │ │ │ ├── ic_gallery.xml │ │ │ │ │ ├── ic_message_text.xml │ │ │ │ │ ├── bg_view_header.xml │ │ │ │ │ ├── ic_pencil.xml │ │ │ │ │ ├── ic_smart_loading.xml │ │ │ │ │ ├── ic_microphone.xml │ │ │ │ │ ├── ic_drafts.xml │ │ │ │ │ ├── ic_camera.xml │ │ │ │ │ ├── ic_add.xml │ │ │ │ │ ├── ic_info.xml │ │ │ │ │ ├── ic_attachment.xml │ │ │ │ │ ├── ic_attachment_48.xml │ │ │ │ │ ├── ic_phone.xml │ │ │ │ │ ├── ic_thumb_down.xml │ │ │ │ │ ├── ic_thumb_up.xml │ │ │ │ │ ├── ic_back.xml │ │ │ │ │ ├── ic_thumb_down_disable.xml │ │ │ │ │ ├── ic_thumb_up_disable.xml │ │ │ │ │ ├── ic_send.xml │ │ │ │ │ ├── ic_notification.xml │ │ │ │ │ ├── ic_cancel_schedule_send.xml │ │ │ │ │ ├── ic_logout.xml │ │ │ │ │ ├── ic_spinner.xml │ │ │ │ │ ├── ic_cog.xml │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── gpt_icon.xml │ │ │ │ │ ├── gpt_icon_round.xml │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-anydpi-v33 │ │ │ │ │ └── ic_launcher.xml │ │ │ │ ├── layout │ │ │ │ │ ├── activity_chat.xml │ │ │ │ │ ├── item_day_of_week.xml │ │ │ │ │ ├── widget_chat_tools.xml │ │ │ │ │ ├── item_help_prompt_key.xml │ │ │ │ │ ├── activity_splash.xml │ │ │ │ │ ├── item_container_chat_widget.xml │ │ │ │ │ ├── dialog_confirm.xml │ │ │ │ │ ├── item_chat_tool.xml │ │ │ │ │ ├── item_container_sent_message.xml │ │ │ │ │ ├── item_container_error_message.xml │ │ │ │ │ ├── item_container_received_message.xml │ │ │ │ │ └── view_header.xml │ │ │ │ ├── xml │ │ │ │ │ ├── backup_rules.xml │ │ │ │ │ └── data_extraction_rules.xml │ │ │ │ └── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── gpt_icon-playstore.png │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── matthaigh27 │ │ │ │ └── chatgptwrapper │ │ │ │ ├── ui │ │ │ │ ├── chat │ │ │ │ │ └── view │ │ │ │ │ │ ├── widgets │ │ │ │ │ │ ├── chatwidget │ │ │ │ │ │ │ ├── FeedbackWidget.kt │ │ │ │ │ │ │ ├── helpprompt │ │ │ │ │ │ │ │ └── HelpPromptKeyItem.kt │ │ │ │ │ │ │ └── mail │ │ │ │ │ │ │ │ └── MailWidget.kt │ │ │ │ │ │ └── toolbar │ │ │ │ │ │ │ └── ChatToolItem.kt │ │ │ │ │ │ ├── interfaces │ │ │ │ │ │ ├── OnHideListener.kt │ │ │ │ │ │ └── ChatMessageInterface.kt │ │ │ │ │ │ └── ChatActivity.kt │ │ │ │ ├── base │ │ │ │ │ └── BaseActivity.kt │ │ │ │ └── setting │ │ │ │ │ └── viewmodel │ │ │ │ │ └── SettingViewModel.kt │ │ │ │ ├── data │ │ │ │ ├── models │ │ │ │ │ ├── common │ │ │ │ │ │ └── Time.kt │ │ │ │ │ ├── chat │ │ │ │ │ │ ├── HelpCommandModel.kt │ │ │ │ │ │ ├── ImageModel.kt │ │ │ │ │ │ ├── ImageRelatenessModel.kt │ │ │ │ │ │ ├── AlarmModel.kt │ │ │ │ │ │ ├── MailModel.kt │ │ │ │ │ │ ├── ContactModel.kt │ │ │ │ │ │ ├── ChatMessageModel.kt │ │ │ │ │ │ ├── HelpPromptModel.kt │ │ │ │ │ │ └── AutoTaskModel.kt │ │ │ │ │ ├── chatwidgetprops │ │ │ │ │ │ ├── MailsProps.kt │ │ │ │ │ │ └── ScheduleAlarmProps.kt │ │ │ │ │ └── setting │ │ │ │ │ │ └── SettingModel.kt │ │ │ │ ├── remote │ │ │ │ │ ├── requests │ │ │ │ │ │ ├── common │ │ │ │ │ │ │ ├── OpenAISetting.kt │ │ │ │ │ │ │ └── Keys.kt │ │ │ │ │ │ ├── BaseApiRequest.kt │ │ │ │ │ │ ├── NotificationApiRequest.kt │ │ │ │ │ │ ├── TrainImageApiRequest.kt │ │ │ │ │ │ ├── ImageRelatednessApiRequest.kt │ │ │ │ │ │ ├── TrainContactsApiRequest.kt │ │ │ │ │ │ ├── ReadMailApiRequest.kt │ │ │ │ │ │ └── ComposeMailApiRequest.kt │ │ │ │ │ ├── responses │ │ │ │ │ │ ├── results │ │ │ │ │ │ │ ├── TrainImageResult.kt │ │ │ │ │ │ │ ├── CommonResult.kt │ │ │ │ │ │ │ ├── ImageRelatenessResult.kt │ │ │ │ │ │ │ └── HelpCommandResult.kt │ │ │ │ │ │ └── ApiResponse.kt │ │ │ │ │ ├── ApiResource.kt │ │ │ │ │ └── ApiClient.kt │ │ │ │ ├── local │ │ │ │ │ ├── entity │ │ │ │ │ │ ├── ContactEntity.kt │ │ │ │ │ │ └── ImageEntity.kt │ │ │ │ │ ├── dao │ │ │ │ │ │ ├── ImageDao.kt │ │ │ │ │ │ └── ContactDao.kt │ │ │ │ │ └── AppDatabase.kt │ │ │ │ └── repository │ │ │ │ │ ├── SharedPreferencesRepository.kt │ │ │ │ │ └── RoomRepository.kt │ │ │ │ ├── utils │ │ │ │ ├── helpers │ │ │ │ │ ├── network │ │ │ │ │ │ └── CallbackTypes.kt │ │ │ │ │ ├── CallbackTypes.kt │ │ │ │ │ ├── chat │ │ │ │ │ │ ├── MailHelper.kt │ │ │ │ │ │ ├── AlarmReceiver.kt │ │ │ │ │ │ └── SettingHelper.kt │ │ │ │ │ ├── ui │ │ │ │ │ │ └── NoNewLineInputFilter.kt │ │ │ │ │ └── Converter.kt │ │ │ │ └── constants │ │ │ │ │ ├── TypeChatWidgetConstants.kt │ │ │ │ │ ├── TypeResponseConstants.kt │ │ │ │ │ └── CommonConstants.kt │ │ │ │ └── RisingApplication.kt │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── matthaigh27 │ │ │ │ └── chatgptwrapper │ │ │ │ └── ExampleUnitTest.kt │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── matthaigh27 │ │ │ └── chatgptwrapper │ │ │ └── ExampleInstrumentedTest.kt │ └── proguard-rules.pro ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── assets │ └── img │ │ ├── sms.png │ │ ├── alarm.png │ │ ├── browser.png │ │ ├── contact.png │ │ ├── desc.png │ │ ├── general.png │ │ ├── image.png │ │ ├── setting.png │ │ ├── architecture.png │ │ └── real-time.png ├── .gitignore ├── settings.gradle ├── build.gradle └── gradle.properties ├── runtime.txt ├── Extension ├── src │ ├── pages │ │ ├── Options │ │ │ ├── index.css │ │ │ ├── Options.css │ │ │ ├── Options.tsx │ │ │ ├── index.html │ │ │ └── index.jsx │ │ ├── Panel │ │ │ ├── index.css │ │ │ ├── FirebaseApp │ │ │ │ └── firebase-app.js │ │ │ ├── index.html │ │ │ ├── index.jsx │ │ │ ├── BouncingDotsLoader │ │ │ │ ├── index.jsx │ │ │ │ └── index.css │ │ │ ├── Message │ │ │ │ ├── index.jsx │ │ │ │ └── index.css │ │ │ └── Panel.css │ │ ├── Content │ │ │ ├── content.styles.css │ │ │ └── index.js │ │ ├── Popup │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── index.jsx │ │ │ └── Popup.css │ │ ├── Newtab │ │ │ ├── Newtab.scss │ │ │ ├── index.html │ │ │ ├── index.jsx │ │ │ ├── Newtab.jsx │ │ │ ├── index.css │ │ │ └── Newtab.css │ │ ├── Devtools │ │ │ ├── index.js │ │ │ └── index.html │ │ └── Background │ │ │ └── index.js │ ├── assets │ │ └── img │ │ │ ├── icon-34.png │ │ │ ├── logo.png │ │ │ ├── icon-128.png │ │ │ └── logo_panel.png │ ├── containers │ │ └── Greetings │ │ │ └── Greetings.jsx │ └── manifest.json ├── .prettierignore ├── .babelrc ├── .eslintrc ├── .prettierrc ├── utils │ ├── env.js │ ├── build.js │ └── webserver.js ├── .gitignore ├── .eslintrc.json └── tsconfig.json ├── .slugignore ├── WatchApp ├── WatchApp Watch App │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── .DS_Store │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Values │ │ ├── Strings.swift │ │ ├── File.swift │ │ └── Constants.swift │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── MainView.swift │ ├── WatchAppApp.swift │ ├── Components │ │ ├── ImageRow.swift │ │ └── ContactRow.swift │ └── Pages │ │ ├── SettingView.swift │ │ └── ContactView.swift ├── WatchApp.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ └── darkhorse.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ └── darkhorse.xcuserdatad │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── WatchApp Watch AppUITests │ ├── WatchApp_Watch_AppUITestsLaunchTests.swift │ └── WatchApp_Watch_AppUITests.swift └── WatchApp Watch AppTests │ └── WatchApp_Watch_AppTests.swift ├── .gitattributes ├── CONTRIBUTING.md ├── .gitignore ├── requirements.txt ├── sauce_tests ├── 03 Add Feedback │ ├── input.yaml │ └── unit.yaml ├── 05 Get Commands │ ├── input.yaml │ └── unit.yaml ├── 02 Upload Image │ ├── input.yaml │ ├── README.md │ └── unit.yaml ├── 04 Get Feedback │ ├── input.yaml │ └── unit.yaml ├── 06 Rising Chat │ └── input.yaml ├── 07 Train Contacts │ ├── input.yaml │ └── unit.yaml ├── 01 Send Notification │ ├── input.yaml │ ├── README.md │ └── unit.yaml └── 08 Image Relatedness │ └── input.yaml ├── .github └── workflows │ ├── cd.yml │ ├── lint.yml │ ├── brain_ci.yml │ ├── extension_main.yml │ └── android.yml ├── .sauce └── config.yml ├── LICENSE └── app.py /Brain/src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /Brain/src/common/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/model/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/router/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/static/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/firebase/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/log_cycle/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/service/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/service/llm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.11.2 2 | -------------------------------------------------------------------------------- /Brain/src/model/requests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/tests/functional/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extension/src/pages/Options/index.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extension/src/pages/Panel/index.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/llm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extension/src/pages/Content/content.styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.slugignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.log 3 | *.tmp 4 | *.pyc 5 | *.pyo -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/actions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extension/src/pages/Popup/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } -------------------------------------------------------------------------------- /Extension/.prettierignore: -------------------------------------------------------------------------------- 1 | build/ 2 | src/manifest.json 3 | src/manifest.v2.json -------------------------------------------------------------------------------- /Extension/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"] 3 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Extension/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "react-app", 3 | "globals": { 4 | "chrome": "readonly" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Extension/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5", 4 | "requirePragma": false, 5 | "arrowParens": "always" 6 | } -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.gif filter=lfs diff=lfs merge=lfs -text 2 | *.jpg filter=lfs diff=lfs merge=lfs -text 3 | *.png filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Values/Strings.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct String { 4 | static let app: String = CGSt("RisingWatch") 5 | } 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/Newtab.scss: -------------------------------------------------------------------------------- 1 | $myColor: orange; 2 | 3 | h1, 4 | h2, 5 | h3, 6 | h4, 7 | h5, 8 | h6 { 9 | color: $myColor; 10 | } 11 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/WatchApp/WatchApp Watch App/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We love pull requests. We will require you sign our cla. Please make sure tests and lints pass. Any new features require new tests and docs. 2 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /Android/assets/img/sms.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e8d6e40a1bde2e161d4fef6a681fc4723780208c5828a19d8128ddcd6eee455 3 | size 86572 4 | -------------------------------------------------------------------------------- /Brain/assets/img/logo.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0e39d4635ecf0e5438aa0828d45a341367c2b8d8b364ccda8d3c32be2ce877f1 3 | size 56375 4 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /Android/assets/img/alarm.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a7a63227071018855c41c9cdf30b63487920121a9e3df23d2502e4bad5c8c507 3 | size 100025 4 | -------------------------------------------------------------------------------- /Android/assets/img/browser.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c5835b53f8e8f1f460c798bcb7efefadf627b649a46c987bb540a476a657a0ca 3 | size 66211 4 | -------------------------------------------------------------------------------- /Android/assets/img/contact.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eb5440fca5b9911cde37389b39e5b5e42301a8635fc02bef3b5dc554ea8d98ea 3 | size 137538 4 | -------------------------------------------------------------------------------- /Android/assets/img/desc.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef177a457eea53d59685cfa0aa7b3f9e4854684caa191bbd631a1d493cd474f7 3 | size 146697 4 | -------------------------------------------------------------------------------- /Android/assets/img/general.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dc2773a87dc27e91bece9e3565c915e16b62ba92a17b70ca5083119cbaaf0813 3 | size 214592 4 | -------------------------------------------------------------------------------- /Android/assets/img/image.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c77808b9e0e909c6e4271b0456e9db30cae865207ed16a0a276d178c6ea6282b 3 | size 146493 4 | -------------------------------------------------------------------------------- /Android/assets/img/setting.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6261dcb1e00cbae11a4fca6f123c12ef906af75ec9d42f839d39f4751b6fc76f 3 | size 67092 4 | -------------------------------------------------------------------------------- /Brain/assets/img/mvvp-arch.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3d53c5a53f60387c3bba2ee47eafb411f5404567187b4e628078bf801eaf53ed 3 | size 261580 4 | -------------------------------------------------------------------------------- /Android/assets/img/architecture.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:357f0a9041afdadb05912cedd1b98b4dbac0daeb42b79806db1bec316a279c57 3 | size 91702 4 | -------------------------------------------------------------------------------- /Android/assets/img/real-time.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c8eff263b6bf6ccb763d1eab6c61f5afce08cd130c64f8ead595a33b5de623a1 3 | size 162771 4 | -------------------------------------------------------------------------------- /Brain/assets/img/android_desc.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09c07616c4be017967059aa25c104ae942a06c1b20fe74e4f1571db107db75af 3 | size 132811 4 | -------------------------------------------------------------------------------- /Brain/assets/img/brain-diagram.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e7ec8430085fd6fe71290318c7926ddd5f507f80bda83f4c9ae5ba763acf4ecb 3 | size 90528 4 | -------------------------------------------------------------------------------- /Brain/assets/img/extension_desc.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e40dc04105cf21da44777fdf09ff81d90a137e4ed0242908601310d27af1664 3 | size 233140 4 | -------------------------------------------------------------------------------- /Brain/assets/img/instruction.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:47df40dd2e6db1ed00162cb6aee4fa4254622565875696fa61ae56bb98ce4eac 3 | size 423868 4 | -------------------------------------------------------------------------------- /Extension/src/assets/img/icon-34.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3158ed929ca88782cf86411d53aa7386323f4a94e9a18c080e550ffdf8b45c3c 3 | size 4843 4 | -------------------------------------------------------------------------------- /Extension/src/assets/img/logo.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:18962d95ea4d7bc16cc79ef92e85706fd6470dfc376f035395c64e2cd919ba03 3 | size 123578 4 | -------------------------------------------------------------------------------- /Extension/src/pages/Devtools/index.js: -------------------------------------------------------------------------------- 1 | chrome.devtools.panels.create( 2 | 'Dev Tools from chrome-extension-boilerplate-react', 3 | 'icon-34.png', 4 | 'panel.html' 5 | ); 6 | -------------------------------------------------------------------------------- /Brain/assets/img/extension&watch.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78f3f298b7ce05a29724931be822429eb1d7e6b42f755e359b40aaca7c30b7d4 3 | size 648597 4 | -------------------------------------------------------------------------------- /Brain/assets/img/extension-diagram.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:622e25104a2ac879fbc642d91d50af20900aceac85f4edf44f99413737231675 3 | size 110403 4 | -------------------------------------------------------------------------------- /Extension/src/assets/img/icon-128.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:91b10dac827ece1b07da534c0591b0c36d7d06da49ee087e04e9f7de1822d6d5 3 | size 21097 4 | -------------------------------------------------------------------------------- /Extension/src/assets/img/logo_panel.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9b1b64be0a7d72ca4ea374a4e9ef883e17f0526770f875f379accf8c383ea6f 3 | size 42051 4 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Values/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // WatchApp Watch App 4 | // 5 | // Created by DarkHorse on 7/9/23. 6 | // 7 | 8 | import Foundation 9 | -------------------------------------------------------------------------------- /Android/app/src/main/gpt_icon-playstore.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3c375c645675377978ce6aea4d60718033df4b96b209152d1f48717557161387 3 | size 32854 4 | -------------------------------------------------------------------------------- /Brain/assets/img/extension-functionality.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:80a0cd361985b42fe61c76599ba6143b28ef5a24ca166db1f185c8df624db7c5 3 | size 681241 4 | -------------------------------------------------------------------------------- /Extension/utils/env.js: -------------------------------------------------------------------------------- 1 | // tiny wrapper with default env vars 2 | module.exports = { 3 | NODE_ENV: process.env.NODE_ENV || 'development', 4 | PORT: process.env.PORT || 3000, 5 | }; 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/image_logo.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9b1b64be0a7d72ca4ea374a4e9ef883e17f0526770f875f379accf8c383ea6f 3 | size 42051 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/gpt_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:87ee43cbb7f2e9eb14edb3f03273cbfc648d605f60f5e9d78574fe1597597ecc 3 | size 2716 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/gpt_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0f384b63bdae3535d1339f98ac73893b766648b4fcdc34056fffa15b78288c0f 3 | size 1873 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/gpt_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c205978234a1394260fedfe1e3a3f011bc43825cddd14f3e8564cd856d349324 3 | size 3810 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/gpt_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7a036b0e745fafbc900316b553d78bd2447bfb2fec8dc6d3c1f3cf1847082679 3 | size 5769 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/gpt_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:951b65b3c098346448348953776c2801776d33c159970a6bc634c1de9b47b033 3 | size 7865 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/gpt_icon_round.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c835aeb6ff48c9dd2bded8194ffaa05604e24e2e4d477ca28026706ee6ed580f 3 | size 4341 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/gpt_icon_round.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:266d8a65181a1e5bd0471e59d06ac912c377cf7f346de281423f859a67aafd16 3 | size 2785 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/gpt_icon_round.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:38bbf5ec1bfdda071c7396d762c49d54778d5250c9c1686d6bb780669cb8e598 3 | size 5998 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/gpt_icon_round.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2e21eaf7117788be1c2b749d9a9fb8c459cf3c9b821e1ae6bd6bab29d87b1355 3 | size 9588 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Brain/firebase_cred.json 2 | .idea 3 | .vscode 4 | Brain/firebase_cred.json 5 | Brain/logs/* 6 | **/.DS_Store 7 | **/__pycache__ 8 | **/google-services.json 9 | brain.egg-info 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/image_default_avatar.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:494bc13ea482fef1e6a6d1e46f2ee0554892479e227545cbcb46c66e4ebabaab 3 | size 9723 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/gpt_icon_foreground.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:85f8453d5e0b8c1036a185898f8617c3340c60afafc37add81848a40161b9abc 3 | size 4335 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/gpt_icon_foreground.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1c3bc3235483c33acce567c9185f6060c1d834c08a6e3c3b1234d5d5c4b26b97 3 | size 2881 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/gpt_icon_foreground.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:062e9e590e14b4e1806129395af47221ff03d8fd550f3d466502a8c9f52bcec0 3 | size 5831 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/gpt_icon_foreground.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:36ddae38bf8ca8993274d3c73e047b55718323ab363d783f87b51bcae7bd67ed 3 | size 9600 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/gpt_icon_round.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:014111fd3d388c329f1323ae6f264db1ea429c38795caf656d619d79a2e8345c 3 | size 13279 4 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/gpt_icon_foreground.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7154d1e4b5e7eb003355cca93d794a3bc78cf260e8dd61913e2b2434cbe9c3d3 3 | size 13974 4 | -------------------------------------------------------------------------------- /Extension/src/pages/Devtools/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Extension/src/pages/Options/Options.css: -------------------------------------------------------------------------------- 1 | .OptionsContainer { 2 | width: 100%; 3 | height: 50vh; 4 | font-size: 2rem; 5 | display: flex; 6 | align-items: center; 7 | justify-content: center; 8 | } 9 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/chat/view/widgets/chatwidget/FeedbackWidget.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.chat.view.widgets.chatwidget 2 | 3 | class FeedbackWidget { 4 | } -------------------------------------------------------------------------------- /Brain/src/service/llm/base.py: -------------------------------------------------------------------------------- 1 | from typing import TypedDict 2 | 3 | 4 | class Message(TypedDict): 5 | """OpenAI Message object containing a role and the message content""" 6 | 7 | role: str 8 | content: str 9 | -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/Time.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.common 2 | 3 | data class Time ( 4 | val hour:Int, 5 | val minute:Int, 6 | val second:Int, 7 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/common/OpenAISetting.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests.common 2 | 3 | data class OpenAISetting( 4 | val temperature: Float 5 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/network/CallbackTypes.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers.network 2 | 3 | typealias OnSuccess = (T) -> Unit 4 | typealias OnFailure = (T) -> Unit -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/HelpCommandModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | data class HelpCommandModel( 4 | var main: String? = null, 5 | var assist: String? = null 6 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/CallbackTypes.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers 2 | 3 | typealias OnSuccess = (T) -> Unit 4 | typealias OnFailure = (T) -> Unit 5 | 6 | typealias OnHide = () -> Unit -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/ImageModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | import android.net.Uri 4 | 5 | data class ImageModel( 6 | val uri: Uri, 7 | val modifiedDate: Long 8 | ) 9 | -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcuserdata/darkhorse.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttt246/Brain/HEAD/WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcuserdata/darkhorse.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/ImageRelatenessModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | data class ImageRelatenessModel( 4 | val image: ByteArray? = null, 5 | val description: String? = null 6 | ) -------------------------------------------------------------------------------- /Extension/src/pages/Panel/FirebaseApp/firebase-app.js: -------------------------------------------------------------------------------- 1 | import { initializeApp } from "firebase/app"; 2 | import * as firebaseConfig from "../../../configs/firebase-config.json" 3 | 4 | // initialize app 5 | const app = initializeApp(firebaseConfig); 6 | export default app; 7 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/AlarmModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | data class AlarmModel( 4 | val id: Int, 5 | val time: Long, 6 | val enabled: Boolean, 7 | val label: String 8 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/responses/results/TrainImageResult.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.responses.results 2 | 3 | data class TrainImageResult( 4 | val image_name: String, 5 | val image_text: String 6 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/responses/ApiResponse.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.responses 2 | 3 | data class ApiResponse( 4 | val status_code: Int, 5 | val message: List, 6 | val result: T 7 | ) 8 | -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 16 01:44:59 EDT 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/BaseApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class BaseApiRequest( 6 | val confs: Keys 7 | ) 8 | 9 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_dialog_confirm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/responses/results/CommonResult.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.responses.results 2 | 3 | import com.google.gson.JsonElement 4 | 5 | data class CommonResult( 6 | val program: String, 7 | val content: JsonElement 8 | ) -------------------------------------------------------------------------------- /Brain/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatgptphone", 3 | "description": "chatgptphone flask app using langchain", 4 | "repository": "https://github.com/ttt246/risinglangchain", 5 | "logo": "https://flask.palletsprojects.com/en/2.2.x/_static/flask-icon.png", 6 | "keywords": ["python", "langchain", "chatgpt"] 7 | } -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/chat/view/interfaces/OnHideListener.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.chat.view.interfaces 2 | 3 | /** 4 | * This interface is used to retrieve hide event when a user closes chat widgets. 5 | */ 6 | interface OnHideListener { 7 | fun hide() 8 | } -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "watchos", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | bs4 2 | colorama 3 | gradio 4 | faiss-cpu 5 | fastapi 6 | firebase 7 | firebase-admin 8 | langchain 9 | marshmallow 10 | nemoguardrails 11 | openai 12 | pinecone-client 13 | replicate 14 | socks 15 | twilio 16 | user_agents 17 | uvicorn 18 | 19 | black 20 | pytest 21 | pytest-cov 22 | pytest-xdist 23 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-anydpi-v26/gpt_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Options/Options.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Options.css'; 3 | 4 | interface Props { 5 | title: string; 6 | } 7 | 8 | const Options: React.FC = ({ title }: Props) => { 9 | return
{title} Page
; 10 | }; 11 | 12 | export default Options; 13 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-anydpi-v26/gpt_icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Popup/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Popup 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/NotificationApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class NotificationApiRequest( 6 | val message: String, 7 | val confs: Keys 8 | ) -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_circle_button_schedule_alarm_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_circle_button_schedule_alarm_day_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_item_sent_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Options/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Settings 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/MailModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | data class MailModel( 4 | val from: String, 5 | val to: String, 6 | val date: String, 7 | val cc: String, 8 | val subject: String, 9 | val body: String, 10 | ) 11 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/chat/MailHelper.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers.chat 2 | 3 | object MailHelper { 4 | fun isGmail(email: String): Boolean { 5 | return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches() && email.endsWith("@gmail.com") 6 | } 7 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_item_error_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Chatbot Chrome Extension 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /Extension/src/pages/Panel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dev Tools Panel 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_item_received_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | /app/google-services.json 18 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/ContactModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | data class ContactModel( 4 | var contactId: String = String(), 5 | var displayName: String = String(), 6 | var phoneNumbers: ArrayList = ArrayList(), 7 | var status: String = String() 8 | ) 9 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/MainView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct MainView: View { 4 | 5 | var body: some View { 6 | NavigationView { 7 | ChatView() 8 | } 9 | } 10 | } 11 | 12 | struct MainView_Previews: PreviewProvider { 13 | static var previews: some View { 14 | MainView() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/WatchAppApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchAppApp.swift 3 | // WatchApp Watch App 4 | // 5 | // Created by DarkHorse on 6/28/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct WatchApp_Watch_AppApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | MainView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Extension/src/pages/Panel/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | 4 | import Panel from './Panel'; 5 | import './index.css'; 6 | 7 | const container = document.getElementById('app-container'); 8 | const root = createRoot(container); // createRoot(container!) if you use TypeScript 9 | root.render(); 10 | -------------------------------------------------------------------------------- /Extension/src/pages/Popup/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | 4 | import Popup from './Popup'; 5 | import './index.css'; 6 | 7 | const container = document.getElementById('app-container'); 8 | const root = createRoot(container); // createRoot(container!) if you use TypeScript 9 | root.render(); 10 | -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | 4 | import Newtab from './Newtab'; 5 | import './index.css'; 6 | 7 | const container = document.getElementById('app-container'); 8 | const root = createRoot(container); // createRoot(container!) if you use TypeScript 9 | root.render(); 10 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/TrainImageApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class TrainImageApiRequest( 6 | val image_name: String, 7 | val status: String, 8 | val confs: Keys 9 | ) 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_arrow_left_thick.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/ImageRelatednessApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class ImageRelatednessApiRequest( 6 | val image_name: String, 7 | val message: String, 8 | val confs: Keys 9 | ) 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_edittext_radius_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_item_chat_tool_radius.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_arrow_right_thick.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Options/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | 4 | import Options from './Options'; 5 | import './index.css'; 6 | 7 | const container = document.getElementById('app-container'); 8 | const root = createRoot(container); // createRoot(container!) if you use TypeScript 9 | root.render(); 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_circle_button_chat_control.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /sauce_tests/03 Add Feedback/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /feedback 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /sauce_tests/05 Get Commands/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /commands 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Brain/src/service/command_service.py: -------------------------------------------------------------------------------- 1 | """service to manage command""" 2 | from typing import Any 3 | 4 | from Brain.src.commands.command import CommandRegistry 5 | 6 | 7 | class CommandService: 8 | """get commands""" 9 | 10 | def __init__(self): 11 | self.command_registry = CommandRegistry() 12 | 13 | def get(self) -> Any: 14 | return self.command_registry.get_all_commands() 15 | -------------------------------------------------------------------------------- /sauce_tests/02 Upload Image/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /uploadImage 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /sauce_tests/04 Get Feedback/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /feedback/test/1 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default -------------------------------------------------------------------------------- /sauce_tests/06 Rising Chat/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /chat_rising 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ContactEntity.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.local.entity 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | 6 | @Entity(tableName = "contacts") 7 | data class ContactEntity( 8 | @PrimaryKey(autoGenerate = false) val id: String, 9 | val name: String, 10 | val phoneNumber: String, 11 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/responses/results/ImageRelatenessResult.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.responses.results 2 | 3 | data class ImageRelatenessResult( 4 | val program: String, 5 | val content: ImageRelatenessContent 6 | ) 7 | 8 | data class ImageRelatenessContent( 9 | val image_name: String, 10 | val image_desc: String 11 | ) -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_upload.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_video.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sauce_tests/07 Train Contacts/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /train/contacts 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/ChatMessageModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | import com.google.gson.JsonElement 4 | 5 | data class ChatMessageModel( 6 | val type: Int, 7 | val content: String? = null, 8 | val data: JsonElement? = null, 9 | val hasImage: Boolean = false, 10 | val image: ByteArray? = null, 11 | ) 12 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_gallery.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_message_text.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/Newtab.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Newtab.css'; 3 | import './Newtab.scss'; 4 | 5 | const Newtab = () => { 6 | return ( 7 |
8 |
9 |

10 | Please remove the Chatbot Chrome extension 11 |

12 |
13 |
14 | ); 15 | }; 16 | 17 | export default Newtab; 18 | -------------------------------------------------------------------------------- /sauce_tests/01 Send Notification/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /sendNotification 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /sauce_tests/08 Image Relatedness/input.yaml: -------------------------------------------------------------------------------- 1 | - id: global 2 | children: 3 | - id: variable 4 | name: protocol 5 | value: https:// 6 | - id: variable 7 | name: domain 8 | value: ttt246-brain.hf.space 9 | - id: variable 10 | name: endpoint 11 | value: /image_relatedness 12 | - id: sets 13 | children: 14 | - id: set 15 | children: [] 16 | name: default 17 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/TrainContactsApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.models.chat.ContactModel 4 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 5 | 6 | data class TrainContactsApiRequest( 7 | val contacts: ArrayList, 8 | val confs: Keys 9 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/common/Keys.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests.common 2 | 3 | 4 | data class Keys( 5 | val uuid: String, 6 | val token: String, 7 | val openai_key: String, 8 | val pinecone_key: String, 9 | val pinecone_env: String, 10 | val firebase_key: String, 11 | val settings: OpenAISetting, 12 | ) 13 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ImageEntity.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.local.entity 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | 6 | @Entity(tableName = "images") 7 | data class ImageEntity( 8 | @PrimaryKey(autoGenerate = true) val id: Int, 9 | val path: String, 10 | val name: String, 11 | val dataModified: Long 12 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiResource.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote 2 | 3 | sealed class ApiResource( 4 | val data: T? = null, val message: String? = null 5 | ) { 6 | class Success(data: T) : ApiResource(data) 7 | class Error(message: String, data: T? = null) : ApiResource(data, message) 8 | class Loading(data: T? = null) : ApiResource(data) 9 | } -------------------------------------------------------------------------------- /Extension/src/pages/Panel/BouncingDotsLoader/index.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import './index.css' 3 | 4 | const BouncingDotsLoader = () => { 5 | return ( 6 | <> 7 |
8 |
9 |
10 |
11 |
12 | 13 | ); 14 | }; 15 | 16 | export default BouncingDotsLoader; 17 | -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/bg_view_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_pencil.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "keychain-swift", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/evgenyneu/keychain-swift.git", 7 | "state" : { 8 | "revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9", 9 | "version" : "20.0.0" 10 | } 11 | } 12 | ], 13 | "version" : 2 14 | } 15 | -------------------------------------------------------------------------------- /Android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | maven { url 'https://jitpack.io' } 14 | } 15 | } 16 | rootProject.name = "ChatGPT" 17 | include ':app' 18 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/ReadMailApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class ReadMailApiRequest( 6 | val data: ReadMailData, 7 | val confs: Keys 8 | ) 9 | 10 | data class ReadMailData( 11 | val sender: String, 12 | val pwd: String, 13 | val imap_folder: String, 14 | ) -------------------------------------------------------------------------------- /Extension/src/pages/Content/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom' 3 | import DraggablePanel from './modules/DraggablePanel' 4 | 5 | const element = document.createElement('div') 6 | element.style.position = 'fixed' 7 | element.style.zIndex = 99999 8 | element.style.right = 100 + 'px' 9 | element.style.bottom = 100 + 'px' 10 | document.documentElement.appendChild(element) 11 | 12 | ReactDOM.render(, element); 13 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_smart_loading.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Extension/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # zip 13 | /zip 14 | 15 | # .idea 16 | /.idea 17 | 18 | #configs 19 | /src/configs 20 | 21 | # misc 22 | .DS_Store 23 | .env.local 24 | .env.development.local 25 | .env.test.local 26 | .env.production.local 27 | .history 28 | 29 | # secrets 30 | secrets.*.js 31 | -------------------------------------------------------------------------------- /Brain/src/model/basic_model.py: -------------------------------------------------------------------------------- 1 | # Basic model for querying including prompt and completion both 2 | class BasicModel: 3 | def __init__(self, image_name: str, message: str): 4 | self.image_name = image_name 5 | self.message = message 6 | 7 | def to_json(self): 8 | return {"image_name": self.image_name, "message": self.message} 9 | 10 | 11 | class DataStatus: 12 | CREATED = "created" 13 | UPDATED = "updated" 14 | DELETED = "deleted" 15 | -------------------------------------------------------------------------------- /Brain/src/model/image_model.py: -------------------------------------------------------------------------------- 1 | """Image model to process & handle them""" 2 | from typing import Any 3 | 4 | from Brain.src.model.basic_model import DataStatus 5 | 6 | 7 | class ImageModel: 8 | def __init__(self): 9 | self.image_text = "" 10 | self.image_name = "" 11 | self.uuid = "" 12 | self.status = DataStatus.CREATED 13 | 14 | def to_json(self) -> Any: 15 | return {"image_name": self.image_name, "image_text": self.image_text} 16 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_microphone.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extension/src/containers/Greetings/Greetings.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import icon from '../../assets/img/icon-128.png'; 3 | 4 | class GreetingComponent extends Component { 5 | state = { 6 | name: 'dev', 7 | }; 8 | 9 | render() { 10 | return ( 11 |
12 |

Hello, {this.state.name}!

13 | extension icon 14 |
15 | ); 16 | } 17 | } 18 | 19 | export default GreetingComponent; 20 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_drafts.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/test/java/com/matthaigh27/chatgptwrapper/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/responses/results/HelpCommandResult.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.responses.results 2 | 3 | data class HelpCommandResult( 4 | val program: String, 5 | val content: ArrayList 6 | ) 7 | 8 | data class HelpCommandResponseItem( 9 | val name: String, 10 | val description: String, 11 | val prompt: String, 12 | val tags: ArrayList, 13 | val enabled: Boolean 14 | ) -------------------------------------------------------------------------------- /Extension/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": ["eslint:recommended", "plugin:react/recommended"], 7 | "overrides": [], 8 | "parserOptions": { 9 | "ecmaVersion": "latest", 10 | "sourceType": "module" 11 | }, 12 | "rules": { 13 | "react/react-in-jsx-scope": "off" 14 | }, 15 | "ignorePatterns": ["build/**", "build.mjs"], 16 | "settings": { 17 | "react": { 18 | "version": "detect" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/rails_validate.py: -------------------------------------------------------------------------------- 1 | """validate rails result: 2 | checking with program whether is it message or rails_off_topic""" 3 | import json 4 | 5 | from Brain.src.common.program_type import ProgramType 6 | 7 | 8 | def validate_rails(data: str) -> bool: 9 | try: 10 | json_obj = json.loads(data["content"]) 11 | if json_obj["program"] == ProgramType.RAILS_OFF_TOPIC: 12 | return False 13 | return True 14 | except Exception as ex: 15 | return False 16 | -------------------------------------------------------------------------------- /Brain/src/model/sms_model.py: -------------------------------------------------------------------------------- 1 | """sms message model includes from, to and body""" 2 | from typing import Any 3 | 4 | from Brain.src.model.requests.request_model import SendSMS 5 | 6 | 7 | class SMSModel: 8 | def __init__(self, _from="", _to="", body=""): 9 | self._from = _from 10 | self._to = _to 11 | self.body = body 12 | 13 | def get_sms_model(self, data: SendSMS.Body) -> None: 14 | self._from = data._from 15 | self._to = data.to 16 | self.body = data.body 17 | -------------------------------------------------------------------------------- /Brain/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from fastapi import FastAPI 3 | from fastapi.testclient import TestClient 4 | 5 | 6 | @pytest.fixture(scope="module") 7 | def test_client(): 8 | app = FastAPI() 9 | client = TestClient(app) 10 | # Create a test client using the FastApi application configured for testing 11 | with client as testing_client: 12 | # Establish an application context 13 | with client.app: 14 | yield testing_client # this is where the testing happens! 15 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_camera.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/chat/AlarmReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers.chat 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.util.Log 7 | 8 | class AlarmReceiver : BroadcastReceiver() { 9 | override fun onReceive(context: Context, intent: Intent) { 10 | val label = intent.getStringExtra("label") 11 | Log.d("AlarmReceiver", "Alarm triggered. Label: $label") 12 | } 13 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_info.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/activity_chat.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Extension/src/pages/Panel/Message/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import './index.css'; 4 | import BouncingDotsLoader from "../BouncingDotsLoader"; 5 | 6 | const Message = (props) => { 7 | 8 | return ( 9 |
10 |
11 | { 12 | props.isLoading ? : props.message 13 | } 14 |
15 |
16 | ); 17 | }; 18 | 19 | export default Message; 20 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/ui/NoNewLineInputFilter.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers.ui 2 | 3 | import android.text.InputFilter 4 | import android.text.Spanned 5 | 6 | class NoNewLineInputFilter : InputFilter { 7 | override fun filter( 8 | source: CharSequence?, 9 | start: Int, 10 | end: Int, 11 | dest: Spanned?, 12 | dstart: Int, 13 | dend: Int 14 | ): CharSequence { 15 | return source?.filter { char -> char != '\n' } ?: "" 16 | } 17 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /Brain/assets/img/.gitattributes: -------------------------------------------------------------------------------- 1 | heroku_api_key.gif filter=lfs diff=lfs merge=lfs -text 2 | langchain_architecture.jpg filter=lfs diff=lfs merge=lfs -text 3 | test_image.jpg filter=lfs diff=lfs merge=lfs -text 4 | achievement.gif filter=lfs diff=lfs merge=lfs -text 5 | create_firebase_androidapp.gif filter=lfs diff=lfs merge=lfs -text 6 | create_firestore.gif filter=lfs diff=lfs merge=lfs -text 7 | desc.png filter=lfs diff=lfs merge=lfs -text 8 | github_secrets.gif filter=lfs diff=lfs merge=lfs -text 9 | create_firebase_project.gif filter=lfs diff=lfs merge=lfs -text 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_attachment.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_attachment_48.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: Sync to Hugging Face hub 2 | on: 3 | push: 4 | branches: [main] 5 | 6 | # to run this workflow manually from the Actions tab 7 | workflow_dispatch: 8 | 9 | jobs: 10 | sync-to-hub: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | lfs: true 17 | - name: Push to hub 18 | env: 19 | HF_TOKEN: ${{ secrets.HF_TOKEN }} 20 | run: 21 | git push https://posix4e:$HF_TOKEN@huggingface.co/spaces/ttt246/brain main -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ImageDao.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.local.dao 2 | 3 | import androidx.room.* 4 | import com.matthaigh27.chatgptwrapper.data.local.entity.ImageEntity 5 | 6 | @Dao 7 | interface ImageDao { 8 | @Insert 9 | suspend fun insert(image: ImageEntity) 10 | 11 | @Update 12 | suspend fun update(image: ImageEntity) 13 | 14 | @Delete 15 | suspend fun delete(image: ImageEntity) 16 | 17 | @Query("SELECT * FROM images") 18 | suspend fun getAllData(): List 19 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_phone.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Brain Lint with black 2 | on: 3 | push: 4 | pull_request: 5 | paths: 6 | - "Brain/**" 7 | - "requirements.txt" 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | working-directory: Brain 16 | steps: 17 | - name: setup 18 | uses: actions/checkout@v3 19 | - name: setup-python 20 | uses: actions/setup-python@v3 21 | - name: install black 22 | run: pip install black 23 | - name: lint 24 | run: black --check . -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ContactDao.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.local.dao 2 | 3 | import androidx.room.* 4 | import com.matthaigh27.chatgptwrapper.data.local.entity.ContactEntity 5 | 6 | @Dao 7 | interface ContactDao { 8 | @Insert 9 | suspend fun insert(contact: ContactEntity) 10 | 11 | @Update 12 | suspend fun update(contact: ContactEntity) 13 | 14 | @Delete 15 | suspend fun delete(contact: ContactEntity) 16 | 17 | @Query("SELECT * FROM contacts") 18 | suspend fun getAllData(): List 19 | } -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/project.xcworkspace/xcuserdata/darkhorse.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | ShowSharedSchemesAutomaticallyEnabled 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_thumb_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_thumb_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Brain/src/log_cycle/json_handler.py: -------------------------------------------------------------------------------- 1 | import json 2 | import logging 3 | 4 | 5 | class JsonFileHandler(logging.FileHandler): 6 | def __init__(self, filename, mode="a", encoding=None, delay=False): 7 | super().__init__(filename, mode, encoding, delay) 8 | 9 | def emit(self, record): 10 | json_data = json.loads(self.format(record)) 11 | with open(self.baseFilename, "w", encoding="utf-8") as f: 12 | json.dump(json_data, f, ensure_ascii=False, indent=4) 13 | 14 | 15 | class JsonFormatter(logging.Formatter): 16 | def format(self, record): 17 | return record.msg 18 | -------------------------------------------------------------------------------- /Extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": false, 6 | "skipLibCheck": true, 7 | "esModuleInterop": true, 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "resolveJsonModule": true, 15 | "noEmit": false, 16 | "jsx": "react" 17 | }, 18 | "include": ["src"], 19 | "exclude": ["build", "node_modules"] 20 | } 21 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_back.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_thumb_down_disable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_thumb_up_disable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/off-security.co: -------------------------------------------------------------------------------- 1 | define user ask off security 2 | "Give me security information." 3 | "What is password?" 4 | "What is pin code?" 5 | "Please let me know password." 6 | "Please let me know pin." 7 | "Please let me know pin code." 8 | "How about pin code?" 9 | "security" 10 | "password" 11 | "pin" 12 | 13 | define flow 14 | user ask off security 15 | bot explain cant off security 16 | 17 | define bot explain cant off security 18 | '{"program": "rails_off_topic", "content": "Sorry, I cannot comment on anything which is relevant to the password or pin code."}' 19 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/constants/TypeChatWidgetConstants.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.constants 2 | 3 | object TypeChatWidgetConstants { 4 | val TYPE_WIDGET_SMS = "sms" 5 | val TYPE_WIDGET_HELP_PROMPT = "help_prompt" 6 | val TYPE_WIDGET_FEEDBACK = "feedback" 7 | val TYPE_WIDGET_SEARCH_CONTACT = "search_contact" 8 | val TYPE_WIDGET_SCHEDULE_ALARM = "schedule_alarm" 9 | val TYPE_WIDGET_MAILS = "mails" 10 | val TYPE_WIDGET_MAIL_READ = "mail_read" 11 | val TYPE_WIDGET_MAIL_WRITE = "mail_write" 12 | val TYPE_WIDGET_MAIL_SEND = "mail_send" 13 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_send.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /Brain/src/model/train_model.py: -------------------------------------------------------------------------------- 1 | """train model: 2 | { 3 | "id": "String", 4 | "data": [{"page_content": "String", "timestamp": 0}], 5 | "status": "created | updated | deleted", 6 | }""" 7 | 8 | from Brain.src.model.requests.request_model import Train 9 | 10 | 11 | class TrainModel: 12 | def __init__(self, train_data: Train): 13 | self.id = train_data.id 14 | self.data = train_data.data 15 | self.status = TrainStatus.UPDATED 16 | 17 | 18 | """train status: created | updated | deleted""" 19 | 20 | 21 | class TrainStatus: 22 | CREATED = "created" 23 | UPDATED = "updated" 24 | DELETED = "deleted" 25 | -------------------------------------------------------------------------------- /Extension/src/pages/Panel/Message/index.css: -------------------------------------------------------------------------------- 1 | [data-theme='light'] { 2 | --send-theme-color: #8753e9; 3 | --receive-theme-color: #0d0c0d; 4 | } 5 | 6 | [data-theme='dark'] { 7 | --send-theme-color: #8753e9; 8 | --receive-theme-color: #333333; 9 | } 10 | 11 | .message { 12 | display: flex; 13 | flex-direction: column; 14 | padding: 5px; 15 | } 16 | 17 | .message_sent { 18 | width: fit-content; 19 | padding: 5px; 20 | border-radius: 5px; 21 | background-color: var(--send-theme-color); 22 | align-self: end; 23 | } 24 | 25 | .message_received { 26 | width: fit-content; 27 | padding: 5px; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Android/app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/requests/ComposeMailApiRequest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.remote.requests 2 | 3 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.Keys 4 | 5 | data class ComposeMailApiRequest( 6 | val data: ComposeMailData, 7 | val confs: Keys 8 | ) 9 | 10 | data class ComposeMailData( 11 | private val sender: String, 12 | private val pwd: String, 13 | private val to: String, 14 | private val subject: String, 15 | private val body: String, 16 | private val to_send: Boolean, 17 | private val filename: String, 18 | private val file_content: String 19 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chatwidgetprops/MailsProps.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chatwidgetprops 2 | 3 | import com.google.gson.Gson 4 | import com.matthaigh27.chatgptwrapper.data.models.chat.MailModel 5 | 6 | data class MailsProps( 7 | val mails: ArrayList 8 | ) { 9 | override fun toString(): String { 10 | val gson = Gson() 11 | return gson.toJson(this) 12 | } 13 | 14 | companion object { 15 | fun init(string: String): MailsProps { 16 | val gson = Gson() 17 | return gson.fromJson(string, MailsProps::class.java) 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Extension/src/pages/Panel/BouncingDotsLoader/index.css: -------------------------------------------------------------------------------- 1 | .bouncing-loader { 2 | display: flex; 3 | justify-content: center; 4 | margin: 6px auto; 5 | } 6 | 7 | .bouncing-loader > div { 8 | width: 2px; 9 | height: 2px; 10 | margin: 1px 2px; 11 | border-radius: 50%; 12 | background-color: #bc0fdb; 13 | opacity: 1; 14 | animation: bouncing-loader 0.6s infinite alternate; 15 | } 16 | 17 | @keyframes bouncing-loader { 18 | to { 19 | opacity: 0.1; 20 | } 21 | } 22 | 23 | .bouncing-loader > div:nth-child(2) { 24 | animation-delay: 0.2s; 25 | } 26 | 27 | .bouncing-loader > div:nth-child(3) { 28 | animation-delay: 0.4s; 29 | } 30 | -------------------------------------------------------------------------------- /Brain/src/common/brain_exception.py: -------------------------------------------------------------------------------- 1 | """Basic Exception in Brain""" 2 | from typing import Any 3 | 4 | from Brain.src.common.http_response_codes import responses 5 | 6 | 7 | class BrainException(Exception): 8 | JSON_PARSING_ISSUE_MSG = "Exception occurred in json paring." 9 | 10 | def __init__(self, message: str = "Exception occurred in brain", code: int = 506): 11 | self.message = message 12 | self.code = code 13 | super().__init__(self.message) 14 | 15 | def get_response_exp(self) -> Any: 16 | responses[self.code] = ("Brain Exception", self.message) 17 | return {"message": responses[self.code], "result": "", "status_code": self.code} 18 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/item_day_of_week.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/widget_chat_tools.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/item_help_prompt_key.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/HelpPromptModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | import com.google.gson.Gson 4 | 5 | data class HelpPromptModel( 6 | var name: String = "", 7 | var description: String = "", 8 | var prompt: String = "", 9 | var tags: ArrayList = ArrayList() 10 | ) { 11 | override fun toString(): String { 12 | val gson = Gson() 13 | return gson.toJson(this) 14 | } 15 | 16 | companion object { 17 | fun init(string: String): HelpPromptModel { 18 | val gson = Gson() 19 | return gson.fromJson(string, HelpPromptModel::class.java) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_notification.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/helpers/chat/SettingHelper.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.helpers.chat 2 | 3 | import com.matthaigh27.chatgptwrapper.data.models.setting.SettingModel 4 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.OpenAISetting 5 | import com.matthaigh27.chatgptwrapper.utils.constants.CommonConstants.API_BASE_URL 6 | 7 | object SettingHelper { 8 | fun emptySettingModel(): SettingModel{ 9 | return SettingModel( 10 | serverUrl = API_BASE_URL, 11 | openaiKey = "", 12 | pineconeEnv = "", 13 | pineconeKey = "", 14 | firebaseKey = "", 15 | setting = OpenAISetting(0f) 16 | ) 17 | } 18 | } -------------------------------------------------------------------------------- /Brain/src/singletone.py: -------------------------------------------------------------------------------- 1 | """The singleton metaclass for ensuring only one instance of a class.""" 2 | import abc 3 | 4 | 5 | class Singleton(abc.ABCMeta, type): 6 | 7 | """ 8 | Singleton metaclass for ensuring only one instance of a class. 9 | """ 10 | 11 | _instances = {} 12 | 13 | def __call__(cls, *args, **kwargs): 14 | """Call method for the singleton metaclass.""" 15 | if cls not in cls._instances: 16 | cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) 17 | return cls._instances[cls] 18 | 19 | 20 | class AbstractSingleton(abc.ABC, metaclass=Singleton): 21 | """ 22 | Abstract singleton class for ensuring only one instance of a class. 23 | """ 24 | 25 | pass 26 | -------------------------------------------------------------------------------- /Brain/src/service/twilio_service.py: -------------------------------------------------------------------------------- 1 | """service for sms using twilio apis""" 2 | import json 3 | from typing import Any 4 | 5 | from twilio.rest import Client 6 | 7 | from Brain.src.common.utils import ACCOUNT_SID, AUTH_TOKEN 8 | from Brain.src.logs import logger 9 | from Brain.src.model.sms_model import SMSModel 10 | 11 | 12 | class TwilioService: 13 | def __init__(self): 14 | self.client = Client(ACCOUNT_SID, AUTH_TOKEN) 15 | 16 | def send_sms(self, data: SMSModel) -> Any: 17 | message = self.client.messages.create( 18 | body=data.body, from_=data._from, to=data._to 19 | ) 20 | logger.info( 21 | message=message.sid, 22 | title="sent twilio sms", 23 | ) 24 | return message 25 | -------------------------------------------------------------------------------- /Extension/src/pages/Newtab/Newtab.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Components/ImageRow.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ImageRow: View { 4 | var body: some View { 5 | HStack { 6 | AsyncImage(url: URL(string: "https://firebasestorage.googleapis.com/v0/b/test3-83ffc.appspot.com/o/images%2F00c08a46-8812-4b3c-ad9f-72d8d04a9368?alt=media&token=cacba50a-0241-445a-892b-5a0661aaaa19")) { image in 7 | image.resizable().aspectRatio(contentMode: .fit) 8 | } placeholder: { 9 | ProgressView() 10 | } 11 | }.padding(5).background(Color.white).clipShape(ChatBubble()) 12 | } 13 | } 14 | 15 | 16 | 17 | struct ImageRow_Previews: PreviewProvider { 18 | static var previews: some View { 19 | ImageRow() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_cancel_schedule_send.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/constants/TypeResponseConstants.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.constants 2 | 3 | object TypeResponseConstants { 4 | val TYPE_RESPONSE_MESSAGE = "message" 5 | val TYPE_RESPONSE_BROWSER = "browser" 6 | val TYPE_RESPONSE_ALERT = "alert" 7 | val TYPE_RESPONSE_URL = "url" 8 | val TYPE_RESPONSE_IMAGE = "image" 9 | val TYPE_RESPONSE_HELP_COMMAND = "helpcommand" 10 | val TYPE_RESPONSE_SMS = "sms" 11 | val TYPE_RESPONSE_ALARM = "alarm" 12 | val TYPE_RESPONSE_CONTACT = "contact" 13 | val TYPE_RESPONSE_MAIL_READ = "reademails" 14 | val TYPE_RESPONSE_MAIL_WRITE = "writeemail" 15 | val TYPE_RESPONSE_MAIL_SEND = "sendemail" 16 | val TYPE_RESPONSE_AUTO_TASK = "autotask" 17 | } -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/base/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.base 2 | 3 | import android.os.Bundle 4 | import android.view.View 5 | import android.widget.Toast 6 | import androidx.appcompat.app.AppCompatActivity 7 | 8 | @Suppress("DEPRECATION") 9 | open class BaseActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | 14 | // Hide the status bar (system toolbar) 15 | window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN 16 | supportActionBar?.hide() 17 | } 18 | 19 | protected fun showToast(message: String) { 20 | Toast.makeText(this, message, Toast.LENGTH_LONG).show() 21 | } 22 | } -------------------------------------------------------------------------------- /sauce_tests/02 Upload Image/README.md: -------------------------------------------------------------------------------- 1 | # Upload Image 2 | 3 | ## What you'll find 4 | 5 | This folder contains an example test, and is composed of the following elements: 6 | - `README.md`: (This file) Contains the purpose of the test. 7 | - `input.yaml`: Sets variables that will provided to test. 8 | - `unit.yaml`: Sets the steps to perform while executing the test. 9 | 10 | You can also get familiar with our test script syntax by following our [Synthax Documentation](https://github.com/saucelabs/saucectl-apitest-example/blob/main/README.md). 11 | 12 | ## Details 13 | 14 | In addition to the HTTP request done in the first test, we proceed by adding some really basic assertions: 15 | - we expect the response payload (obtained by the above request) to exist 16 | - we expect the payload to be of type ARRAY 17 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/constants/CommonConstants.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.utils.constants 2 | 3 | import com.matthaigh27.chatgptwrapper.BuildConfig 4 | 5 | object CommonConstants { 6 | val API_BASE_URL = BuildConfig.BASE_URL 7 | val FIREBASE_DATABASE_URL = "https://test3-83ffc-default-rtdb.firebaseio.com" 8 | 9 | val HELP_COMMAND_ERROR_NO_MAIN = "no main command" 10 | val HELP_COMMAND_ERROR_NO_INVALID_FORMAT = "Invalid Command Format" 11 | val HELP_COMMAND = "help" 12 | val HELP_COMMAND_ALL = "all" 13 | 14 | val ERROR_MSG_JSON = "Json Parsing Error" 15 | val ERROR_MSG_NOEXIST_COMMAND = "No such command name exists." 16 | val ERROR_MSG_UNKNOWN_ERROR = "Unknown Error happened" 17 | 18 | val PROPS_WIDGET_DESC = "widget description" 19 | } -------------------------------------------------------------------------------- /Brain/src/model/feedback_model.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | 4 | # feedback model to manage user's feedback (thumb up and down) 5 | from Brain.src.model.basic_model import BasicModel 6 | 7 | 8 | class FeedbackModel: 9 | def __init__( 10 | self, uuid: str, prompt: BasicModel, completion: BasicModel, rating: int 11 | ): 12 | self.uuid = uuid 13 | self.prompt = prompt 14 | self.completion = completion 15 | self.rating = rating 16 | self.timestamp = datetime.datetime.now().timestamp() 17 | 18 | def to_json(self): 19 | return { 20 | "uuid": self.uuid, 21 | "prompt": self.prompt.to_json(), 22 | "completion": self.completion.to_json(), 23 | "rating": self.rating, 24 | "timestamp": self.timestamp, 25 | } 26 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_logout.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /Android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chatwidgetprops/ScheduleAlarmProps.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chatwidgetprops 2 | 3 | import com.google.gson.Gson 4 | import com.matthaigh27.chatgptwrapper.data.models.chat.HelpPromptModel 5 | import com.matthaigh27.chatgptwrapper.data.models.common.Time 6 | 7 | data class ScheduleAlarmProps( 8 | val time: Time? = null, 9 | val label: String? = null, 10 | val repeat: BooleanArray? = null 11 | ) { 12 | override fun toString(): String { 13 | val gson = Gson() 14 | return gson.toJson(this) 15 | } 16 | 17 | companion object { 18 | fun init(string: String): ScheduleAlarmProps { 19 | val gson = Gson() 20 | return gson.fromJson(string, ScheduleAlarmProps::class.java) 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Extension/utils/build.js: -------------------------------------------------------------------------------- 1 | // Do this as the first thing so that any code reading it knows the right env. 2 | process.env.BABEL_ENV = 'production'; 3 | process.env.NODE_ENV = 'production'; 4 | process.env.ASSET_PATH = '/'; 5 | 6 | var webpack = require('webpack'), 7 | path = require('path'), 8 | fs = require('fs'), 9 | config = require('../webpack.config'), 10 | ZipPlugin = require('zip-webpack-plugin'); 11 | 12 | delete config.chromeExtensionBoilerplate; 13 | 14 | config.mode = 'production'; 15 | 16 | var packageInfo = JSON.parse(fs.readFileSync('package.json', 'utf-8')); 17 | 18 | config.plugins = (config.plugins || []).concat( 19 | new ZipPlugin({ 20 | filename: `${packageInfo.name}-${packageInfo.version}.zip`, 21 | path: path.join(__dirname, '../', 'zip'), 22 | }) 23 | ); 24 | 25 | webpack(config, function (err) { 26 | if (err) throw err; 27 | }); 28 | -------------------------------------------------------------------------------- /Android/app/src/androidTest/java/com/matthaigh27/chatgptwrapper/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class 18 | 19 | ExampleInstrumentedTest { 20 | @Test 21 | fun useAppContext() { 22 | // Context of the app under test. 23 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 24 | assertEquals("com.matthaigh27.chatgptwrapper", appContext.packageName) 25 | } 26 | } -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/chat/view/ChatActivity.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.chat.view 2 | 3 | import android.os.Bundle 4 | import com.matthaigh27.chatgptwrapper.R 5 | import com.matthaigh27.chatgptwrapper.ui.base.BaseActivity 6 | import com.matthaigh27.chatgptwrapper.ui.chat.view.fragments.ChatMainFragment 7 | 8 | 9 | class ChatActivity : BaseActivity() { 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.activity_chat) 13 | navigateToChatMainFragment() 14 | } 15 | 16 | private fun navigateToChatMainFragment() { 17 | val fragmentTransaction = supportFragmentManager.beginTransaction() 18 | fragmentTransaction.replace(R.id.fl_container, ChatMainFragment()).commit() 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Brain/src/common/program_type.py: -------------------------------------------------------------------------------- 1 | """Program Type for all commands to categorize""" 2 | 3 | 4 | class ProgramType: 5 | BROWSER = "browser" 6 | ALERT = "alert" 7 | IMAGE = "image" 8 | SMS = "sms" 9 | CONTACT = "contact" 10 | MESSAGE = "message" 11 | AUTO_TASK = "autotask" 12 | RAILS_OFF_TOPIC = "rails_off_topic" 13 | 14 | class BrowserType: 15 | OPEN_TAB = "opentab" 16 | OPEN_TAB_SEARCH = "opentabsearch" 17 | CLOSE_TAB = "closetab" 18 | PREVIOUS_PAGE = "previouspage" 19 | NEXT_PAGE = "nextpage" 20 | SCROLL_UP = "scrollup" 21 | SCROLL_DOWN = "scrolldown" 22 | SCROLL_TOP = "scrolltop" 23 | SCROLL_BOTTOM = "scrollbottom" 24 | SELECT_ITEM_DETAIL_INFO = "selectitemdetailinfo" 25 | SELECT_ITEM = "selectitem" 26 | MESSAGE = "message" 27 | ASK_WEBSITE = "askwebsite" 28 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/chat/AutoTaskModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.chat 2 | 3 | /** 4 | * This class denotes a model to store AutoTask data in Firebase realtime database. 5 | */ 6 | 7 | data class AutoTaskModel( 8 | val command: Command? = null, 9 | val result: String? = null, 10 | val thoughts: Thoughts? = null 11 | ) 12 | 13 | data class Command( 14 | val args: Args? = null, 15 | val name: String? = null 16 | ) 17 | 18 | data class Args( 19 | val tool_input: String? = null, 20 | val file_path: String? = null, 21 | val text: String? = null, 22 | val response: String? = null 23 | ) 24 | 25 | data class Thoughts( 26 | val criticism: String? = null, 27 | val plan: String? = null, 28 | val reasoning: String? = null, 29 | val speak: String? = null, 30 | val text: String? = null 31 | ) -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/setting/SettingModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.models.setting 2 | 3 | import com.google.gson.Gson 4 | import com.matthaigh27.chatgptwrapper.data.models.chat.HelpPromptModel 5 | import com.matthaigh27.chatgptwrapper.data.remote.requests.common.OpenAISetting 6 | 7 | data class SettingModel( 8 | val serverUrl: String, 9 | val openaiKey: String, 10 | val pineconeEnv: String, 11 | val pineconeKey: String, 12 | val firebaseKey: String, 13 | val setting: OpenAISetting 14 | ) { 15 | override fun toString(): String { 16 | val gson = Gson() 17 | return gson.toJson(this) 18 | } 19 | 20 | companion object { 21 | fun init(string: String): SettingModel { 22 | val gson = Gson() 23 | return gson.fromJson(string, SettingModel::class.java) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Brain/src/model/message_model.py: -------------------------------------------------------------------------------- 1 | """message model to manage browsering questions as agent""" 2 | from Brain.src.service.llm.base import Message 3 | 4 | 5 | class MessageModel: 6 | def __init__(self, role: str, content: str): 7 | self.role = role 8 | self.content = content 9 | 10 | def to_json(self) -> Message: 11 | return {"role": self.role, "content": self.content} 12 | 13 | @classmethod 14 | def create_chat_message(cls, role: str, content: str) -> Message: 15 | """ 16 | Create a chat message with the given role and content. 17 | 18 | Args: 19 | role (str): The role of the message sender, e.g., "system", "user", or "assistant". 20 | content (str): The content of the message. 21 | 22 | Returns: 23 | dict: A dictionary containing the role and content of the message. 24 | """ 25 | return {"role": role, "content": content} 26 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/general.co: -------------------------------------------------------------------------------- 1 | define user ask capabilities 2 | "What can you do?" 3 | "What can you help me with?" 4 | "tell me what you can do" 5 | "tell me about you" 6 | "How can I use your help?" 7 | "Hi" 8 | "Hello" 9 | "How are you?" 10 | "How are you doing?" 11 | "What is Rising Brain?" 12 | 13 | define user ask on topic 14 | "read email" 15 | "send sms" 16 | 17 | define flow 18 | user ask capabilities 19 | bot inform capabilities 20 | 21 | define bot inform capabilities 22 | '{"program": "rails_off_topic", "content": "I am an Rising AI assistant which helps answer questions based on a given knowledge base."}' 23 | 24 | define flow 25 | user ask on topic 26 | $result = execute general_question(query=$last_user_message) 27 | bot $result 28 | 29 | define flow 30 | priority 0.9 31 | user ... 32 | $result = execute general_question(query=$last_user_message) 33 | bot $result -------------------------------------------------------------------------------- /Brain/src/rising_plugin/llm/gpt_llm.py: -------------------------------------------------------------------------------- 1 | """gpt-open ai llm""" 2 | from typing import Any 3 | 4 | from langchain.chat_models import ChatOpenAI 5 | from langchain.chains.question_answering import load_qa_chain 6 | from Brain.src.common.utils import ( 7 | OPENAI_API_KEY, 8 | ) 9 | 10 | 11 | class GptLLM: 12 | def __init__(self, openai_key: str, model: str = "gpt-4", temperature: float = 0.6): 13 | self.key = openai_key 14 | self.llm = self.init_llm(model=model, temperature=temperature) 15 | 16 | def init_llm(self, model: str = "gpt-4", temperature: float = 0.6) -> Any: 17 | self.llm = ChatOpenAI( 18 | model_name=model, temperature=temperature, openai_api_key=self.key 19 | ) 20 | return self.llm 21 | 22 | def get_llm(self): 23 | return self.llm 24 | 25 | def get_chain(self): 26 | chain = load_qa_chain(self.llm, chain_type="stuff") 27 | return chain 28 | -------------------------------------------------------------------------------- /sauce_tests/01 Send Notification/README.md: -------------------------------------------------------------------------------- 1 | # Basics: Send Notification 2 | 3 | ## What you'll find 4 | 5 | This folder contains an example test, and is composed of the following elements: 6 | - `README.md`: (This file) Contains the purpose of the test. 7 | - `input.yaml`: Sets variables that will provided to test. 8 | - `unit.yaml`: Sets the steps to perform while executing the test. 9 | 10 | You can also get familiar with our test script syntax by following our [Synthax Documentation](https://github.com/saucelabs/saucectl-apitest-example/blob/main/README.md). 11 | 12 | ## Details 13 | 14 | As first test, we just would like to hit an API endpoint and verify it responds as we are expecting. 15 | The component `get` will perform an HTTP request to the given URL. Let's discard the other parameters for now. 16 | __Note:__ By default we expect a request to respond with a valid HTTP status code. If so, the request is considered as "passed" and so will the test. 17 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/actions/actions.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import json 17 | 18 | from nemoguardrails.actions import action 19 | 20 | 21 | @action() 22 | async def general_question(query): 23 | return json.dumps({"program": "message", "content": query}) 24 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /Extension/src/pages/Background/index.js: -------------------------------------------------------------------------------- 1 | // Create the context menu item 2 | chrome.runtime.onInstalled.addListener(function() { 3 | chrome.contextMenus.create({ 4 | id: 'risingExtension', 5 | title: 'rising extension', 6 | contexts: ['page'], 7 | }); 8 | }); 9 | 10 | // Handle the context menu item click 11 | chrome.contextMenus.onClicked.addListener(function(info) { 12 | if (info.menuItemId === 'risingExtension') { 13 | chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { 14 | chrome.tabs.sendMessage(tabs[0].id, { action: "open-modal" }); 15 | }); 16 | } 17 | }); 18 | 19 | // Handle the local storage get value 20 | chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { 21 | if (request.method === 'getLocalStorage') { 22 | chrome.storage.local.get(function(result) { 23 | sendResponse({ data: result }); 24 | }); 25 | } 26 | return true; // Important for asynchronous sendMessage 27 | }); -------------------------------------------------------------------------------- /WatchApp/WatchApp.xcodeproj/xcuserdata/darkhorse.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_spinner.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Brain/src/rising_plugin/guardrails-config/config.yml: -------------------------------------------------------------------------------- 1 | instructions: 2 | - type: general 3 | content: | 4 | Below is a conversation between a bot and a user about the recent job reports. 5 | The bot is factual and concise. If the bot does not know the answer to a 6 | question, it truthfully says it does not know. 7 | 8 | sample_conversation: | 9 | user "Hello there!" 10 | express greeting 11 | bot express greeting 12 | "Hello! How can I assist you today?" 13 | user "What can you do for me?" 14 | ask about capabilities 15 | bot respond about capabilities 16 | "I am an Rising AI assistant which helps answer questions based on a given knowledge base." 17 | user "thanks" 18 | express appreciation 19 | bot express appreciation and offer additional help 20 | "You're welcome. If you have any more questions or if there's anything else I can help you with, please don't hesitate to ask." 21 | 22 | models: 23 | - type: main 24 | engine: openai 25 | model: text-davinci-003 26 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch AppUITests/WatchApp_Watch_AppUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchApp_Watch_AppUITestsLaunchTests.swift 3 | // WatchApp Watch AppUITests 4 | // 5 | // Created by DarkHorse on 6/28/23. 6 | // 7 | 8 | import XCTest 9 | 10 | final class WatchApp_Watch_AppUITestsLaunchTests: XCTestCase { 11 | 12 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 13 | true 14 | } 15 | 16 | override func setUpWithError() throws { 17 | continueAfterFailure = false 18 | } 19 | 20 | func testLaunch() throws { 21 | let app = XCUIApplication() 22 | app.launch() 23 | 24 | // Insert steps here to perform after app launch but before taking a screenshot, 25 | // such as logging into a test account or navigating somewhere in the app 26 | 27 | let attachment = XCTAttachment(screenshot: app.screenshot()) 28 | attachment.name = "Launch Screen" 29 | attachment.lifetime = .keepAlways 30 | add(attachment) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.sauce/config.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1alpha 2 | kind: apitest 3 | sauce: 4 | region: us-west-1 5 | metadata: 6 | build: "risingland build" 7 | # tunnel: 8 | # name: tunnelname 9 | # owner: tunnelowner 10 | 11 | rootDir: . 12 | 13 | suites: 14 | # Remote Suite #1 will run in parallel all tests: 15 | # - Published in project "saucectl-apitest-sauce_tests" 16 | # - Having the "contract" tag 17 | - name: "Remote Suite #1" 18 | projectName: risingland 19 | useRemoteTests: true 20 | tags: 21 | - basic 22 | 23 | # Dynamic Suite #1 will run all tests found in rootDir ("."), and matching any of the "testMatch" values. 24 | # Those tests will be attached to the project "saucectl-apitest-sauce_tests". 25 | - name: "Dynamic Suite #1" 26 | projectName: risingland 27 | testMatch: 28 | - 01 Send Notification 29 | - 02 Upload Image 30 | - 03 Add Feedback 31 | - 04 Get Feedback 32 | - 05 Get Commands 33 | - 06 Rising Chat 34 | - 07 Train Contacts 35 | - 08 Image Relatedness -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Values/Constants.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct Constants { 4 | static let DEFAULT_UUID = "ac2293beb9f3b1ca" 5 | 6 | static let BASE_URL = "https://ttt246-brain.hf.space/" 7 | static let URL_SEND_NOTIFICATION = BASE_URL + "sendNotification" 8 | static let URL_GET_CONTACTS_BY_IDS = BASE_URL + "contacts/get_by_ids" 9 | 10 | static let RESPONSE_TYPE_CONTACT = "contact" 11 | static let RESPONSE_TYPE_IMAGE = "image" 12 | 13 | static func getConfs(uuid: String) -> [String: Any] { 14 | return [ 15 | "openai_key": "", 16 | "pinecone_key": "", 17 | "pinecone_env": "", 18 | "firebase_key": "", 19 | "token":"cI3EvimJQv-G5imdWrBprf:APA91bEZ5u6uq9Yq4a6NglN0L9pVM7p-rlxKB_FikbfKlzHnZT5GeAjxF0deuPT2GurS8bK6JTE2XPZLQqbsrtjxeRGhGOH5INoQ7MrRlr4TR3xFswKxJSkfi1aBUWDaLGALeirZ7GuZ", 20 | "uuid": uuid, 21 | "settings": [ 22 | "temperature": 0.6 23 | ] 24 | ] 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/item_container_chat_widget.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | #00000000 5 | 6 | #f0f0f0 7 | #e8e8e8 8 | #505050 9 | #1e1e1e 10 | 11 | #99DBA7 12 | #FF4545 13 | #ffffff 14 | 15 | #d0d0d0 16 | 17 | #43E8F6 18 | 19 | #444444 20 | #323232 21 | @color/white 22 | @color/white 23 | 24 | #0c7c73 25 | 26 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Pages/SettingView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import KeychainSwift 3 | 4 | struct SettingView: View { 5 | @State private var uuid: String = Constants.DEFAULT_UUID 6 | 7 | var body: some View { 8 | VStack { 9 | TextField("uuid", text: $uuid) 10 | .foregroundColor(.white) 11 | .font(.system(size: 20)) 12 | .padding() 13 | HStack { 14 | Spacer() 15 | Button(action: { 16 | let keychain = KeychainSwift() 17 | keychain.set("\($uuid)", forKey: "uuid") 18 | }) { 19 | Text("Save") 20 | } 21 | Spacer() 22 | Button(action: {}) { 23 | Text("Cancel") 24 | } 25 | Spacer() 26 | } 27 | } 28 | } 29 | } 30 | 31 | struct SettingView_Previews: PreviewProvider { 32 | static var previews: some View { 33 | SettingView() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch App/Pages/ContactView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ContactView: View { 4 | @State var contact: Contact 5 | 6 | var body: some View { 7 | VStack { 8 | Text(contact.displayName).padding() 9 | .bold() 10 | .foregroundColor(.white) 11 | .font(.system(size: 18)) 12 | .padding() 13 | List { 14 | ForEach(contact.phoneNumbers, id: \.self) { phone in 15 | Text(phone) 16 | .foregroundColor(.white) 17 | .font(.system(size: 15)) 18 | .padding() 19 | } 20 | }.listStyle(PlainListStyle()).padding(.bottom, 10) 21 | } 22 | } 23 | } 24 | 25 | struct ContactView_Previews: PreviewProvider { 26 | static var previews: some View { 27 | ContactView(contact: Contact( 28 | contactId: "5", 29 | displayName: "Peter Luo", 30 | phoneNumbers: ["123-234-345"]) 31 | ) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/chat/view/widgets/chatwidget/helpprompt/HelpPromptKeyItem.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.chat.view.widgets.chatwidget.helpprompt 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | import android.view.LayoutInflater 6 | import android.widget.FrameLayout 7 | import com.google.android.material.textfield.TextInputLayout 8 | import com.matthaigh27.chatgptwrapper.R 9 | 10 | @SuppressLint("AppCompatCustomView") 11 | class HelpPromptKeyItem(context: Context) : FrameLayout(context) { 12 | 13 | private val edtKey: TextInputLayout 14 | 15 | init { 16 | LayoutInflater.from(context).inflate(R.layout.item_help_prompt_key, this, true) 17 | 18 | edtKey = findViewById(R.id.edt_key) 19 | } 20 | 21 | fun initView(keyName: String) { 22 | if(keyName.isNotEmpty()) 23 | edtKey.hint = keyName.subSequence(1, keyName.length) 24 | tag = keyName 25 | } 26 | 27 | fun getText(): String { 28 | return edtKey.editText?.text.toString() 29 | } 30 | } -------------------------------------------------------------------------------- /Brain/src/rising_plugin/csv_embed.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from langchain.document_loaders.csv_loader import CSVLoader 4 | from langchain.embeddings.openai import OpenAIEmbeddings 5 | import json 6 | 7 | from Brain.src.model.req_model import ReqModel 8 | from ..common.utils import OPENAI_API_KEY 9 | 10 | 11 | def csv_embed(): 12 | file_path = os.path.dirname(os.path.abspath(__file__)) 13 | loader = CSVLoader( 14 | file_path=f"{file_path}/guardrails-config/actions/phone.csv", encoding="utf8" 15 | ) 16 | data = loader.load() 17 | 18 | result = list() 19 | for t in data: 20 | query_result = get_embed(t.page_content) 21 | result.append(query_result) 22 | with open(f"{file_path}/guardrails-config/actions/phone.json", "w") as outfile: 23 | json.dump(result, outfile, indent=2) 24 | 25 | 26 | """getting embed""" 27 | 28 | 29 | def get_embed(data: str, setting: ReqModel) -> list[float]: 30 | embeddings = OpenAIEmbeddings(openai_api_key=setting.openai_key) 31 | return embeddings.embed_query(data) 32 | 33 | 34 | if __name__ == "__main__": 35 | csv_embed() 36 | -------------------------------------------------------------------------------- /Brain/src/service/browser_service.py: -------------------------------------------------------------------------------- 1 | """service to handle & process the browser""" 2 | from Brain.src.model.requests.request_model import BrowserItem 3 | from Brain.src.rising_plugin.risingplugin import getCompletionOnly 4 | 5 | 6 | class BrowserService: 7 | """query to get the link of the item from the list""" 8 | 9 | def query_item(self, items: list[BrowserItem.ItemReq], query: str) -> str: 10 | prompt_template = f""" 11 | User is trying to '{query}' and it includes the title of the item. 12 | Please return the link of best relatedness of the item with the title from the below data.\n {items}""" 13 | return getCompletionOnly(query=prompt_template) 14 | 15 | def query_ask(self, items: list[str], query: str) -> str: 16 | prompt_template = f""" 17 | User is asking question related to website that users visit. The following is the user's question. 18 | '{query}'.\n 19 | Also the below data is list of sentence in the website. 20 | '{items}' \n 21 | Please provide me the proper answer.\n """ 22 | return getCompletionOnly(query=prompt_template) 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ttt246 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | // Make sure that you have the following two repositories 6 | google() // Google's Maven repository 7 | mavenCentral() // Maven Central repository 8 | } 9 | 10 | dependencies { 11 | // Add the dependency for the Google services Gradle plugin 12 | classpath 'com.google.gms:google-services:4.3.15' 13 | } 14 | } 15 | 16 | plugins { 17 | id 'com.android.application' version '8.0.2' apply false 18 | id 'com.android.library' version '8.0.2' apply false 19 | id 'org.jetbrains.kotlin.android' version '1.7.20' apply false 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } 25 | 26 | ext { 27 | coreVersion = "1.6.0-alpha01" 28 | extJUnitVersion = "1.2.0-alpha01" 29 | runnerVersion = "1.6.0-alpha01" 30 | uiAutomatorVersion = "2.2.0" 31 | roomVersion = '2.5.1' 32 | 33 | lifecycleVersion = "2.5.1" 34 | okHttpVersion = '3.11.0' 35 | retrofitVersion = '2.9.0' 36 | } -------------------------------------------------------------------------------- /Brain/src/model/contact_model.py: -------------------------------------------------------------------------------- 1 | """contact model: 2 | { 3 | "contactId": "String", 4 | "displayName": "String", 5 | "phoneNumbers": ["String"], 6 | "status": "created | updated | deleted", 7 | }""" 8 | from typing import Any 9 | 10 | from Brain.src.model.requests.request_model import TrainContacts 11 | 12 | 13 | class ContactModel: 14 | def __init__(self): 15 | self.contact_id = "" 16 | self.display_name = "" 17 | self.phone_numbers = [] 18 | self.status = ContactStatus.UPDATED 19 | 20 | def get_contact_model(self, data: TrainContacts.ContactReq) -> None: 21 | self.contact_id = data.contactId 22 | self.display_name = data.displayName 23 | self.phone_numbers = [] 24 | for phone in data.phoneNumbers: 25 | self.phone_numbers.append(phone) 26 | self.status = data.status 27 | 28 | def get_str_phones(self): 29 | return "".join(self.phone_numbers) 30 | 31 | 32 | """contact status: created | updated | deleted""" 33 | 34 | 35 | class ContactStatus: 36 | CREATED = "created" 37 | UPDATED = "updated" 38 | DELETED = "deleted" 39 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable/ic_cog.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/chat/view/interfaces/ChatMessageInterface.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.chat.view.interfaces 2 | 3 | import com.matthaigh27.chatgptwrapper.data.models.chat.MailModel 4 | 5 | /** 6 | * This interface is a callback function that retrieves the results of chat widgets. 7 | */ 8 | interface ChatMessageInterface { 9 | fun sentSms(phoneNumber: String, message: String) 10 | fun canceledSms() 11 | fun sentHelpPrompt(prompt: String) 12 | fun canceledHelpPrompt() 13 | fun doVoiceCall(phoneNumber: String) 14 | fun doVideoCall(phoneNumber: String) 15 | fun sendSmsWithPhoneNumber(phoneNumber: String) 16 | fun pickImage(isSuccess: Boolean, data: ByteArray? = null) 17 | fun setAlarm(hours: Int, minutes: Int, label: String) 18 | fun cancelAlarm() 19 | fun readMail(from: String, password: String, imap_folder: String) 20 | fun sendMail( 21 | from: String, 22 | password: String, 23 | to: String, 24 | subject: String, 25 | body: String, 26 | isInbox: Boolean, 27 | filename: String, 28 | fileContent: String 29 | ) 30 | 31 | fun readMailInDetail(mail: MailModel) 32 | } -------------------------------------------------------------------------------- /Extension/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "name": "Chatbot Chrome Extension", 4 | "description": "A chrome extension to implement the chatbot using OpenAI by RisingLand.", 5 | "options_page": "options.html", 6 | "permissions": ["activeTab", "tabs", "windows", "contextMenus", "storage"], 7 | "background": { 8 | "service_worker": "background.bundle.js" 9 | }, 10 | "action": { 11 | "default_popup": "popup.html", 12 | "default_icon": "icon-34.png" 13 | }, 14 | "chrome_url_overrides": { 15 | "newtab": "newtab.html" 16 | }, 17 | "icons": { 18 | "128": "icon-128.png" 19 | }, 20 | "content_scripts": [ 21 | { 22 | "matches": [ 23 | "http://*/*", 24 | "https://*/*", 25 | "" 26 | ], 27 | "js": [ 28 | "contentScript.bundle.js" 29 | ], 30 | "css": [ 31 | "content.styles.css" 32 | ] 33 | } 34 | ], 35 | "devtools_page": "devtools.html", 36 | "web_accessible_resources": [ 37 | { 38 | "resources": [ 39 | "content.styles.css", 40 | "icon-128.png", 41 | "icon-34.png", 42 | "logo_panel.png", 43 | "logo.png" 44 | ], 45 | "matches": [""] 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /Brain/src/rising_plugin/llm/falcon_llm.py: -------------------------------------------------------------------------------- 1 | """falcon llm""" 2 | from langchain import HuggingFaceHub, PromptTemplate, LLMChain 3 | 4 | from Brain.src.common.utils import HUGGINGFACEHUB_API_TOKEN 5 | 6 | repo_id = "tiiuae/falcon-7b-instruct" 7 | template = """ 8 | You are an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. 9 | 10 | {question} 11 | 12 | """ 13 | 14 | 15 | class FalconLLM: 16 | def __init__(self, temperature: float = 0.6, max_new_tokens: int = 2000): 17 | self.llm = HuggingFaceHub( 18 | huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN, 19 | repo_id=repo_id, 20 | model_kwargs={"temperature": temperature, "max_new_tokens": max_new_tokens}, 21 | ) 22 | 23 | def get_llm(self): 24 | return self.llm 25 | 26 | def get_chain(self): 27 | prompt = PromptTemplate(template=template, input_variables=["question"]) 28 | llm_chain = LLMChain(prompt=prompt, llm=self.llm, verbose=True) 29 | return llm_chain 30 | 31 | """getting the output in query with falcon llm""" 32 | 33 | def query(self, question: str) -> str: 34 | chain = self.get_chain() 35 | return chain.run(question=question) 36 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/data/repository/SharedPreferencesRepository.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.data.repository 2 | 3 | import android.content.Context 4 | import com.matthaigh27.chatgptwrapper.RisingApplication.Companion.appContext 5 | import com.matthaigh27.chatgptwrapper.data.models.setting.SettingModel 6 | import com.matthaigh27.chatgptwrapper.data.remote.ApiClient 7 | import com.matthaigh27.chatgptwrapper.utils.helpers.chat.SettingHelper.emptySettingModel 8 | 9 | object SharedPreferencesRepository { 10 | fun saveConfig(config: SettingModel) { 11 | val sharedPreferences = appContext.getSharedPreferences("prefs", Context.MODE_PRIVATE) 12 | val editor = sharedPreferences.edit() 13 | val jsonString = config.toString() 14 | editor.putString("config", jsonString) 15 | editor.apply() 16 | ApiClient.instance.initClient() 17 | } 18 | 19 | fun getConfig(): SettingModel { 20 | val sharedPreferences = appContext.getSharedPreferences("prefs", Context.MODE_PRIVATE) 21 | val jsonString = sharedPreferences.getString("config", "") 22 | if (jsonString == "" || jsonString == null) { 23 | return emptySettingModel() 24 | } else { 25 | return SettingModel.init(jsonString) 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from Brain.src.firebase.firebase import initialize_app 2 | from fastapi import FastAPI 3 | from fastapi.middleware.cors import CORSMiddleware 4 | import uvicorn 5 | 6 | from Brain.src.router.browser_router import construct_blueprint_browser_api 7 | from Brain.src.router.train_router import construct_blueprint_train_api 8 | from Brain.src.router.email_router import construct_blueprint_email_api 9 | from Brain.src.router.api import construct_blueprint_api 10 | 11 | import gradio as gr 12 | import random 13 | import time 14 | 15 | app = FastAPI() 16 | # Set up CORS middleware 17 | app.add_middleware( 18 | CORSMiddleware, 19 | allow_origins=["*"], # Allow all origins (domains) 20 | allow_credentials=True, 21 | allow_methods=["*"], # Allow all methods (GET, POST, PUT, DELETE, OPTIONS, etc.) 22 | allow_headers=["*"], # Allow all headers 23 | ) 24 | 25 | # Set up routers 26 | app.include_router(construct_blueprint_api(), tags=["ai_app"]) 27 | app.include_router( 28 | construct_blueprint_browser_api(), prefix="/browser", tags=["ai_browser"] 29 | ) 30 | app.include_router(construct_blueprint_train_api(), prefix="/train", tags=["ai_train"]) 31 | app.include_router(construct_blueprint_email_api(), prefix="/email", tags=["ai_email"]) 32 | 33 | if __name__ == "__main__": 34 | uvicorn.run(app, host="0.0.0.0", port=7860) 35 | -------------------------------------------------------------------------------- /Brain/src/service/auto_task_service.py: -------------------------------------------------------------------------------- 1 | """auto task management to get the expected output""" 2 | import firebase_admin 3 | 4 | from Brain.src.model.req_model import ReqModel 5 | from Brain.src.rising_plugin.llm.autogpt_llm import AutoGPTLLM 6 | import time 7 | import threading 8 | 9 | 10 | class AutoTaskService: 11 | """self task achievement with autogpt based on langchain 12 | response -> reference_link :str""" 13 | 14 | def ask_task_with_llm( 15 | self, query: str, firebase_app: firebase_admin.App, setting: ReqModel 16 | ) -> str: 17 | # init autogpt llm 18 | autogpt_llm = AutoGPTLLM() 19 | 20 | # generate reference link 21 | reference_link = self.generate_reference_link( 22 | llm_name="autogpt", uuid=setting.uuid 23 | ) 24 | # call autogpt 25 | thread = threading.Thread( 26 | target=autogpt_llm.ask_task, args=(query, firebase_app, reference_link) 27 | ) 28 | thread.start() 29 | 30 | return reference_link 31 | 32 | """ 33 | generate reference link for autoTask 34 | response type: 35 | /auto/{llm_name}_{uuid}_{timestamp} 36 | """ 37 | 38 | def generate_reference_link(self, llm_name: str, uuid: str) -> str: 39 | milliseconds = int(time.time() * 1000) 40 | return f"/auto/{llm_name}_{uuid}_{milliseconds}" 41 | -------------------------------------------------------------------------------- /Brain/src/service/BabyAGIService.py: -------------------------------------------------------------------------------- 1 | """BabyAGI Service Interface""" 2 | 3 | import firebase_admin 4 | 5 | from Brain.src.model.req_model import ReqModel 6 | from Brain.src.rising_plugin.llm.babyagi_llm import BabyAGILLM 7 | import time 8 | import threading 9 | 10 | 11 | class BabyAGIService: 12 | 13 | """ 14 | self task achievement with babyagi based on langchain 15 | response -> reference_link :str 16 | """ 17 | 18 | def ask_task_with_llm( 19 | self, query: str, firebase_app: firebase_admin.App, setting: ReqModel 20 | ) -> str: 21 | # init autogpt llm 22 | babyagi_llm = BabyAGILLM() 23 | 24 | # generate reference link 25 | reference_link = self.generate_reference_link( 26 | llm_name="babyagi", uuid=setting.uuid 27 | ) 28 | # call autogpt 29 | thread = threading.Thread( 30 | target=babyagi_llm.ask_task, args=(query, firebase_app, reference_link) 31 | ) 32 | thread.start() 33 | 34 | return reference_link 35 | 36 | """ 37 | generate reference link for autoTask 38 | response type: 39 | /auto/{llm_name}_{uuid}_{timestamp} 40 | """ 41 | 42 | def generate_reference_link(self, llm_name: str, uuid: str) -> str: 43 | milliseconds = int(time.time() * 1000) 44 | return f"/babyagi/{llm_name}_{uuid}_{milliseconds}" 45 | -------------------------------------------------------------------------------- /WatchApp/WatchApp Watch AppTests/WatchApp_Watch_AppTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchApp_Watch_AppTests.swift 3 | // WatchApp Watch AppTests 4 | // 5 | // Created by DarkHorse on 6/28/23. 6 | // 7 | 8 | import XCTest 9 | @testable import WatchApp_Watch_App 10 | 11 | final class WatchApp_Watch_AppTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | // Any test you write for XCTest can be annotated as throws and async. 25 | // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. 26 | // Tests marked async will run the test method on an arbitrary thread managed by the Swift runtime. 27 | } 28 | 29 | func testPerformanceExample() throws { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/RisingApplication.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper 2 | 3 | import android.annotation.SuppressLint 4 | import android.app.Application 5 | import android.provider.Settings 6 | import android.util.Log 7 | import com.google.android.gms.tasks.OnCompleteListener 8 | import com.google.firebase.messaging.FirebaseMessaging 9 | 10 | class RisingApplication : Application() { 11 | 12 | private var fcmToken: String = String() 13 | private var uuid: String = String() 14 | @SuppressLint("HardwareIds") 15 | override fun onCreate() { 16 | super.onCreate() 17 | 18 | initToken() 19 | // on below line we are getting device id. 20 | uuid = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID) 21 | appContext = applicationContext as RisingApplication 22 | } 23 | 24 | private fun initToken() { 25 | FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task -> 26 | if (!task.isSuccessful) { 27 | return@OnCompleteListener 28 | } 29 | 30 | fcmToken = task.result 31 | }) 32 | } 33 | 34 | fun getFCMToken(): String { 35 | return this.fcmToken 36 | } 37 | 38 | fun getUUID(): String { 39 | return this.uuid 40 | } 41 | 42 | companion object { 43 | lateinit var appContext: RisingApplication 44 | } 45 | } -------------------------------------------------------------------------------- /sauce_tests/05 Get Commands/unit.yaml: -------------------------------------------------------------------------------- 1 | assertions: 2 | - id: post 3 | children: 4 | - id: body 5 | contentType: application/json 6 | content: |- 7 | { 8 | "confs": { 9 | "openai_key": "${OPENAI_API_KEY}", 10 | "pinecone_key": "${PINECONE_KEY}", 11 | "pinecone_env": "${PINECONE_ENV}", 12 | "firebase_key": "${FIREBASE_ENV}", 13 | "settings": { 14 | "temperature": 0.6 15 | } 16 | } 17 | } 18 | url: ${protocol}${domain}${endpoint} 19 | var: payload 20 | mode: json 21 | - id: assert-equals 22 | expression: payload_response.headers['Content-Type'] 23 | value: application/json 24 | - id: assert-exists 25 | expression: payload 26 | - id: assert-is 27 | expression: payload.message 28 | type: array 29 | - id: each 30 | children: 31 | - id: assert-exists 32 | expression: _1 33 | expression: payload.message 34 | - id: assert-exists 35 | expression: payload.result 36 | - id: assert-exists 37 | expression: payload.result.program 38 | - id: assert-is 39 | expression: payload.result.content 40 | type: array 41 | - id: each 42 | children: 43 | - id: assert-exists 44 | expression: _1 45 | expression: payload.result.content 46 | - id: assert-is 47 | expression: payload.status_code 48 | type: integer 49 | configs: [] -------------------------------------------------------------------------------- /Android/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/setting/viewmodel/SettingViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.matthaigh27.chatgptwrapper.ui.setting.viewmodel 2 | 3 | import androidx.lifecycle.MutableLiveData 4 | import androidx.lifecycle.ViewModel 5 | import com.matthaigh27.chatgptwrapper.data.models.setting.SettingModel 6 | import com.matthaigh27.chatgptwrapper.data.remote.ApiResource 7 | import com.matthaigh27.chatgptwrapper.data.repository.SharedPreferencesRepository 8 | 9 | class SettingViewModel : ViewModel() { 10 | /** 11 | * By using SharedPreferences, keys to configure backend are stored and retrieved. 12 | * 13 | * This function is used to set the keys. 14 | */ 15 | fun setSettingData(model: SettingModel): MutableLiveData> { 16 | val state: MutableLiveData> = MutableLiveData() 17 | state.value = ApiResource.Loading() 18 | SharedPreferencesRepository.saveConfig(model) 19 | state.value = ApiResource.Success(true) 20 | return state 21 | } 22 | 23 | /** 24 | * This function is used to get the keys. 25 | */ 26 | fun getSettingData(): MutableLiveData> { 27 | val state: MutableLiveData> = MutableLiveData() 28 | state.value = ApiResource.Loading() 29 | val settingModel = SharedPreferencesRepository.getConfig() 30 | state.value = ApiResource.Success(settingModel) 31 | return state 32 | } 33 | } -------------------------------------------------------------------------------- /Brain/src/model/chat_response_model.py: -------------------------------------------------------------------------------- 1 | """chat response model""" 2 | from typing import Any 3 | 4 | from Brain.src.model.message_model import MessageModel 5 | 6 | 7 | class ChatResponseModel: 8 | def __init__(self, data: Any): 9 | self.id = data["id"] 10 | self.object = data["object"] 11 | self.model = data["model"] 12 | self.usage = data["usage"] 13 | """'choices': [ 14 | { 15 | 'message': { 16 | 'role': 'assistant', 17 | 'content': 'The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.'}, 18 | 'finish_reason': 'stop', 19 | 'index': 0 20 | } 21 | ]""" 22 | self.choices = [] 23 | for choice in data["choices"]: 24 | self.choices.append(ChoiceModel(choice)) 25 | 26 | def get_one_message_item(self) -> MessageModel: 27 | if len(self.choices) > 0: 28 | return self.choices.__getitem__(0).get_message() 29 | else: 30 | return MessageModel("", "") 31 | 32 | 33 | class ChoiceModel: 34 | def __init__(self, data: Any): 35 | tmp_message = data["message"] 36 | self.message = MessageModel(tmp_message["role"], tmp_message["content"]) 37 | self.finish_reason = data["finish_reason"] 38 | self.index = data["index"] 39 | 40 | def get_message(self): 41 | return self.message 42 | -------------------------------------------------------------------------------- /sauce_tests/07 Train Contacts/unit.yaml: -------------------------------------------------------------------------------- 1 | assertions: 2 | - id: post 3 | children: 4 | - id: body 5 | contentType: application/json 6 | content: |- 7 | { 8 | "contacts": [{ 9 | "contactId": "1", 10 | "displayName": "Thomas", 11 | "phoneNumbers": ["217 374 8105"], 12 | "status": "updated" 13 | }], 14 | "confs": { 15 | "token": "test_token", 16 | "uuid": "test-uuid", 17 | "openai_key": "${OPENAI_API_KEY}", 18 | "pinecone_key": "${PINECONE_KEY}", 19 | "pinecone_env": "${PINECONE_ENV}", 20 | "firebase_key": "${FIREBASE_ENV}", 21 | "settings": { 22 | "temperature": 0.6 23 | } 24 | } 25 | } 26 | url: ${protocol}${domain}${endpoint} 27 | var: payload 28 | mode: json 29 | - id: assert-equals 30 | expression: payload_response.headers['Content-Type'] 31 | value: application/json 32 | - id: assert-exists 33 | expression: payload 34 | - id: assert-is 35 | expression: payload.message 36 | type: array 37 | - id: each 38 | children: 39 | - id: assert-exists 40 | expression: _1 41 | expression: payload.message 42 | - id: assert-exists 43 | expression: payload.result 44 | - id: assert-is 45 | expression: payload.status_code 46 | type: integer 47 | configs: [] -------------------------------------------------------------------------------- /Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true 24 | android.defaults.buildfeatures.buildconfig=true 25 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /.github/workflows/brain_ci.yml: -------------------------------------------------------------------------------- 1 | name: Brain CI 2 | on: 3 | push: 4 | branches: [main] 5 | pull_request: 6 | paths: 7 | - "Brain/**" 8 | - "requirements.txt" 9 | workflow_dispatch: 10 | 11 | env: 12 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} 13 | FIREBASE_SERVICE_ACCOUNT_TEST3_83FFC: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TEST3_83FFC }} 14 | REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }} 15 | PINECONE_ENV: ${{ secrets.PINECONE_ENV }} 16 | PINECONE_KEY: ${{ secrets.PINECONE_KEY }} 17 | HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }} 18 | GITHUB_TOKEN: ${{ github.token }} 19 | 20 | jobs: 21 | test: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v3 25 | - uses: actions/setup-python@v4 26 | with: 27 | python-version: '3.11.2' 28 | cache: 'pip' 29 | - name: Brain - Install 30 | run: pip install -r requirements.txt 31 | - name: Brain - Test 32 | run: python -m pytest 33 | - name: Brain - api test with saucectl 34 | uses: saucelabs/saucectl-run-action@v3 35 | with: 36 | # Sauce Labs Credentials. 37 | sauce-username: ${{ secrets.SAUCE_USERNAME }} 38 | sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }} 39 | env: | 40 | OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} 41 | PINECONE_ENV=${{ secrets.PINECONE_ENV }} 42 | PINECONE_KEY=${{ secrets.PINECONE_KEY }} 43 | FIREBASE_ENV=${{ secrets.FIREBASE_SERVICE_ACCOUNT_TEST3_83FFC }} 44 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/dialog_confirm.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 24 | 25 |