Skip to content

Commit

Permalink
Merge branch 'master' of github.com:akorchyn/ohsumbot
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn committed Feb 3, 2024
2 parents adeb542 + ab0d06e commit 958ffa4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches: [ master ]

jobs:
build:
runs-on: self-hosted
steps:
- name: git pull and build
run: |
cd /home/ubuntu/ohsumbot
git pull origin master
cargo build --release
docker-compose build --no-cache
docker-compose up -d
shell: bash

6 changes: 3 additions & 3 deletions src/openai/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ impl OpenAIClient {
let client: Client = Client::new(self.api_key.clone());

let max_tokens = match gpt_length {
GPTLenght::Short => 32,
GPTLenght::Medium => 64,
GPTLenght::Long => 128,
GPTLenght::Short => 64,
GPTLenght::Medium => 128,
GPTLenght::Long => 256,
};

let req = ChatCompletionRequest::new(
Expand Down
4 changes: 2 additions & 2 deletions src/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ impl Processor {
})
.unwrap_or(false);

if bot_name.is_some() && bot_name != self.me.username() {
if bot_name.is_some() && bot_name != Some("") && bot_name != self.me.username() {
return Ok(());
}

if cmd == "/help" {
self.client.send_message(&message.chat(), usage()).await?;
} else if cmd == "/summarize" || cmd == "/small " || cmd == "/medium" || cmd == "/large" {
} else if cmd == "/summarize" || cmd == "/small" || cmd == "/medium" || cmd == "/large" {
let length = match cmd {
"/summarize" => GPTLenght::Medium,
"/small" => GPTLenght::Short,
Expand Down

0 comments on commit 958ffa4

Please sign in to comment.