Skip to content

Commit

Permalink
Fix openai api key
Browse files Browse the repository at this point in the history
Restore the ability to use API key
  • Loading branch information
Palm1r authored Nov 11, 2024
2 parents 87393b6 + cd6c766 commit 29f9456
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/OpenAICompatProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ void OpenAICompatProvider::prepareRequest(QJsonObject &request, LLMCore::Request
request["frequency_penalty"] = settings.frequencyPenalty();
if (settings.usePresencePenalty())
request["presence_penalty"] = settings.presencePenalty();
const QString &apiKey = settings.apiKey();
if (!apiKey.isEmpty()) {
request["api_key"] = apiKey;
}
};

QJsonArray messages = prepareMessages(request);
Expand Down

0 comments on commit 29f9456

Please sign in to comment.