Skip to content

Commit

Permalink
Merge pull request #26 from The-Nefarious-Developer/ollama
Browse files Browse the repository at this point in the history
Ollama Implementation
  • Loading branch information
NickChecan authored Jan 21, 2025
2 parents 5591a65 + 80d0de3 commit c5284c5
Show file tree
Hide file tree
Showing 106 changed files with 3,754 additions and 282 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"version": "none",
"installMaven": "true",
"installGradle": "false"
}
},
"ghcr.io/devcontainers/features/github-cli:1": {}
}

}
68 changes: 67 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ on:

permissions:
contents: write
pull-requests: write

jobs:

test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:

- name: Checkout code
uses: actions/checkout@v3

Expand All @@ -35,6 +37,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci') && github.ref == 'refs/heads/main'"
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -62,4 +65,67 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.NEFARIOUS_GITHUB_TOKEN }}
run: chmod +x ./scripts/prepare-release.sh && npx semantic-release
run: chmod +x ./scripts/prepare-release.sh && npx semantic-release

update-website:
needs: release
if: "!contains(github.event.head_commit.message, 'skip ci') && github.ref == 'refs/heads/main'"
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.NEFARIOUS_GITHUB_TOKEN }}
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Get the latest release tag
id: get_release
run: |
LATEST_TAG=$(gh release view --json tagName -q ".tagName")
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Configure Git
run: |
git config --global user.name "nefarious-developer-bot"
git config --global user.email "nefarious-developer-bot@users.noreply.github.com"
- name: Clone the target repository
run: |
git clone https://nefarious-developer-bot:${GH_TOKEN}@github.com/The-Nefarious-Developer/zjoule-website.git website-repo
- name: Create a new branch
working-directory: website-repo
run: |
git checkout -b update-to-$LATEST_TAG
- name: Run the script to update the website
working-directory: website-repo
run: |
chmod +x ../scripts/update-website.sh
../scripts/update-website.sh $LATEST_TAG
- name: Commit the changes
working-directory: website-repo
run: |
git add .
git commit -m "feat: update to $LATEST_TAG"
- name: Push the changes
working-directory: website-repo
run: |
git push https://nefarious-developer-bot:${GH_TOKEN}@github.com/The-Nefarious-Developer/zjoule-website.git update-to-$LATEST_TAG
- name: Create a pull request
working-directory: website-repo
run: |
gh pr create \
--title "Update to $LATEST_TAG" \
--body "This PR updates the website to the latest release $LATEST_TAG." \
--head update-to-$LATEST_TAG \
--base main
- name: Automatically merge the pull request
working-directory: website-repo
run: |
PR_URL=$(gh pr view update-to-$LATEST_TAG --json url -q ".url")
gh pr merge $PR_URL --squash --admin --delete-branch
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.scannerwork
docs/
docs/
website-repo/
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1737318973879</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
73 changes: 56 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

