iamwavecut / ngbot

simple gatekeeper telegram bot
53 stars 3 forks source link

OpenAI model is not customisable from ENV #11

Open Kuzzy opened 1 month ago

Kuzzy commented 1 month ago

Hi, it looks like OpenAI model from ENV is not taken into account.

To reproduce change this line https://github.com/iamwavecut/ngbot/blob/944e38f212601d64a0f886d5868491be14087914/internal/handlers/reactor.go#L301

to: entry.Info("sending first message to OpenAI for spam check to model: ", r.model).

Then:

# Export other ENV variables
export OPENAI_MODEL=ft:gpt-4o-mini-2024-07-18:xxxxxx

CGO_ENABLE=1 go run .

Check logs, and you will see that logged model is default gpt-4o-mini

iamwavecut commented 4 weeks ago

Generally, all the env variables are prepended with NG_, please, try exporting it this way @Kuzzy