Skip to content

Commit

Permalink
Merge pull request #46 from A-Baji/dev
Browse files Browse the repository at this point in the history
DiscordAI 3.0.0
  • Loading branch information
A-Baji authored Jul 12, 2024
2 parents 7e5f914 + 3cc2490 commit 1d69074
Show file tree
Hide file tree
Showing 31 changed files with 3,606 additions and 842 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
omit =
*/bot/*

[report]
exclude_lines =
if __name__ == "__main__":
except KeyboardInterrupt:
42 changes: 27 additions & 15 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,31 @@ jobs:
fail-fast: false
matrix:
py_ver:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: ${{matrix.py_ver}}
python-version: ${{ matrix.py_ver }}
- name: Install Package
run: pip install .
- name: Test Package
run: echo -e "none\nnone" | discordai -V
env:
PY_VER: ${{ matrix.py_ver }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
USERNAME: ${{ secrets.USERNAME }}
PYTHONUNBUFFERED: 1
run: |
touch .env.test
export VERSION=$(cat discordai/version.py | grep -oP '\d+\.\d+\.\d+')
docker compose -f docker-compose-test.yaml up --build --exit-code-from tests
release:
if: |
github.event_name == 'push' &&
Expand All @@ -41,11 +53,11 @@ jobs:
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.discordai_version}}
release_name: Release ${{steps.version.outputs.discordai_version}}
body: Release ${{steps.version.outputs.discordai_version}}
tag_name: ${{ steps.version.outputs.discordai_version }}
release_name: Release ${{ steps.version.outputs.discordai_version }}
body: Release ${{ steps.version.outputs.discordai_version }}
draft: false
prerelease: false
package:
Expand All @@ -62,25 +74,25 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Install Dependencies
run: pip install . pyinstaller==5.7
run: pip install . pyinstaller
# Package
- name: Windows CLI Package
if: ${{matrix.os == 'windows-latest'}}
if: ${{ matrix.os == 'windows-latest' }}
run: |
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs;discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --collect-data=discordai_modelizer
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs;discordai/bot/cogs' --hidden-import=openai --collect-data=discordai_modelizer
Compress-Archive -Path dist\*discordai* -DestinationPath discordai-windows.zip
- name: Mac CLI Package
if: ${{matrix.os == 'macos-latest'}}
if: ${{ matrix.os == 'macos-latest' }}
run: |
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-data='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --hidden-import=configparser --collect-data=discordai_modelizer --collect-data=aiohttp --collect-data=certifi
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-data='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=configparser --collect-data=discordai_modelizer --collect-data=aiohttp --collect-data=certifi
zip -j discordai-macos.zip dist/*discordai*
chmod +x dist/*discordai*
- name: Linux CLI Package
if: ${{matrix.os == 'ubuntu-latest'}}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --collect-data=discordai_modelizer
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --collect-data=discordai_modelizer
zip -j discordai-linux.zip dist/*discordai*
chmod +x dist/*discordai*
# Upload
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ discordai/bot/cogs/*.py
!discordai/bot/cogs/chatgpt.py
!discordai/bot/cogs/sync.py
init.sh
/files/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -115,6 +116,7 @@ celerybeat.pid
*.sage.py

# Environments
/*.env*
.env
.venv
env/
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "discordAI-modelizer"]
path = discordAI-modelizer
url = https://github.com/A-Baji/discordAI-modelizer.git
branch = dev
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [3.0.0] - 07-xx-2024

### Added

- support for python 3.12
- unit tests

### Changed

- updated modelizer to version [3.0.9](https://github.com/A-Baji/discordAI-modelizer/releases/tag/3.0.9)
- updated and pinned openai to version 1.35.5
- includes various updates to the included slash commands
- updated DiscordChatExporter to version 2.43.3
- refactor/optimization/general cleanup of code
- improved dev environment
- updated some cli args
- updated some cli help strings
- updated config handling

### Removed

- support for python 3.8
- token usage tracking for /chatgpt command

## [2.0.1] - 06-15-2023

### Changed
Expand All @@ -14,7 +38,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
### Added

- a changelog
- an openAI image generation command
- an OpenAI image generation command
- the gpt3.5 model to the openai command and made it the default
- a chatGPT command with chat history functionality
- custom emoji support for custom models.
Expand All @@ -26,7 +50,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and

### Changed

- made prompt bolding for custom model completions a discord command parameter
- made prompt bolding for custom model completions a Discord command parameter
- updated modelizer to version [2.0.0](https://github.com/A-Baji/discordAI-modelizer/releases/tag/2.0.0)

## [1.3.2] - 02-22-2023
Expand Down Expand Up @@ -82,6 +106,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and

- modified readme

[3.0.0]: https://github.com/A-Baji/discordAI/compare/2.0.1...3.0.0
[2.0.1]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.1
[2.0.0]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.0
[1.3.2]: https://github.com/A-Baji/discordAI/compare/1.3.1...1.3.2
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM python:3.11-alpine
ARG PY_VER
FROM python:${PY_VER}
WORKDIR /main
RUN apk update
RUN apk add git
COPY ./requirements.txt ./setup.py ./README.md /main/
COPY ./discordai /main/discordai
RUN pip3 install --upgrade pip
Expand Down
Loading

0 comments on commit 1d69074

Please sign in to comment.