-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New option: --openai.apibase [$OPENAI_API_BASE]
#135
Conversation
lib/tgspam/openai.go
Outdated
@@ -22,6 +22,7 @@ type openAIChecker struct { | |||
|
|||
// OpenAIConfig contains parameters for openAIChecker | |||
type OpenAIConfig struct { | |||
BaseURL string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why we even need this new field here? from what I see, the only place you should set it is in main.go makeDetector (which you did), but I can't understand why it is added here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
…without --openai.token Motivation: some services can work without apikey (token)
fcca3c7
to
1a5b3c1
Compare
1a5b3c1
to
ae753ca
Compare
So this change will make it possible to use custom self-hosted endpoints assuming they have OpenAI compatible APIs, am I right? |
@georg3k |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx
OpenAI integration can be activated by specifying
--openai.apibase
, even without the--openai.token
, since some services may function without an API key (token).Additionally:
gpt-4o-mini
.Please ignore any changes that are not directly relevant.
Warning
As I am not a Go programmer, please ensure that the suggested changes are correct.