Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo settings #4

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8e1d484
Setup to use turbo mode
dusanstanis Mar 5, 2023
619d9c6
Add settings.js
dusanstanis Mar 17, 2023
bae0acb
Add healthCheck endpoint
dusanstanis Mar 23, 2023
3f9ba44
bob-setting (#1)
dusanstanis Mar 26, 2023
3f20e05
Bob settings with compressing (#2)
dusanstanis Apr 12, 2023
4da8fc8
Decrease max tokens from 500 to 380
dusanstanis Apr 23, 2023
85c1c95
Increased randomness
dusanstanis May 7, 2023
8403db5
remove summarization of text
dusanstanis May 11, 2023
468e89f
Revert back randomness setting
dusanstanis May 21, 2023
bc7dc44
Improve logs
dusanstanis Jun 2, 2023
6570088
Change default settings
dusanstanis Jun 15, 2023
e14a2fe
Switch to using gpt-3.5-turbo-16k
dusanstanis Jun 17, 2023
012a638
Shorten query, do not pass all unnecesary data if not needed
dusanstanis Jun 23, 2023
56bc6ec
Make keyv store everything in redis (#3)
dusanstanis Jul 2, 2023
f82ae7b
Tweak parameters
dusanstanis Nov 3, 2023
ebde6fc
Make temperature lower
dusanstanis Nov 4, 2023
33b76c8
Add id to chunk
dusanstanis Nov 20, 2023
0a86444
Increase max output token to 540
dusanstanis Feb 6, 2024
1b61fb5
Use fine tuned model (UPDATE TO LATEST) (#5)
dusanstanis Feb 11, 2024
7ada84e
Fix shortening of transcript
Feb 13, 2024
713caea
Add octoai (#6)
dusanstanis Feb 25, 2024
3f490db
Bump node version in dockerfile
dusanstanis Feb 25, 2024
f52383c
Cut leftover if above max tokens
Feb 25, 2024
cc8b5dc
make it possible to switch between models in the middle of the game
Feb 26, 2024
2a24fe9
Make temperature by default less for gpt
Feb 27, 2024
bbb33bc
Avg temperature 0.8
Feb 27, 2024
d11611c
Fix octoai api calls
Feb 27, 2024
81d0541
Remove logs that are not usefull
Feb 28, 2024
54bfad2
Add openrouterAi support
Mar 9, 2024
5b190de
Add title and http-refererer to opnerouter api calls
Mar 13, 2024
8dffafb
Fix text to never end with )
Mar 14, 2024
04c3efd
Fix openrouter api calls
Apr 13, 2024
c89942a
Add logs
Apr 13, 2024
56df4cf
Fix default system message for open router
dusanstanis Oct 28, 2024
4c11049
Allow last character to be ] or }
dusanstanis Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
env: {
es2021: true,
node: true,
},
extends: 'airbnb-base',
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'indent': ['error', 4, { 'SwitchCase': 1 }],
'max-len': [
'error', {
'code': 150,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignoreComments': true,
}],
'linebreak-style': 0,
'arrow-parens': [2, 'as-needed', { 'requireForBlockBody': true }],
'no-plusplus': ['error', { 'allowForLoopAfterthoughts': true }],
'no-console': 'off',
'import/extensions': 'off',
'no-use-before-define': ['error', {
'functions': false,
}],
'no-promise-executor-return': 'off',
'no-param-reassign': 'off',
'no-continue': 'off',
'no-restricted-syntax': 'off',
},
};
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Node.js version (please complete the following information):**
- OS: [e.g. Windows, WSL2, Ubuntu]
- Version [e.g. 18]

**Package version (please complete the following information):**
- [e.g. 1.33.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/help-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Help/Question
about: Ask for help with using this project
title: ''
labels: question
assignees: ''

---

DO NOT OPEN AN ISSUE IF YOU ARE ASKING FOR HELP. USE THE DISCUSSION FORUM INSTEAD.

General questions or help with code: https://github.com/waylaidwanderer/node-chatgpt-api/discussions/new?category=help

Other discussions: https://github.com/waylaidwanderer/node-chatgpt-api/discussions/new?category=discussions
51 changes: 51 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish Docker image

on:
workflow_dispatch:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker metadata(ghcr)
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/node-chatgpt-api
tags: |
type=raw,value=latest
type=sha,format=long

- name: Build and push Docker image(ghcr)
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ dist
.pnp.*

# node-chatgpt-api
settings.js
test.js
*.test.js
*.cast
Expand Down
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/index.js"
}
]
}
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM alpine:latest

RUN apk add nodejs
RUN apk add npm

COPY ./ /var/chatgpt-api

WORKDIR /var/chatgpt-api
RUN npm ci --no-color --quiet
FROM node:18-alpine

ENV API_HOST=0.0.0.0
WORKDIR /app
COPY . .

RUN npm install
EXPOSE 3000

ENTRYPOINT npm start
CMD ["npm", "run", "start"]
Loading