mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add support for DreamGen API.
API docs: https://dreamgen.com/docs/models/opus/v1 API keys: https://dreamgen.com/account/api-keys I decided to base this on the text-completion API since it's more flexible with SillyTavern's prompt formating capabilities. This also means that custom context and instruct settings are required. Will add documentation in a followup PR.
This commit is contained in:
@ -27,6 +27,14 @@ function getInfermaticAIHeaders() {
|
||||
}) : {};
|
||||
}
|
||||
|
||||
function getDreamGenHeaders() {
|
||||
const apiKey = readSecret(SECRET_KEYS.DREAMGEN);
|
||||
|
||||
return apiKey ? ({
|
||||
'Authorization': `Bearer ${apiKey}`,
|
||||
}) : {};
|
||||
}
|
||||
|
||||
function getOpenRouterHeaders() {
|
||||
const apiKey = readSecret(SECRET_KEYS.OPENROUTER);
|
||||
const baseHeaders = { ...OPENROUTER_HEADERS };
|
||||
@ -98,6 +106,9 @@ function setAdditionalHeaders(request, args, server) {
|
||||
case TEXTGEN_TYPES.INFERMATICAI:
|
||||
headers = getInfermaticAIHeaders();
|
||||
break;
|
||||
case TEXTGEN_TYPES.DREAMGEN:
|
||||
headers = getDreamGenHeaders();
|
||||
break;
|
||||
case TEXTGEN_TYPES.OPENROUTER:
|
||||
headers = getOpenRouterHeaders();
|
||||
break;
|
||||
|
Reference in New Issue
Block a user