feat: add OpenRouter service template (#581)

This commit is contained in:
Phil 2024-05-28 09:27:13 +02:00 committed by Carl-Robert Linnupuu
parent e96f6a418a
commit 6aee749ade
2 changed files with 21 additions and 0 deletions

View file

@ -99,6 +99,22 @@ enum class CustomServiceChatCompletionTemplate(
"max_tokens" to 1024
)
)
),
OPEN_ROUTER(
"https://openrouter.ai/api/v1/chat/completions",
getDefaultHeaders(
mapOf(
"Authorization" to "Bearer \$CUSTOM_SERVICE_API_KEY",
"HTTP-Referer" to "https://plugins.jetbrains.com/plugin/21056-codegpt",
"X-Title" to "CodeGPT"
)
),
getDefaultBodyParams(
mapOf(
"model" to "meta-llama/llama-3-8b-instruct:free",
"max_tokens" to 1024
)
)
);
}

View file

@ -66,6 +66,11 @@ enum class CustomServiceTemplate(
"Mistral AI",
"https://docs.mistral.ai/getting-started/quickstart",
CustomServiceChatCompletionTemplate.MISTRAL_AI
),
OPEN_ROUTER(
"OpenRouter",
"https://openrouter.ai/docs#quick-start",
CustomServiceChatCompletionTemplate.OPEN_ROUTER
);
override fun toString(): String {