From 6b1d09332483cf52aca3a6549e6c67213dfec5a3 Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu Date: Sat, 30 Nov 2024 19:45:32 -0800 Subject: [PATCH 1/4] Add gen-class for new app entrypoint --- src/accent/app.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/accent/app.clj b/src/accent/app.clj index 85f31b6..8348cf9 100644 --- a/src/accent/app.clj +++ b/src/accent/app.clj @@ -1,4 +1,5 @@ (ns accent.app + (:gen-class) (:require [server.core :refer [start-server]] )) From 690c939d4a08b0a52f361c0586b28f8c3f240b1c Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu Date: Sat, 30 Nov 2024 19:45:57 -0800 Subject: [PATCH 2/4] Update README --- README.md | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a27b612..1e3fedd 100644 --- a/README.md +++ b/README.md @@ -25,26 +25,41 @@ This is such an application. Some data management responsibilities[^2][^3] prior Everyone is a curator and could benefit from AI-assisted curation. This open-source application originally developed for biomedical data curation is actually quite reusable for other domains and personal use cases. Some "off-label" use cases will be demonstrated. --> - ### Usage With more power comes more responsibility. Unlike interacting with generative AI in the default web interface, the application infrastructure here includes prompts and logic already optimized to project-specific workflows, direct API access to relevant platforms (Synapse), the local file system, configured databases, and additional tools/agents to accomplish various tasks. This infrastructure will also need to include guardrails. -Until this is released as a .jar, you do need some Clojure tooling. +Regular end users should download and use the artifact .jar. + +##### With a release jar (most end users) + +- Download some available release from the [releases page](https://github.com/anngvu/accent/releases). +- Run the jar, e.g. `java -jar accent-{version}.jar` after setting up the config in the same location as your jar. See [Configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration)! +By default, startup will open a web app with Syndi as your assistant. + +##### With Clojure dev tooling + +If you're comfortable with Clojure (or want to be comfortable with Clojure) and enable additional hacking: - Clone this repo. - Install [Leiningen](https://leiningen.org/) (the easiest way to use Clojure). - Run `lein deps` to install dependencies. -- Create a config file called `config.edn`. See the section [configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration). - +- Create a config file called `config.edn`. See [Configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration)! +- Choose UI: + - For web UI, which is recommended and already default: `lein run -m accent.app` + - Alternatively, the terminal console/REPL currently allows different agents other than Syndi, or to interact with different module functions directly. + #### Configuration Settings and (optionally) credentials can be defined in `config.edn`. Review the `example_config.edn` file; rename it to `config.edn` and modify as needed. In addition to the comments in the example file, more discussion is provided below. -##### AI Providers +##### AI Providers specification + +> [!NOTE] +> Only OpenAI works with *both* web app UI and developer console for now. Anthropic only works with the developer console. The app integrates two providers, Anthropic and OpenAI, and an initial model provider must be specified. In the *same chat*, it is possible to switch between models from the *same provider* but not between different providers, e.g. switching from ChatGPT-3.5 to ChatGPT-4o, but not from ChatGTP-3.5 to Claude Sonnet-3.5. @@ -59,28 +74,16 @@ Tip for usage: Trying to reduce costs by switching to a cheaper model for some t - To use, must have `ANTHROPIC_API_KEY` in env or set in config. - The default model is Claude Sonnet 3.5. -#### Run your preferred UI and specialized curation agent - -> [!NOTE] -> Currently, there are some tradeoffs between the terminal vs web UI. The web UI will have some features that the terminal will not, such as showing figures. On the other hand, web UI only works with OpenAI for now. - -##### For Synapse curation +#### Demos and Tutorials (WIP) -The **web UI is highly recommended**: -- `lein run -m accent.app` - -For the terminal: -- `lein run -m agents.syndi` +Planned demo materials will be linked once available: +- **Assisted curation workflow** for preparing some kind of data asset for Synapse (e.g. a dataset). +- **Data model exploration and development** for working with different DCC-specific models to reuse concepts, maintain alignment, improve quality, etc. -#### Demos / tutorials for various scenarios - -- **Assisted curation workflow** - You are preparing some kind of data asset for Synapse (e.g. a dataset). -- **Data model exploration and development** - You want to develop your DCC-specific model with the benefit of analytical capabilities and accessible context with other DCC models (to reuse concepts, maintain alignment, improve quality, etc.) - ### Dynamic Roadmap **This roadmap adapts to the feedback and interest received.** From 7a7f624020790a0e7c5152c8c28afe040ad3c26e Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu Date: Sat, 30 Nov 2024 19:47:33 -0800 Subject: [PATCH 3/4] Add workflow and update version scheme --- .github/workflows/build.yaml | 48 ++++++++++++++++++++++++++++++++++++ project.clj | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2b17379 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,48 @@ +name: Build and Release Uberjar + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Install Leiningen + uses: DeLaGuardo/setup-clojure@13.0 + with: + lein: latest + + - name: Build uberjar + run: lein uberjar + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: accent-${{ github.ref }} + draft: false + prerelease: ${{ contains(github.ref, 'rc') }} + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/uberjar/accent-*-standalone.jar + asset_name: accent-${{ github.ref_name }}.jar + asset_content_type: application/java-archive diff --git a/project.clj b/project.clj index 511b4b6..86a8eae 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject accent "0.4.0-SNAPSHOT" +(defproject accent "0.4.0" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" From ca3973731d1874be1a1bfa8a22f831e50a7882f2 Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu Date: Sat, 30 Nov 2024 19:47:52 -0800 Subject: [PATCH 4/4] Update native image script --- script/native.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/native.sh b/script/native.sh index 6f16535..f236881 100755 --- a/script/native.sh +++ b/script/native.sh @@ -9,5 +9,5 @@ export GRAALVM_HOME="$HOME/graalvm-ce-java17-22.3.1" --libc=musl \ -H:CCompilerOption=-Wl,-z,stack-size=2097152 \ -H:Optimize=2 \ - -jar ./target/uberjar/accent-0.1.0-SNAPSHOT-standalone.jar + -jar ./target/uberjar/accent-0.4.0-standalone.jar