[![Latest Test](https://github.com/The-Nefarious-Developer/zjoule/actions/workflows/main.yaml/badge.svg)](https://github.com/The-Nefarious-Developer/zjoule/actions/workflows/main.yaml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=The-Nefarious-Developer_zjoule&metric=alert_status&token=e2a58dc0706342532d8d14ae0badfe72fd08ff28)](https://sonarcloud.io/summary/new_code?id=The-Nefarious-Developer_zjoule)
[![CodeQL](https://github.com/The-Nefarious-Developer/zjoule/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/The-Nefarious-Developer/zjoule/actions/workflows/github-code-scanning/codeql)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://zjoule.com/v1.1.2/doc/)
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

</div>

**zJoule** is an Open Source AI assistant plugin for Eclipse designed to integrate the **SAP AI Core** Generative AI Hub foundation-models into your development environment.
**zJoule** is an Open Source AI assistant plugin for Eclipse designed to integrate Generative AI into your development environment.

## Documentation Content
- [Requirements](#requirements)
Expand All @@ -25,12 +26,25 @@
- [License](#license)

## Requirements
- SAP AI Core with the `Extended` service plan (for the Generative AI Hub enablement).
- A local **Ollama** installation or **SAP AI Core** with the `Extended` service plan (for the Generative AI Hub enablement).
- Eclipse 2024-09 (4.33.0) or latest. *Compatibility with older versions is not guaranteed.*

## Compatibility

The following table outlines the Generative AI models currently compatible with this plugin, as well as the next models that will soon be available:
The following table outlines the Generative AI models currently compatible with this plugin, as well as the next models that will soon be available.

> **Privacy Information** <br>
We know how privacy is important and ensure that all communication handled by the plugin is secure **is a must**. Here's how your data is managed:
> - **Data Flow:** All communication facilitated by the plugin occurs exclusively between Eclipse and the SAP AI Core model APIs. No external intermediaries are involved.
> - **Data Storage:** Any data processed or generated during plugin usage is stored locally within Eclipse's memory mechanism, ensuring it remains private and confined to your development environment. <br>
>
> By keeping all operations local and secure, the plugin should provide a trustworthy and seamless experience.
### Ollama

This plugin supports Ollama models through a local installation. For more information regarding the models available, please, check [this link]().

### SAP AI Core Generative AI Hub

| Executable ID | Model | Version | Compatibility |
|---------------|--------------------------------|---------------------------|:------------------:|
Expand All @@ -52,16 +66,9 @@ LLM models that are not compatible may be selected during the login process; how

Additional model compatibilities may be introduced in the near future :)

> **Privacy Information** <br>
We know how privacy is important and ensure that all communication handled by the plugin is secure **is a must**. Here's how your data is managed:
> - **Data Flow:** All communication facilitated by the plugin occurs exclusively between Eclipse and the SAP AI Core model APIs. No external intermediaries are involved.
> - **Data Storage:** Any data processed or generated during plugin usage is stored locally within Eclipse's memory mechanism, ensuring it remains private and confined to your development environment. <br>
>
> By keeping all operations local and secure, the plugin should provide a trustworthy and seamless experience.
## Motivation

The official Joule version for ADT is being rolled out exclusively for S/4HANA Private Cloud and SAP BTP, ABAP Environment at the end of Q1 of 2025. But don’t worry, this plugin was created to bridges the gap! It introduces an AI-powered chat interface that seamlessly connects other types of SAP systems to large language models (LLMs) through SAP AI Core.
The official Joule version for ADT is being rolled out exclusively for S/4HANA Private Cloud and SAP BTP, ABAP Environment at the end of Q1 of 2025. But don’t worry, this plugin was created to bridges the gap! It introduces an AI-powered chat interface that seamlessly connects other types of SAP systems to large language models (LLMs) through different AI providers.

The idea is to open the door to integrate SAP ABAP development with new models and innovative features that could emerge from the expanding possibilities of AI.

Expand All @@ -88,25 +95,54 @@ All from the cozy confines of your Eclipse ADT =)
#### 7. Enhanced Development Experience:
- Enable faster learning for beginners or new team members.
- Provide a smoother workflow for experienced developers needing quick solutions.
#### 8. Privacy and Security:
- If using a local Ollama installation, all data processing occurs entirely on your machine, without any internet dependency.
- This ensures maximum privacy, as sensitive code or project details never leave your local environment.

## Getting Started

1. Download and install **zJoule** in your Eclipse instance following the procedure described [right here](https://zjoule.com).

2. If the plugin view is not currently open in your Eclipse Editor, go to `Window > Show View > Other..` and search for **zJoule** inside the **ABAP Copilot** folder.

<div align="center">
<img src="assets/view.png" alt="Intro GIF" width="200"/>
</div>

3. Click on the authentication button (lock icon) at the top of the view and select the AI provider you want to work with.

<div align="center">
<img src="assets/login_0.png" alt="Intro GIF" width="400"/>
</div>

### Connecting to an Ollama local installation

4. Enter the localhost and port where your Ollama instance is available.

2. Login using your SAP AI Core `Service Key`.
<div align="center">
<img src="assets/login_ollama_1.png" alt="Intro GIF" width="400"/>
</div>

5. Select the model you have installed and want to work with.

<div align="center">
<img src="assets/login_1.png" alt="Intro GIF" width="400"/>
<img src="assets/login_ollama_2.png" alt="Intro GIF" width="400"/>
</div>

### Connecting to an SAP AI Core instance

4. Login using your SAP AI Core `Service Key`.

<div align="center">
<img src="assets/login_sap_1.png" alt="Intro GIF" width="400"/>
</div>

You can find it in the *Instances an Subscriptions* area of your SAP BTP subaccount.

3. Select the `resource group` and the `deployment` model you want to use.
5. Select the `resource group` and the `deployment` model you want to use.

<div align="center">
<img src="assets/login_2.png" alt="Intro GIF" width="400"/>
<img src="assets/login_sap_2.png" alt="Intro GIF" width="400"/>
</div>

Resource Groups are essentially a project workspace in the context of SAP AI Core, and contains all components a specific ML or AI solution might use to attend a specific requirement. [More Information](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/resource-groups?q=resource+groups).
Expand Down Expand Up @@ -160,16 +196,19 @@ Please follow the [contribution guidelines](CONTRIBUTING.md) for more details.

## Reference

[SAP Note: 3437766 (Availability of Generative AI Models)](https://me.sap.com/notes/3437766)

[How this project consumes generative AI models.](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/consume-generative-ai-models-using-sap-ai-core)

[SAP Note: 3437766 (Availability of Generative AI Models)](https://me.sap.com/notes/3437766)
[The spinner "Ellipsis" is provided by loading.io](https://loading.io/icon/)

[zJoule - ABAP Copilot website repository](https://github.com/The-Nefarious-Developer/zjoule-website)

[zJoule - ABAP Copilot website](https://zjoule.com)

[The spinner "Ellipsis" is provided by loading.io](https://loading.io/icon/)
[Ollama API documentation](https://github.com/ollama/ollama/blob/main/docs/api.md)

[Ollama website](https://ollama.com)

## License
Copyright (c) 2024 Nicholas Coutinho Checan. <br />
Expand Down
Binary file added assets/login_0.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/login_ollama_1.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/login_ollama_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added assets/view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions com.developer.nefarious.zjoule.feature/.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
<filteredResources>
<filter>
<id>1737318973864</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions com.developer.nefarious.zjoule.plugin/.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1737318973867</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions com.developer.nefarious.zjoule.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ Export-Package:
com.developer.nefarious.zjoule.plugin.chat,
com.developer.nefarious.zjoule.plugin.chat.memory,
com.developer.nefarious.zjoule.plugin.chat.models,
com.developer.nefarious.zjoule.plugin.chat.ollama,
com.developer.nefarious.zjoule.plugin.chat.openai,
com.developer.nefarious.zjoule.plugin.chat.utils,
com.developer.nefarious.zjoule.plugin.core,
com.developer.nefarious.zjoule.plugin.core.events,
com.developer.nefarious.zjoule.plugin.core.functions,
com.developer.nefarious.zjoule.plugin.core.preferences,
com.developer.nefarious.zjoule.plugin.core.ui,
com.developer.nefarious.zjoule.plugin.core.utils,
com.developer.nefarious.zjoule.plugin.login,
Expand Down
24 changes: 15 additions & 9 deletions com.developer.nefarious.zjoule.plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<?eclipse version="3.4"?>
<plugin>

<extension
point="org.eclipse.ui.views">
<extension point="org.eclipse.ui.views">
<category
name="ABAP Copilot"
id="com.developer.nefarious.zjoule.plugin">
Expand All @@ -17,16 +16,23 @@
inject="true">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">

<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
id="com.developer.nefarious.zjoule.plugin.core.ui.ViewListener"
relative="org.eclipse.ui.views.ProblemView"
relationship="stack">
</view>
</perspectiveExtension>
</extension>
</view>
</perspectiveExtension>
</extension>

<extension point="org.eclipse.ui.preferencePages">
<page
id="com.developer.nefarious.zjoule.plugin.core.preferences.PluginPreferencesPage"
name="ABAP Copilot"
class="com.developer.nefarious.zjoule.plugin.core.preferences.PluginPreferencesPage">
</page>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,10 @@ function finishLoading() {
chatBox.removeChild(loadingIndicator);
}
unblockInput();
}
}

document.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
sendMessage();
}
});
Loading

0 comments on commit c5284c5

Please sign in to comment.