├── .github
└── workflows
│ └── dart.yml
├── .gitignore
├── .metadata
├── .pre-push-config.yaml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── assets
└── example
│ ├── Screenshot_1684672351.png
│ ├── Screenshot_1684672512.png
│ ├── Screenshot_1684672715.png
│ └── translate_ui.jpg
├── codemagic.yaml
├── coverage
├── coverage.json
└── lcov.info
├── example
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── redev
│ │ │ │ │ └── rx
│ │ │ │ │ └── example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ └── LaunchImage.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ └── README.md
│ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ ├── constants.dart
│ ├── generate_img_screen.dart
│ └── main.dart
├── linux
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Podfile
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ └── MainMenu.xib
│ │ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── test
│ └── widget_test.dart
├── web
│ ├── favicon.png
│ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
└── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── example_app
└── openai_app
│ ├── .gitignore
│ ├── .metadata
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── redevrx
│ │ │ │ │ └── openai
│ │ │ │ │ └── app
│ │ │ │ │ └── openai_app
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ └── ic_launcher.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_adaptive_back.png
│ │ │ │ └── ic_launcher_adaptive_fore.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_adaptive_back.png
│ │ │ │ └── ic_launcher_adaptive_fore.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_adaptive_back.png
│ │ │ │ └── ic_launcher_adaptive_fore.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_adaptive_back.png
│ │ │ │ └── ic_launcher_adaptive_fore.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher_adaptive_back.png
│ │ │ │ └── ic_launcher_adaptive_fore.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
│ ├── assets
│ ├── animation
│ │ ├── error_animation.json
│ │ ├── robot_Setting_animation.json
│ │ └── robot_loading_screen.json
│ ├── icons
│ │ ├── app_icon.png
│ │ ├── ic_launcher.png
│ │ ├── icon_send.png
│ │ ├── openai_icon.png
│ │ ├── send_icon.png
│ │ └── user_icon.png
│ └── images
│ │ ├── generate_image.png
│ │ ├── grammar_image.png
│ │ ├── q_and_a.png
│ │ ├── question_interview_image.png
│ │ ├── robot_bg.jpg
│ │ ├── robot_hello.jpg
│ │ ├── robot_hello.png
│ │ └── translate.png
│ ├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-50x50@1x.png
│ │ │ │ ├── Icon-App-50x50@2x.png
│ │ │ │ ├── Icon-App-57x57@1x.png
│ │ │ │ ├── Icon-App-57x57@2x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-72x72@1x.png
│ │ │ │ ├── Icon-App-72x72@2x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ └── LaunchImage.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ └── README.md
│ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ └── RunnerTests
│ │ └── RunnerTests.swift
│ ├── lib
│ ├── bloc
│ │ ├── openai
│ │ │ ├── openai_bloc.dart
│ │ │ └── openai_state.dart
│ │ ├── select_version
│ │ │ ├── select_version_bloc.dart
│ │ │ └── select_version_state.dart
│ │ └── theme
│ │ │ ├── theme_bloc.dart
│ │ │ └── theme_state.dart
│ ├── components
│ │ ├── background
│ │ │ └── background_gradient.dart
│ │ ├── button
│ │ │ └── openai_button.dart
│ │ ├── dialog
│ │ │ └── loading_dialog.dart
│ │ ├── error
│ │ │ ├── error_card.dart
│ │ │ └── notfound_token.dart
│ │ └── setting
│ │ │ └── setting_card.dart
│ ├── constants
│ │ ├── constants.dart
│ │ ├── extension
│ │ │ └── size_box_extension.dart
│ │ └── theme
│ │ │ ├── colors.dart
│ │ │ ├── dimen.dart
│ │ │ └── theme.dart
│ ├── di
│ │ ├── di.config.dart
│ │ └── di.dart
│ ├── main.dart
│ ├── models
│ │ ├── feature
│ │ │ └── feature_data.dart
│ │ └── message
│ │ │ └── message.dart
│ ├── screen
│ │ ├── chatbot
│ │ │ └── chatbot.dart
│ │ ├── home
│ │ │ └── home_screen.dart
│ │ ├── preview
│ │ │ └── preview_screen.dart
│ │ ├── setup
│ │ │ └── setup_token.dart
│ │ └── splash
│ │ │ └── loading_screen.dart
│ └── service
│ │ └── shred_preference
│ │ └── shared_preference.dart
│ ├── linux
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
│ ├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Podfile
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── app_icon_1024.png
│ │ │ │ ├── app_icon_128.png
│ │ │ │ ├── app_icon_16.png
│ │ │ │ ├── app_icon_256.png
│ │ │ │ ├── app_icon_32.png
│ │ │ │ ├── app_icon_512.png
│ │ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ │ └── MainMenu.xib
│ │ ├── Configs
│ │ │ ├── AppInfo.xcconfig
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
│ └── RunnerTests
│ │ └── RunnerTests.swift
│ ├── privacy.md
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ ├── test
│ └── widget_test.dart
│ ├── web
│ ├── favicon.png
│ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
│ └── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── lib
├── chat_gpt_sdk.dart
└── src
│ ├── assistants.dart
│ ├── audio.dart
│ ├── client
│ ├── client.dart
│ ├── exception
│ │ ├── base_error_wrapper.dart
│ │ ├── missing_token_exception.dart
│ │ ├── openai_exception.dart
│ │ └── request_error.dart
│ ├── interceptor
│ │ └── interceptor_wrapper.dart
│ ├── openai_client.dart
│ └── openai_wrapper.dart
│ ├── edit.dart
│ ├── embedding.dart
│ ├── fine_tuned.dart
│ ├── i_openai.dart
│ ├── logger
│ └── logger.dart
│ ├── messages.dart
│ ├── model
│ ├── assistant
│ │ ├── enum
│ │ │ └── assistant_model.dart
│ │ ├── request
│ │ │ └── assistant.dart
│ │ └── response
│ │ │ ├── assistant_data.dart
│ │ │ ├── assistant_file_data.dart
│ │ │ ├── delete_assistant.dart
│ │ │ ├── list_assistant_file.dart
│ │ │ └── tool.dart
│ ├── audio
│ │ ├── enum
│ │ │ └── audio_format.dart
│ │ ├── request
│ │ │ ├── audio_request.dart
│ │ │ └── speech_request.dart
│ │ └── response
│ │ │ └── audio_response.dart
│ ├── cancel
│ │ └── cancel_data.dart
│ ├── chat_complete
│ │ ├── enum
│ │ │ ├── chat_model.dart
│ │ │ ├── function_call.dart
│ │ │ └── role.dart
│ │ ├── request
│ │ │ ├── chat_complete_text.dart
│ │ │ ├── function_data.dart
│ │ │ ├── json_schema.dart
│ │ │ ├── messages.dart
│ │ │ └── response_format.dart
│ │ └── response
│ │ │ ├── chat_choice.dart
│ │ │ ├── chat_choice_sse.dart
│ │ │ ├── chat_ct_response.dart
│ │ │ ├── chat_response_sse.dart
│ │ │ └── message.dart
│ ├── client
│ │ └── http_setup.dart
│ ├── complete_text
│ │ ├── enum
│ │ │ └── model.dart
│ │ ├── request
│ │ │ └── complete_text.dart
│ │ └── response
│ │ │ ├── choices.dart
│ │ │ ├── complete_response.dart
│ │ │ └── usage.dart
│ ├── edits
│ │ ├── enum
│ │ │ └── edit_model.dart
│ │ ├── request
│ │ │ └── edit_request.dart
│ │ └── response
│ │ │ └── edit_response.dart
│ ├── embedding
│ │ ├── enum
│ │ │ └── embed_model.dart
│ │ ├── request
│ │ │ └── embed_request.dart
│ │ └── response
│ │ │ ├── embed_data.dart
│ │ │ └── embed_response.dart
│ ├── error
│ │ └── openai_error.dart
│ ├── file
│ │ ├── request
│ │ │ └── upload_file.dart
│ │ └── response
│ │ │ ├── delete_file.dart
│ │ │ ├── file_data.dart
│ │ │ ├── file_response.dart
│ │ │ └── upload_response.dart
│ ├── fine_tune
│ │ ├── enum
│ │ │ └── fine_model.dart
│ │ ├── request
│ │ │ ├── create_fine_tune.dart
│ │ │ ├── create_fine_tune_job.dart
│ │ │ └── hyper_parameter.dart
│ │ └── response
│ │ │ ├── fine_tune_delete.dart
│ │ │ ├── fine_tune_event.dart
│ │ │ ├── fine_tune_hyper_params.dart
│ │ │ ├── fine_tune_model.dart
│ │ │ ├── job
│ │ │ ├── fine_tune_list.dart
│ │ │ └── fine_tune_model_job.dart
│ │ │ └── training_files.dart
│ ├── gen_image
│ │ ├── enum
│ │ │ ├── format.dart
│ │ │ ├── generate_image_model.dart
│ │ │ └── image_size.dart
│ │ ├── request
│ │ │ ├── file_info.dart
│ │ │ ├── generate_image.dart
│ │ │ └── variation.dart
│ │ └── response
│ │ │ ├── gen_img_response.dart
│ │ │ └── image_data.dart
│ ├── message
│ │ ├── request
│ │ │ └── create_message.dart
│ │ └── response
│ │ │ ├── content.dart
│ │ │ ├── content_v2.dart
│ │ │ ├── create_message_response.dart
│ │ │ ├── create_message_v2_response.dart
│ │ │ ├── image_data.dart
│ │ │ ├── list_message_file.dart
│ │ │ ├── list_message_file_data.dart
│ │ │ ├── message_data.dart
│ │ │ ├── message_data_response.dart
│ │ │ └── text_data.dart
│ ├── moderation
│ │ ├── enum
│ │ │ └── moderation_model.dart
│ │ └── response
│ │ │ ├── categories.dart
│ │ │ ├── category_scores.dart
│ │ │ ├── moderation_data.dart
│ │ │ └── moderation_result.dart
│ ├── openai_engine
│ │ ├── engine_data.dart
│ │ └── engine_model.dart
│ ├── openai_model
│ │ ├── model_data.dart
│ │ ├── openai_model.dart
│ │ └── permission.dart
│ ├── run
│ │ ├── request
│ │ │ ├── create_run.dart
│ │ │ └── create_thread_and_run.dart
│ │ └── response
│ │ │ ├── create_run_response.dart
│ │ │ ├── create_thread_and_run_data.dart
│ │ │ ├── list_run.dart
│ │ │ ├── message_creation.dart
│ │ │ └── step_detail.dart
│ └── thread
│ │ ├── request
│ │ └── thread_request.dart
│ │ └── response
│ │ ├── thread_delete_response.dart
│ │ └── thread_response.dart
│ ├── moderation.dart
│ ├── openai.dart
│ ├── openai_file.dart
│ ├── runs.dart
│ ├── threads.dart
│ └── utils
│ ├── constants.dart
│ ├── json_decode_string.dart
│ └── token_builder.dart
├── pubspec.yaml
└── test
├── client
├── http_setup_test.dart
├── interceptor_wrapper_test.dart
├── openai_wrapper_test.dart
└── openai_wrapper_test.mocks.dart
├── exception
├── base_error_wrapper_test.dart
└── missing_token_exception_test.dart
├── logger
└── logger_test.dart
├── model
├── audio
│ ├── enum
│ │ └── audio_format_test.dart
│ ├── request
│ │ └── audio_request_test.dart
│ └── response
│ │ └── audio_response_test.dart
├── cancel
│ └── cancel_data_test.dart
├── chat_complete
│ ├── enum
│ │ └── chat_model_test.dart
│ ├── request
│ │ └── chat_complete_text_test.dart
│ └── response
│ │ ├── chat_choice_test.dart
│ │ ├── chat_ct_response_test.dart
│ │ ├── chat_response_sse_test.dart
│ │ ├── chat_shoice_sse_test.dart
│ │ └── message_test.dart
├── client
│ └── http_setup_test.dart
├── complete_text
│ ├── enum
│ │ └── model_test.dart
│ ├── request
│ │ └── complete_text_test.dart
│ └── response
│ │ ├── choices_test.dart
│ │ ├── complete_response_test.dart
│ │ └── usage_test.dart
├── edits
│ ├── enum
│ │ └── edit_model_test.dart
│ ├── request
│ │ └── edit_request_test.dart
│ └── response
│ │ └── edit_response_test.dart
├── embedding
│ ├── enum
│ │ └── embed_model_test.dart
│ ├── request
│ │ └── embed_request_test.dart
│ └── response
│ │ ├── embed_data_test.dart
│ │ └── embed_response_test.dart
├── error
│ └── openai_error_test.dart
├── file
│ ├── request
│ │ └── upload_file_test.dart
│ └── response
│ │ ├── delete_file_test.dart
│ │ ├── file_data_test.dart
│ │ ├── file_response_test.dart
│ │ └── uplaod_response_test.dart
├── fine_tune
│ ├── enum
│ │ └── fine_model_test.dart
│ ├── request
│ │ └── create_fine_tune_test.dart
│ └── response
│ │ ├── fine_tune_delete_test.dart
│ │ ├── fine_tune_event.dart
│ │ ├── fine_tune_model_test.dart
│ │ ├── fine_turn_hyper_params_test.dart
│ │ └── training_files_test.dart
├── gen_image
│ ├── enum
│ │ ├── format_test.dart
│ │ └── image_size_test.dart
│ ├── request
│ │ ├── edit_file_test.dart
│ │ ├── generate_image_test.dart
│ │ └── variation_test.dart
│ └── response
│ │ ├── gen_img_response_test.dart
│ │ └── image_data_test.dart
├── moderation
│ ├── enum
│ │ └── moderation_model_test.dart
│ └── response
│ │ ├── categories_test.dart
│ │ ├── category_scores_test.dart
│ │ ├── moderation_data_test.dart
│ │ └── moderation_result_test.dart
├── openai_engine
│ ├── engine_data_test.dart
│ └── engine_model_test.dart
└── openia_model
│ ├── model_data_test.dart
│ ├── openai_model_test.dart
│ └── permission_test.dart
├── openai_test.dart
├── openai_test.mocks.dart
└── utils_test
├── constants_test.dart
└── token_build_test.dart
/.github/workflows/dart.yml:
--------------------------------------------------------------------------------
1 | # This workflow uses actions that are not certified by GitHub.
2 | # They are provided by a third-party and are governed by
3 | # separate terms of service, privacy policy, and support
4 | # documentation.
5 |
6 | name: automate test
7 |
8 | on:
9 | push:
10 | branches: [ "main" ]
11 | pull_request:
12 | branches: [ "main" ]
13 |
14 | workflow_dispatch:
15 |
16 | jobs:
17 | build:
18 | runs-on: windows-latest
19 |
20 | steps:
21 | - uses: actions/checkout@v2
22 | - uses: actions/setup-java@v2
23 | with:
24 | distribution: 'zulu'
25 | java-version: '11'
26 | - uses: subosito/flutter-action@v1
27 | with:
28 | flutter-version: '3.24.3'
29 |
30 | # - name: run analyze
31 | # run: flutter analyze
32 |
33 | - name: Get all Flutter Packages
34 | run: flutter pub get
35 |
36 | - name: Format Code
37 | run: dart format .
38 |
39 | - name: Run Flutter Test
40 | run: flutter test
41 |
42 | - name: Upload coverage to Codecov
43 | uses: codecov/codecov-action@v2.1.0
44 | with:
45 | token: ${{ secrets.CODECOV_TOKEN }}
46 |
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | /pubspec.lock
27 | **/doc/api/
28 | .dart_tool/
29 | .packages
30 | build/
31 | .idea
32 | /.flutter-plugins
33 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 135454af32477f815a7525073027a3ff9eff1bfd
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/.pre-push-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/Cretezy/flutter-format-pre-push
3 | rev: "master"
4 | hooks:
5 | - id: flutter-format
6 | - repo: https://github.com/dluksza/flutter-analyze-pre-push
7 | rev: "master"
8 | hooks:
9 | - id: flutter-analyze
10 | - repo: https://github.com/Virtomize/flutter-test-pre-push
11 | rev: "main"
12 | hooks:
13 | - id: flutter-test
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [2023] [Kasem Saikhuedong]
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 NON INFRINGEMENT. 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.
22 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:lints/core.yaml
2 |
3 | #include: package:flutter_lints/flutter.yaml
4 |
5 | # Additional information about this file can be found at
6 | # https://dart.dev/guides/language/analysis-options
7 |
8 | analyzer:
9 | plugins:
10 | - dart_code_metrics
11 |
12 | dart_code_metrics:
13 | metrics:
14 | cyclomatic-complexity: 20
15 | number-of-parameters: 4
16 | maximum-nesting-level: 7
17 | metrics-exclude:
18 | - test/**
19 | rules:
20 | # - avoid-dynamic
21 | - avoid-passing-async-when-sync-expected
22 | - avoid-redundant-async
23 | - avoid-unnecessary-type-assertions
24 | - avoid-unnecessary-type-casts
25 | - avoid-unrelated-type-assertions
26 | - avoid-unused-parameters
27 | - avoid-nested-conditional-expressions
28 | - newline-before-return
29 | - no-boolean-literal-compare
30 | - no-empty-block
31 | - prefer-trailing-comma
32 | - prefer-conditional-expressions
33 | - no-equal-then-else
34 | - prefer-moving-to-variable:
35 | allowed-duplicated-chains: 3
36 | - prefer-match-file-name
37 |
--------------------------------------------------------------------------------
/assets/example/Screenshot_1684672351.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/assets/example/Screenshot_1684672351.png
--------------------------------------------------------------------------------
/assets/example/Screenshot_1684672512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/assets/example/Screenshot_1684672512.png
--------------------------------------------------------------------------------
/assets/example/Screenshot_1684672715.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/assets/example/Screenshot_1684672715.png
--------------------------------------------------------------------------------
/assets/example/translate_ui.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/assets/example/translate_ui.jpg
--------------------------------------------------------------------------------
/codemagic.yaml:
--------------------------------------------------------------------------------
1 | scripts:
2 | - echo 'previous step'
3 | - name: Dart Code Metrics
4 | script: |
5 | flutter pub global activate dart_code_metrics
6 | mkdir -p metrics-results
7 | flutter pub global run dart_code_metrics:metrics analyze lib --reporter=json > metrics-results/dart_code_metrics.json
8 | test_report: metrics-results/dart_code_metrics.json
--------------------------------------------------------------------------------
/coverage/coverage.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/coverage/coverage.json
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 | - platform: ios
19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/redev/rx/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.redev.rx.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.3.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - image_picker_ios (0.0.1):
4 | - Flutter
5 |
6 | DEPENDENCIES:
7 | - Flutter (from `Flutter`)
8 | - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
9 |
10 | EXTERNAL SOURCES:
11 | Flutter:
12 | :path: Flutter
13 | image_picker_ios:
14 | :path: ".symlinks/plugins/image_picker_ios/ios"
15 |
16 | SPEC CHECKSUMS:
17 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
18 | image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
19 |
20 | PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
21 |
22 | COCOAPODS: 1.14.3
23 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/lib/constants.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | final heroCard = BoxDecoration(
4 | color: Colors.white,
5 | borderRadius: BorderRadius.circular(16.0),
6 | boxShadow: [
7 | BoxShadow(
8 | color: Colors.grey.withValues(alpha: .12),
9 | offset: const Offset(0, 27),
10 | blurRadius: 27,
11 | spreadRadius: .5)
12 | ]);
13 |
14 | final heroNav = BoxDecoration(
15 | color: Colors.white,
16 | borderRadius: BorderRadius.circular(50.0),
17 | boxShadow: [
18 | BoxShadow(
19 | color: Colors.black.withValues(alpha: .23),
20 | offset: const Offset(2, 18),
21 | blurRadius: 18,
22 | spreadRadius: .5)
23 | ]);
24 |
25 | const kToken = "";
26 |
--------------------------------------------------------------------------------
/example/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void fl_register_plugins(FlPluginRegistry* registry) {
12 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
13 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
14 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
15 | }
16 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | file_selector_linux
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/example/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/example/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import file_selector_macos
9 |
10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
12 | }
13 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.redev.rx.example
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.redev.rx. All rights reserved.
15 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/web/favicon.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/example/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | FileSelectorWindowsRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("FileSelectorWindows"));
14 | }
15 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | file_selector_windows
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/example/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/example/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/example_app/openai_app/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/example_app/openai_app/README.md:
--------------------------------------------------------------------------------
1 | # openai_app
2 |
3 | Example use chatGPT SDK
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/kotlin/com/redevrx/openai/app/openai_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.redevrx.openai.app.openai_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/example_app/openai_app/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "7.3.0" apply false
22 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23 | }
24 |
25 | include ":app"
26 |
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/app_icon.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/ic_launcher.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/icon_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/icon_send.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/openai_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/openai_icon.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/send_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/send_icon.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/icons/user_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/icons/user_icon.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/generate_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/generate_image.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/grammar_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/grammar_image.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/q_and_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/q_and_a.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/question_interview_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/question_interview_image.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/robot_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/robot_bg.jpg
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/robot_hello.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/robot_hello.jpg
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/robot_hello.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/robot_hello.png
--------------------------------------------------------------------------------
/example_app/openai_app/assets/images/translate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/assets/images/translate.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @main
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example_app/openai_app/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example_app/openai_app/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/bloc/openai/openai_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:openai_app/models/message/message.dart';
2 |
3 | abstract class OpenAIState {}
4 |
5 | class OpenAIInitialState extends OpenAIState {}
6 |
7 | class OpenAITokenState extends OpenAIState {
8 | final bool isSuccess;
9 | final String? token;
10 |
11 | OpenAITokenState({this.token, required this.isSuccess});
12 | }
13 |
14 | class OpenSettingState extends OpenAIState {
15 | final bool isOpen;
16 |
17 | OpenSettingState({this.isOpen = false});
18 | }
19 |
20 | class ChatCompletionState extends OpenAIState {
21 | final List? messages;
22 | final bool isBot;
23 | final bool showStopButton;
24 |
25 | ChatCompletionState(
26 | {this.messages, required this.isBot, required this.showStopButton});
27 | }
28 |
29 | class AuthErrorState extends OpenAIState {}
30 |
31 | class RateLimitErrorState extends OpenAIState {}
32 |
33 | class OpenAIServerErrorState extends OpenAIState {}
34 |
35 | class CloseOpenAIErrorUI extends OpenAIState {}
36 |
37 | class ClearTextInput extends OpenAIState {}
38 |
39 | class DownloadImageState extends OpenAIState {
40 | final bool isSuccess;
41 |
42 | DownloadImageState({required this.isSuccess});
43 | }
44 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/bloc/select_version/select_version_state.dart:
--------------------------------------------------------------------------------
1 | abstract class SelectVersionState {}
2 |
3 | class OpenAIGptVersionState extends SelectVersionState {
4 | final bool isGPT4;
5 |
6 | OpenAIGptVersionState({required this.isGPT4});
7 | }
8 |
9 | class SelectVersionInitState extends SelectVersionState {}
10 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/bloc/theme/theme_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_bloc/flutter_bloc.dart';
2 | import 'package:openai_app/bloc/theme/theme_state.dart';
3 |
4 | class ThemeBloc extends Cubit {
5 | ThemeBloc() : super(null);
6 |
7 | void changeTheme() => emit(ChangeTheme());
8 | }
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/bloc/theme/theme_state.dart:
--------------------------------------------------------------------------------
1 | sealed class ThemeState {}
2 |
3 | class ChangeTheme extends ThemeState {}
4 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/components/background/background_gradient.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:openai_app/constants/theme/colors.dart';
3 |
4 | class BackgroundGradient extends StatelessWidget {
5 | const BackgroundGradient({
6 | super.key,
7 | });
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Container(
12 | decoration: const BoxDecoration(
13 | gradient: LinearGradient(
14 | begin: Alignment.topCenter,
15 | end: Alignment.bottomCenter,
16 | colors: [Colors.transparent, kDarkBgColor])),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/components/error/notfound_token.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:openai_app/constants/theme/colors.dart';
3 |
4 | void errorNotFoundToken(BuildContext context) =>
5 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(
6 | backgroundColor: kDarkBgColor,
7 | content: Text('Error NotFound Your Token.',
8 | style: Theme.of(context).textTheme.titleMedium),
9 | ));
10 |
11 | void errorNotFoundPrompt(BuildContext context) =>
12 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(
13 | backgroundColor: kDarkBgColor,
14 | content: Text('Error NotFound Your Prompt.',
15 | style: Theme.of(context).textTheme.titleMedium),
16 | ));
17 |
18 | void toast(BuildContext context, {required String message}) =>
19 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(
20 | backgroundColor: kDarkBgColor,
21 | content: Text(message, style: Theme.of(context).textTheme.titleMedium),
22 | ));
23 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/constants/constants.dart:
--------------------------------------------------------------------------------
1 | class FeatureType {
2 | static const kCompletion = 'completion';
3 | static const kGenerateImage = 'generate image';
4 | static const kGrammar = 'grammar';
5 | static const kQuestionInterview = 'question interview';
6 | }
7 |
8 | const kExampleImageNetwork =
9 | 'https://investingnews.com/media-library/image-of-hand-holding-an-ai-face-looking-at-the-words-chatgpt-openai.jpg?id=32871272&width=980';
10 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/constants/extension/size_box_extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | extension SizeBoxExtension on double {
4 | SizedBox toHeight({double height = 1.0}) {
5 | return SizedBox(height: this * height);
6 | }
7 |
8 | SizedBox toWidth() {
9 | return SizedBox(width: this);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/constants/theme/colors.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | const kShadowBgColor = Color(0xFF262626);
4 | const kButtonColor = Color(0xFF1B61EB);
5 | const kDarkItemColor = Color(0xFF17181B);
6 | const kDarkBgColor = Color(0xFF212226);
7 | const kDarkOffBgColor = Color(0xFF2F3036);
8 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/constants/theme/dimen.dart:
--------------------------------------------------------------------------------
1 | ///
2 | const kDefaultPadding = 16.0;
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/constants/theme/theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:openai_app/constants/theme/colors.dart';
4 |
5 | final theme = ThemeData(
6 | useMaterial3: true,
7 | scaffoldBackgroundColor: kDarkBgColor,
8 | primaryColor: kDarkItemColor,
9 | textTheme: TextTheme(
10 | titleSmall: GoogleFonts.openSans(
11 | fontSize: 12, color: Colors.white, fontWeight: FontWeight.w500),
12 | titleMedium: GoogleFonts.openSans(
13 | fontSize: 16, color: Colors.white, fontWeight: FontWeight.w500),
14 | displayMedium: GoogleFonts.openSans(
15 | fontSize: 38, color: Colors.white, fontWeight: FontWeight.bold),
16 | displaySmall: GoogleFonts.openSans(
17 | fontSize: 26, color: Colors.white, fontWeight: FontWeight.bold),
18 | titleLarge: GoogleFonts.openSans(
19 | fontSize: 18, color: Colors.white, fontWeight: FontWeight.bold)));
20 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/di/di.dart:
--------------------------------------------------------------------------------
1 | import 'package:get_it/get_it.dart';
2 | import 'package:injectable/injectable.dart';
3 | import 'package:openai_app/di/di.config.dart';
4 |
5 | @InjectableInit()
6 | Future configureDependencies() async => await GetIt.instance.init();
7 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/models/message/message.dart:
--------------------------------------------------------------------------------
1 | class Message {
2 | final String? id;
3 | final bool isBot;
4 | String? message;
5 |
6 | Message({this.id, this.isBot = true, this.message});
7 | }
8 |
--------------------------------------------------------------------------------
/example_app/openai_app/lib/service/shred_preference/shared_preference.dart:
--------------------------------------------------------------------------------
1 | import 'package:injectable/injectable.dart';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | @module
5 | abstract class SharedPreferenceService {
6 | Future get prefs => SharedPreferences.getInstance();
7 | }
8 |
9 | class SharedRefKey {
10 | static const kAccessToken = 'access_token';
11 | static const kGPTVersion = 'gpt_version';
12 | static const kIsFistSetting = 'is_first_setting';
13 | }
14 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/example_app/openai_app/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import path_provider_foundation
9 | import shared_preferences_foundation
10 |
11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
13 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
14 | }
15 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = openai_app
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.redevrx.openai.app.openaiApp
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.redevrx.openai.app. All rights reserved.
15 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example_app/openai_app/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example_app/openai_app/privacy.md:
--------------------------------------------------------------------------------
1 | ## AI Chat Bot
2 | app is openSource your can use and learn it.
3 |
4 | ## Permission
5 | This app utilizes the write storage permission to allow users to save images within the app.
6 |
--------------------------------------------------------------------------------
/example_app/openai_app/test/widget_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/example_app/openai_app/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/web/favicon.png
--------------------------------------------------------------------------------
/example_app/openai_app/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example_app/openai_app/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example_app/openai_app/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/example_app/openai_app/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/example_app/openai_app/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "openai_app",
3 | "short_name": "openai_app",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "Example use chatGPT SDK",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | PermissionHandlerWindowsPluginRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
14 | }
15 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | permission_handler_windows
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redevrx/chat_gpt_sdk/12768c146441344effc425811f98e061739629fe/example_app/openai_app/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/example_app/openai_app/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/example_app/openai_app/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/lib/src/client/client.dart:
--------------------------------------------------------------------------------
1 | export 'openai_wrapper.dart';
2 | export 'openai_client.dart';
3 |
--------------------------------------------------------------------------------
/lib/src/client/exception/base_error_wrapper.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/error/openai_error.dart';
2 |
3 | abstract class BaseErrorWrapper implements Exception {
4 | final OpenAIError? data;
5 | final int? code;
6 |
7 | BaseErrorWrapper({this.data, this.code});
8 |
9 | @override
10 | String toString() => "status code :$code message :${data?.error.toMap()}\n";
11 | }
12 |
--------------------------------------------------------------------------------
/lib/src/client/exception/missing_token_exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/client/exception/base_error_wrapper.dart';
2 |
3 | ///[MissingTokenException]
4 | ///not found access token
5 | class MissingTokenException extends BaseErrorWrapper {
6 | @override
7 | String toString() =>
8 | "Not Missing Your Token look more https://beta.openai.com/account/api-keys";
9 | }
10 |
--------------------------------------------------------------------------------
/lib/src/client/exception/openai_exception.dart:
--------------------------------------------------------------------------------
1 | export 'missing_token_exception.dart';
2 | export 'request_error.dart';
3 |
--------------------------------------------------------------------------------
/lib/src/client/exception/request_error.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/client/exception/base_error_wrapper.dart';
2 |
3 | ///[RequestError]
4 | ///normal error
5 | class RequestError extends BaseErrorWrapper {
6 | RequestError({super.data, super.code});
7 | }
8 |
9 | ///Cause: Invalid Authentication
10 | /// Solution: Ensure the correct API
11 | /// key and requesting organization are being used.
12 | class OpenAIAuthError extends BaseErrorWrapper {
13 | OpenAIAuthError({super.data, super.code});
14 | }
15 |
16 | ///Cause: You are sending requests too quickly.
17 | /// Solution: Pace your requests. Read the Rate limit guide.
18 | class OpenAIRateLimitError extends BaseErrorWrapper {
19 | OpenAIRateLimitError({super.data, super.code});
20 | }
21 |
22 | const kRateLimitMessage = 'Billing hard limit has been reached';
23 |
24 | ///Cause: Issue on our servers.
25 | ///Solution: Retry your request
26 | /// after a brief wait and
27 | /// contact us if the issue persists. Check the status page.
28 | class OpenAIServerError extends BaseErrorWrapper {
29 | OpenAIServerError({super.data, super.code});
30 | }
31 |
--------------------------------------------------------------------------------
/lib/src/client/interceptor/interceptor_wrapper.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/utils/token_builder.dart';
2 | import 'package:dio/dio.dart';
3 |
4 | import '../../utils/constants.dart';
5 |
6 | class InterceptorWrapper extends Interceptor {
7 | @override
8 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
9 | options.headers.addAll(
10 | kHeader(
11 | TokenBuilder.build.token,
12 | TokenBuilder.build.orgId,
13 | ),
14 | );
15 |
16 | return handler.next(options); // super.onRequest(options, handler);
17 | }
18 |
19 | @override
20 | void onResponse(Response response, ResponseInterceptorHandler handler) {
21 | //debugPrint('http status code => ${response.statusCode} \nresponse data => ${response.data}');
22 | super.onResponse(response, handler);
23 | }
24 |
25 | @override
26 | void onError(DioException err, ErrorInterceptorHandler handler) {
27 | //debugPrint('have Error [${err.response?.statusCode}] => Data: ${err.response?.data}');
28 | super.onError(err, handler);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/src/client/openai_wrapper.dart:
--------------------------------------------------------------------------------
1 | abstract class OpenAIWrapper {}
2 |
--------------------------------------------------------------------------------
/lib/src/embedding.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/cancel/cancel_data.dart';
2 | import 'package:chat_gpt_sdk/src/model/embedding/request/embed_request.dart';
3 | import 'package:chat_gpt_sdk/src/utils/constants.dart';
4 | import 'client/client.dart';
5 | import 'model/embedding/response/embed_response.dart';
6 |
7 | class Embedding {
8 | final OpenAIClient _client;
9 | Embedding(this._client);
10 |
11 | ///Get a vector representation of a given input
12 | /// that can be easily consumed by machine learning
13 | /// models and algorithms.[embedding]
14 | ///
15 | Future embedding(
16 | EmbedRequest request, {
17 | void Function(CancelData cancelData)? onCancel,
18 | }) {
19 | return _client.post(
20 | _client.apiUrl + kEmbedding,
21 | request.toJson(),
22 | onCancel: (it) => onCancel != null ? onCancel(it) : null,
23 | onSuccess: (it) => EmbedResponse.fromJson(it),
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/src/logger/logger.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/utils/constants.dart';
2 | import 'dart:developer' as dev;
3 |
4 | class Logger {
5 | Logger._();
6 |
7 | ///[instance]
8 | ///return instance of Logger
9 | static Logger instance = Logger._();
10 |
11 | /// [isLogging]
12 | /// use for enable log
13 | bool isLogging = false;
14 |
15 | Logger builder({required bool isLogging}) {
16 | this.isLogging = isLogging;
17 |
18 | return instance;
19 | }
20 |
21 | void log(String message) {
22 | if (isLogging) dev.log(message, name: kOpenAI);
23 | }
24 |
25 | void error(Object? err, StackTrace? t, {String? message = 'error'}) {
26 | if (isLogging) dev.log('$message', error: err, stackTrace: t);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/src/model/assistant/response/assistant_file_data.dart:
--------------------------------------------------------------------------------
1 | class AssistantFileData {
2 | AssistantFileData({
3 | required this.assistantId,
4 | required this.createdAt,
5 | required this.id,
6 | required this.object,
7 | });
8 |
9 | String assistantId;
10 | int createdAt;
11 | String id;
12 | String object;
13 |
14 | factory AssistantFileData.fromJson(Map json) =>
15 | AssistantFileData(
16 | assistantId: json["assistant_id"] ?? '',
17 | createdAt: json["created_at"] ?? 0,
18 | id: json["id"] ?? '',
19 | object: json["object"] ?? '',
20 | );
21 |
22 | Map toJson() => {
23 | "assistant_id": assistantId,
24 | "created_at": createdAt,
25 | "id": id,
26 | "object": object,
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/lib/src/model/assistant/response/delete_assistant.dart:
--------------------------------------------------------------------------------
1 | class DeleteAssistant {
2 | DeleteAssistant({
3 | required this.deleted,
4 | required this.id,
5 | required this.object,
6 | });
7 |
8 | bool deleted;
9 | String id;
10 | String object;
11 |
12 | factory DeleteAssistant.fromJson(Map json) =>
13 | DeleteAssistant(
14 | deleted: json["deleted"],
15 | id: json["id"],
16 | object: json["object"],
17 | );
18 |
19 | Map toJson() => {
20 | "deleted": deleted,
21 | "id": id,
22 | "object": object,
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/lib/src/model/assistant/response/list_assistant_file.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/assistant/response/assistant_file_data.dart';
2 |
3 | class ListAssistantFile {
4 | String object;
5 | List data;
6 | String firstId;
7 | String lastId;
8 | bool hasMore;
9 |
10 | ListAssistantFile({
11 | required this.object,
12 | required this.data,
13 | required this.firstId,
14 | required this.lastId,
15 | required this.hasMore,
16 | });
17 |
18 | factory ListAssistantFile.fromJson(Map json) =>
19 | ListAssistantFile(
20 | object: json["object"] ?? '',
21 | data: json["data"] == null
22 | ? []
23 | : List.from(
24 | json["data"].map((x) => AssistantFileData.fromJson(x)),
25 | ),
26 | firstId: json["first_id"] ?? '',
27 | lastId: json["last_id"] ?? '',
28 | hasMore: json["has_more"] ?? '',
29 | );
30 |
31 | Map toJson() => {
32 | "object": object,
33 | "data": data.map((x) => x.toJson()),
34 | "first_id": firstId,
35 | "last_id": lastId,
36 | "has_more": hasMore,
37 | };
38 | }
39 |
--------------------------------------------------------------------------------
/lib/src/model/assistant/response/tool.dart:
--------------------------------------------------------------------------------
1 | class Tool {
2 | Tool({
3 | required this.type,
4 | });
5 |
6 | String type;
7 |
8 | factory Tool.fromJson(Map json) => Tool(
9 | type: json["type"],
10 | );
11 |
12 | Map toJson() => {
13 | "type": type,
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/lib/src/model/audio/enum/audio_format.dart:
--------------------------------------------------------------------------------
1 | ///audio response format.[AudioFormat]
2 | enum AudioFormat { json, text, srt, verboseJson, vtt }
3 |
4 | extension AudioFormatExtension on AudioFormat {
5 | String getName() {
6 | switch (this) {
7 | case AudioFormat.json:
8 | return 'json';
9 | case AudioFormat.text:
10 | return 'text';
11 | case AudioFormat.srt:
12 | return 'srt';
13 | case AudioFormat.verboseJson:
14 | return 'verbose_json';
15 | case AudioFormat.vtt:
16 | return 'vtt';
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/src/model/audio/response/audio_response.dart:
--------------------------------------------------------------------------------
1 | class AudioResponse {
2 | final String text;
3 |
4 | AudioResponse(this.text);
5 |
6 | factory AudioResponse.fromJson(Map json) =>
7 | AudioResponse(json["text"]);
8 | }
9 |
--------------------------------------------------------------------------------
/lib/src/model/cancel/cancel_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 |
3 | class CancelData {
4 | final CancelToken cancelToken;
5 |
6 | CancelData({required this.cancelToken});
7 | }
8 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/enum/function_call.dart:
--------------------------------------------------------------------------------
1 | enum FunctionCall { auto, none }
2 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/enum/role.dart:
--------------------------------------------------------------------------------
1 | enum Role { system, user, assistant, function }
2 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/request/function_data.dart:
--------------------------------------------------------------------------------
1 | @Deprecated('')
2 | class FunctionData {
3 | ///The name of the function to be called.
4 | /// Must be a-z, A-Z, 0-9, or contain underscores
5 | /// and dashes, with a maximum length of 64.
6 | /// [name]
7 | final String name;
8 |
9 | ///The description of what the function does.
10 | ///[description]
11 | final String? description;
12 |
13 | ///parameters object Optional
14 | /// The parameters the functions accepts,
15 | /// described as a JSON Schema object.
16 | /// See the
17 | /// guide for examples,
18 | /// and the JSON Schema reference
19 | /// for documentation about the format.
20 | /// [parameters]
21 | final Map? parameters;
22 |
23 | FunctionData({required this.name, this.description, this.parameters});
24 |
25 | Map toJson() => Map.of(
26 | {
27 | "name": name,
28 | "description": description,
29 | "parameters": parameters,
30 | },
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/request/json_schema.dart:
--------------------------------------------------------------------------------
1 | class JsonSchema {
2 | final String name;
3 | final Map schema;
4 | final bool strict = true;
5 |
6 | JsonSchema({required this.name, required this.schema});
7 |
8 | Map toJson() {
9 | final data = {};
10 | data['name'] = name;
11 | data['schema'] = schema;
12 | data['strict'] = strict;
13 |
14 | return data;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/request/response_format.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/chat_complete/request/json_schema.dart';
2 |
3 | class ResponseFormat {
4 | final String type;
5 | final JsonSchema? jsonSchema;
6 |
7 | ResponseFormat({required this.type, this.jsonSchema});
8 |
9 | ResponseFormat.jsonSchema({required this.jsonSchema}) : type = 'json_schema';
10 |
11 | Map toJson() {
12 | final data = {};
13 | data['type'] = type;
14 | if (jsonSchema != null) {
15 | data['json_schema'] = jsonSchema!.toJson();
16 | }
17 |
18 | return data;
19 | }
20 |
21 | static final jsonObject = ResponseFormat(type: "json_object");
22 | }
23 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/response/chat_choice.dart:
--------------------------------------------------------------------------------
1 | import 'message.dart';
2 |
3 | class ChatChoice {
4 | final String id = "${DateTime.now().millisecondsSinceEpoch}";
5 | final int index;
6 | final Message? message;
7 | final String? finishReason;
8 |
9 | ChatChoice({required this.index, required this.message, this.finishReason});
10 |
11 | factory ChatChoice.fromJson(Map json) => ChatChoice(
12 | index: json["index"],
13 | message:
14 | json["message"] == null ? null : Message.fromJson(json["message"]),
15 | finishReason: json["finish_reason"],
16 | );
17 |
18 | Map toJson() => {
19 | "index": index,
20 | "message": message?.toJson(),
21 | "finish_reason": finishReason ?? "",
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/response/chat_choice_sse.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/chat_complete/response/message.dart';
2 |
3 | class ChatChoiceSSE {
4 | final String id = "${DateTime.now().millisecondsSinceEpoch}";
5 | final int index;
6 | final Message? message;
7 | final String? finishReason;
8 |
9 | ChatChoiceSSE({
10 | required this.index,
11 | required this.message,
12 | this.finishReason,
13 | });
14 |
15 | factory ChatChoiceSSE.fromJson(Map json) => ChatChoiceSSE(
16 | index: json["index"],
17 | message: json["delta"] == null ? null : Message.fromJson(json["delta"]),
18 | finishReason:
19 | json["finish_reason"] == null ? "" : json["finish_reason"],
20 | );
21 |
22 | Map toJson() => {
23 | "index": index,
24 | "delta": message?.toJson(),
25 | "finish_reason": finishReason ?? "",
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/lib/src/model/chat_complete/response/message.dart:
--------------------------------------------------------------------------------
1 | class Message {
2 | final String role;
3 | final String content;
4 | final String id = "${DateTime.now().millisecondsSinceEpoch}";
5 | final Map? functionCall;
6 | final List