Skip to content

Commit

Permalink
Merge pull request #127 from mylxsw/v2.x
Browse files Browse the repository at this point in the history
V2.x
  • Loading branch information
mylxsw authored Dec 20, 2024
2 parents 2a7c38f + 4e21f75 commit ab5c3a7
Show file tree
Hide file tree
Showing 171 changed files with 7,445 additions and 6,130 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@

<a href="https://trendshift.io/repositories/1013" target="_blank"><img src="https://trendshift.io/api/badge/repositories/1013" alt="mylxsw%2Faidea | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

一款集成了主流大语言模型以及绘图模型的 APP, 采用 Flutter 开发,代码完全开源,支持以下功能:

- 支持 OpenAI 的 GPT-3.5,GPT-4 大语言模型
- 支持 Anthropic 的 Claude instant,Claude 2.1 大语言模型
- 支持 Google 的 Gemini Pro 以及视觉大语言模型
- 支持国产模型:通义千问,文心一言,讯飞星火,商汤日日新,腾讯混元,百川53B,360智脑,天工,智谱,月之暗面等
- 支持开源大模型:Yi 34B,Llama2,ChatGLM2,AquilaChat 7B,Bloomz 7B,轩辕 70B,ChatLaw,Mixtral 等,后续还将开放更多
- 支持文生图、图生图、超分辨率、黑白图片上色、艺术字、艺术二维码等功能,支持 SDXL 1.0、Dall·E 3 等

![image](https://github.com/mylxsw/aidea/assets/2330911/297bfe8e-8b26-45b3-bc03-26bc81823211)

一款集成了主流大语言模型以及绘图模型的 APP, 采用 Flutter 开发,代码完全开源。

下载体验地址:

Expand All @@ -30,6 +20,12 @@ https://aidea.aicode.cc

## 开发、编译运行环境

默认分支 `main` 是 v2 版本,当前正在开发中,如需自己部署,请切换到 [v1.x](https://github.com/mylxsw/aidea/tree/v1.x) 分支。

```bash
git checkout v1.x
```

搭建开发环境,用来编译和打包 APP,可以参考下面的文章,更多文章后面有时间了会持续更新。

- [AIdea 项目开发环境部署教程(一)前端 Flutter 环境搭建](https://mp.weixin.qq.com/s/bgAIH6s7t5IREusK_WtpRg)
Expand All @@ -44,16 +40,14 @@ https://aidea.aicode.cc

- 微信技术交流群:

<img src="https://github.com/mylxsw/aidea/assets/2330911/0a697937-b357-4d88-bb16-c07c5517d13c" width="400"/>
<img src="https://ssl.aicode.cc/mweb/20241220/17346847070027.jpg" width="400"/>

如果无法加入,请添加微信号 `x-prometheus` 为好友,拉你进群。

- 微信公众号

<img src="https://github.com/mylxsw/aidea-server/assets/2330911/376a3b9f-eacd-45c6-9630-39eb720ba097" width="500" />

- 电报群:[点此加入](https://t.me/aideachat)


## APP 截图

Expand Down
12 changes: 9 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,29 @@ if (keystorePropertiesFile.exists()) {
}

android {
namespace 'cc.aicode.flutter.askaide.askaide'
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
// ndkVersion flutter.ndkVersion
ndkVersion "27.0.12077973"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "cc.aicode.flutter.askaide.askaide"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
// minSdkVersion flutter.minSdkVersion
minSdkVersion 24
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionCode flutter.versionCode
versionName flutterVersionName
}

Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
19 changes: 19 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ allprojects {
google()
mavenCentral()
}

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}

if (project.hasProperty("android")) {
project.android {
compileSdkVersion = 34
}
}
}
}
}

rootProject.buildDir = "../build"
Expand All @@ -16,3 +34,4 @@ subprojects {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

3 changes: 2 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xms1024m -Xmx4096m
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
kotlin.jvm.target.validation.mode = IGNORE
4 changes: 3 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.0" apply false
id "com.android.application" version '8.7.2' apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}

