Skip to content

Commit

Permalink
Merge pull request #35 from guchengxi1994/master
Browse files Browse the repository at this point in the history
arm64 linux test
  • Loading branch information
guchengxi1994 authored May 19, 2024
2 parents b027f5a + d34f763 commit a4f27d9
Show file tree
Hide file tree
Showing 17 changed files with 537 additions and 252 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build-arm64-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build Linux App

on:
push:
branches:
- release

jobs:
qemu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.22.0

- name: Cache pubspec
id: cache-pubspec
uses: actions/cache@v3
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
pubspec-
- name: Install Rust Toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustup default stable
- name: install dependencies
run: |
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo apt-get update
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y
chmod +x /home/runner/work/all_in_one/all_in_one/rust_builder/cargokit/run_build_tool.sh
- name: Get dependencies
run: flutter pub get

- name: Bump build number
run: |
flutter pub global activate cider
- name: Build Linux app
run: flutter build linux --release -v

- name: Set tag name
run: echo "tag_name=v$(cider version)" >> $GITHUB_ENV

- name: List files in build directory
run: ls -la build/linux/x64/release/bundle/

# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: linux-app
# path: build/linux/x64/release/bundle/

- name: Archive release
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'linux-arm64.zip'
directory: build/linux/x64/release/bundle/

- name: Publish release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: build/linux/x64/release/bundle/linux-arm64.zip
generateReleaseNotes: true
tag: ${{ env.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}
4 changes: 2 additions & 2 deletions assets/llm.json
Git LFS file not shown
3 changes: 3 additions & 0 deletions assets/llm/compose.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 assets/llm/template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions lib/layout/components/animated_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ class _AnimatedSidebarState extends ConsumerState<AnimatedSidebar>
children: [
SidebarItemWidget(
item: SidebarItem(
icon: "assets/icons/dashboard.png",
icon: "assets/icons/AI.png",
index: 0,
name: "AI Assistant",
inActiveIcon: "assets/icons/iAI.png")),
SidebarItemWidget(
item: SidebarItem(
icon: "assets/icons/dashboard.png",
index: 1,
name: "Dashboard",
inActiveIcon: "assets/icons/idashboard.png")),
SidebarItemWidget(
item: SidebarItem(
icon: "assets/icons/toolbox.png",
index: 1,
index: 2,
name: "Toolbox",
inActiveIcon: "assets/icons/itoolbox.png")),
SidebarItemWidget(
item: SidebarItem(
icon: "assets/icons/AI.png",
index: 2,
name: "Langchain",
inActiveIcon: "assets/icons/iAI.png"))
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/layout/layout.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:all_in_one/layout/components/animated_sidebar.dart';
import 'package:all_in_one/layout/notifiers/page_notifier.dart';
import 'package:all_in_one/layout/styles.dart';
import 'package:all_in_one/llm/langchain/langchain_chat_screen.dart';
import 'package:all_in_one/llm/ai_assistant_screen.dart';
import 'package:all_in_one/styles/app_style.dart';
import 'package:all_in_one/tool_entry/entry_screen.dart';
import 'package:all_in_one/workboard/workboard_screen.dart';
Expand Down Expand Up @@ -47,9 +47,9 @@ class _LayoutState extends ConsumerState<Layout> with TickerProviderStateMixin {
controller: ref.read(pageProvider.notifier).pageController,
physics: const NeverScrollableScrollPhysics(),
children: const [
AIAssistantScreen(),
WorkboardScreen(),
EntryScreen(),
LangchainChatScreen()
],
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:all_in_one/isar/llm_history.dart';
import 'package:all_in_one/llm/editor/compose_screen.dart';
import 'package:all_in_one/llm/global/components/history_list.dart';
import 'package:all_in_one/llm/langchain/components/buttons.dart';
import 'package:all_in_one/llm/langchain/components/chat_ui.dart';
Expand All @@ -8,18 +9,24 @@ import 'package:all_in_one/llm/template_editor/template_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'components/seq_chain_flow.dart';
import 'langchain/components/seq_chain_flow.dart';

class LangchainChatScreen extends ConsumerWidget {
const LangchainChatScreen({super.key});
class AIAssistantScreen extends ConsumerWidget {
const AIAssistantScreen({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
body: PageView(
physics: const NeverScrollableScrollPhysics(),
controller: ref.read(toolProvider.notifier).controller,
children: const [ToolsScreen(), _UI(), FlowScreen(), TemplateEditor()],
children: const [
ToolsScreen(),
_UI(),
FlowScreen(),
TemplateEditor(),
ComposeScreen()
],
),
);
}
Expand Down
60 changes: 60 additions & 0 deletions lib/llm/editor/compose_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// ignore: unused_import
import 'dart:convert';

import 'package:all_in_one/llm/editor/models/datasource.dart';
import 'package:all_in_one/llm/langchain/notifiers/tool_notifier.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'editor.dart';

class ComposeScreen extends ConsumerStatefulWidget {
const ComposeScreen({super.key});

@override
ConsumerState<ComposeScreen> createState() => _ComposeScreenState();
}

class _ComposeScreenState extends ConsumerState<ComposeScreen> {
late EditorState _editorState;
late WidgetBuilder _widgetBuilder;

@override
void initState() {
super.initState();

_widgetBuilder = (context) => Editor(
// jsonString: Future(() => _jsonString),
datasource: Datasource(type: DatasourceType.json, content: ""),
onEditorStateChange: (editorState) {
_editorState = editorState;
},
showTemplateFeatures: false,
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButtonLocation: ExpandableFab.location,
floatingActionButton: ExpandableFab(
distance: 50,
type: ExpandableFabType.side,
children: [
FloatingActionButton.small(
tooltip: "back",
heroTag: "",
onPressed: () {
ref.read(toolProvider.notifier).jumpTo(0);
},
child: const Icon(Icons.chevron_left),
),
],
),
extendBodyBehindAppBar: PlatformExtension.isDesktopOrWeb,
body: SafeArea(child: _widgetBuilder(context)),
);
}
}
Loading

0 comments on commit a4f27d9

Please sign in to comment.