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:
DreamGenX
2024-03-07 10:55:08 +01:00
parent bb53fef531
commit 5c410986a4
14 changed files with 223 additions and 8 deletions

View File

@ -177,6 +177,7 @@ const TEXTGEN_TYPES = {
LLAMACPP: 'llamacpp',
OLLAMA: 'ollama',
INFERMATICAI: 'infermaticai',
DREAMGEN: 'dreamgen',
OPENROUTER: 'openrouter',
};
@ -192,6 +193,22 @@ const INFERMATICAI_KEYS = [
'stop',
];
// https://dreamgen.com/docs/api#openai-text
const DREAMGEN_KEYS = [
'model',
'prompt',
'max_tokens',
'temperature',
'top_p',
'top_k',
'min_p',
'repetition_penalty',
'frequency_penalty',
'presence_penalty',
'stop',
'minimum_message_content_tokens'
];
// https://docs.together.ai/reference/completions
const TOGETHERAI_KEYS = [
'model',
@ -263,6 +280,7 @@ module.exports = {
TOGETHERAI_KEYS,
OLLAMA_KEYS,
INFERMATICAI_KEYS,
DREAMGEN_KEYS,
OPENROUTER_HEADERS,
OPENROUTER_KEYS,
};