Expand Down
Binary file added assets/icons/doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/mp3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/txt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
34 changes: 22 additions & 12 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
PODS:
- audioplayers_darwin (0.0.1):
- Flutter
- camera_avfoundation (0.0.1):
- Flutter
- camerawesome (0.0.1):
- Flutter
- JPSVolumeButtonHandler
- DKImagePickerController/Core (4.3.9):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
Expand Down Expand Up @@ -38,13 +43,11 @@ PODS:
- file_saver (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_image_compress (1.0.0):
- flutter_image_compress_common (1.0.0):
- Flutter
- Mantle
- SDWebImage
- SDWebImageWebPCoder
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_localization (0.0.1):
- Flutter
- flutter_native_splash (0.0.1):
Expand All @@ -59,6 +62,7 @@ PODS:
- in_app_purchase_storekit (0.0.1):
- Flutter
- FlutterMacOS
- JPSVolumeButtonHandler (1.0.5)
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
Expand Down Expand Up @@ -155,11 +159,12 @@ PODS:

DEPENDENCIES:
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- camerawesome (from `.symlinks/plugins/camerawesome/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- file_saver (from `.symlinks/plugins/file_saver/ios`)
- Flutter (from `Flutter`)
- flutter_image_compress (from `.symlinks/plugins/flutter_image_compress/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
- flutter_localization (from `.symlinks/plugins/flutter_localization/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
Expand Down Expand Up @@ -187,6 +192,7 @@ SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- JPSVolumeButtonHandler
- libwebp
- Mantle
- SDWebImage
Expand All @@ -205,16 +211,18 @@ SPEC REPOS:
EXTERNAL SOURCES:
audioplayers_darwin:
:path: ".symlinks/plugins/audioplayers_darwin/ios"
camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios"
camerawesome:
:path: ".symlinks/plugins/camerawesome/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
file_saver:
:path: ".symlinks/plugins/file_saver/ios"
Flutter:
:path: Flutter
flutter_image_compress:
:path: ".symlinks/plugins/flutter_image_compress/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_image_compress_common:
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
flutter_localization:
:path: ".symlinks/plugins/flutter_localization/ios"
flutter_native_splash:
Expand Down Expand Up @@ -262,27 +270,29 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
camerawesome: 1e06540f60158809bc70f398ed1ac2cf93fe4188
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_localization: f43b18844a2b3d2c71fd64f04ffd6b1e64dd54d4
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
fluwx: e9e728cfdb80e82dac5f4ff974b1901a7939dcd0
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
in_app_purchase_storekit: 8c3b0b3eb1b0f04efbff401c3de6266d4258d433
JPSVolumeButtonHandler: 53110330c9168ed325def93eabff39f0fe3e8082
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
record_darwin: 1f6619f2abac4d1ca91d3eeab038c980d76f1517
record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
SDWebImage: 066c47b573f408f18caa467d71deace7c0f8280d
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
Expand Down
15 changes: 3 additions & 12 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -450,10 +451,6 @@
"-framework",
"\"file_saver\"",
"-framework",
"\"flutter_image_compress\"",
"-framework",
"\"flutter_local_notifications\"",
"-framework",
"\"flutter_localization\"",
"-framework",
"\"flutter_native_splash\"",
Expand Down Expand Up @@ -612,6 +609,7 @@
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -675,10 +673,6 @@
"-framework",
"\"file_saver\"",
"-framework",
"\"flutter_image_compress\"",
"-framework",
"\"flutter_local_notifications\"",
"-framework",
"\"flutter_localization\"",
"-framework",
"\"flutter_native_splash\"",
Expand Down Expand Up @@ -731,6 +725,7 @@
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -794,10 +789,6 @@
"-framework",
"\"file_saver\"",
"-framework",
"\"flutter_image_compress\"",
"-framework",
"\"flutter_local_notifications\"",
"-framework",
"\"flutter_localization\"",
"-framework",
"\"flutter_native_splash\"",
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
<string>We need to access to the microphone to record audio file</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>To enable GPS location access for Exif data</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIFileSharingEnabled</key>
Expand Down
8 changes: 2 additions & 6 deletions lib/bloc/chat_chat_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@ class ChatChatBloc extends Bloc<ChatChatEvent, ChatChatState> {
on<ChatChatLoadRecentHistories>((event, emit) async {
final histories = await _chatMessageRepository.recentChatHistories(
chatAnywhereRoomId,
4,
event.count,
userId: APIServer().localUserID(),
);

var examples = await APIServer().example('openai:$defaultChatModel');
// examples 随机排序
examples.shuffle();

emit(ChatChatRecentHistoriesLoaded(
histories: histories,
examples: examples,
examples: const [],
));
});

Expand Down
5 changes: 4 additions & 1 deletion lib/bloc/chat_chat_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ part of 'chat_chat_bloc.dart';
@immutable
abstract class ChatChatEvent {}

class ChatChatLoadRecentHistories extends ChatChatEvent {}
class ChatChatLoadRecentHistories extends ChatChatEvent {
final int count;
ChatChatLoadRecentHistories({this.count = 4});
}

class ChatChatNewChat extends ChatChatEvent {
final String text;
Expand Down
Loading

0 comments on commit ab5c3a7

Please sign in to comment.