mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-06 18:43:30 +00:00
chatgpt: ensure no extra newline in header
This commit is contained in:
parent
f0faa23ad5
commit
ad0e7fd01f
@ -155,7 +155,7 @@ void ChatGPTWorker::request(const QString &apiKey,
|
|||||||
m_ctx = promptCtx;
|
m_ctx = promptCtx;
|
||||||
|
|
||||||
QUrl openaiUrl("https://api.openai.com/v1/chat/completions");
|
QUrl openaiUrl("https://api.openai.com/v1/chat/completions");
|
||||||
const QString authorization = QString("Bearer %1").arg(apiKey);
|
const QString authorization = QString("Bearer %1").arg(apiKey).trimmed();
|
||||||
QNetworkRequest request(openaiUrl);
|
QNetworkRequest request(openaiUrl);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
request.setRawHeader("Authorization", authorization.toUtf8());
|
request.setRawHeader("Authorization", authorization.toUtf8());
|
||||||
|
Loading…
Reference in New Issue
Block a user