From aa7f3340d046368b56d0f5cb01ef7e17d5faf9ec Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Sat, 21 Dec 2024 04:36:40 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20aliases=20and=20logit?= =?UTF-8?q?=5Fbias=20support=20to=20providers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/src/components/LLMProviderFeatures.astro | 55 +++++++++++++++---- .../docs/getting-started/configuration.mdx | 2 +- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/docs/src/components/LLMProviderFeatures.astro b/docs/src/components/LLMProviderFeatures.astro index 164a625a9..104ff98f0 100644 --- a/docs/src/components/LLMProviderFeatures.astro +++ b/docs/src/components/LLMProviderFeatures.astro @@ -5,8 +5,11 @@ interface Props { provider: string } const { provider } = Astro.props -const info: Record & { openaiCompatibility?: string, limitations?: boolean } = - LLMS.providers.find(({ id }) => id === provider) as any +const info: Record & { + openaiCompatibility?: string + limitations?: boolean + aliases?: Record +} = LLMS.providers.find(({ id }) => id === provider) as any if (!info) { throw new Error(`Provider ${provider} not found`) } @@ -17,6 +20,9 @@ const features: Record = { topP: { name: "top_p ignored", }, + logitBias: { + name: "logit_bias ignored", + }, logprobs: { name: "logprobs (and top logprobs) ignored", }, @@ -26,31 +32,58 @@ const features: Record = { tools: { name: "Tools implemented as fallback tools automatically.", }, + prediction: { + name: "Ignore prediction of output tokens", + }, } -const { openaiCompatibility, limitations, ...rest } = info +const { openaiCompatibility, limitations, aliases, bearerToken, ...rest } = info const unsupported = Object.keys(rest) .sort() .map((id) => ({ id, supported: info[id] })) .filter(({ supported }) => supported === false) --- +{ + aliases && ( + <> +

Aliases

+

+ The following model aliases are attempted by default in + GenAIScript. +

+ + + + + + {Object.entries(aliases).map(([key, value]) => ( + + + + + ))} +
AliasModel identifier
{key}{value}
+ + ) +} + { openaiCompatibility || limitations || unsupported?.length > 0 ? ( <> -

Limitations

+

Limitations

    {!!limitations &&
  • {limitations}
  • } {!!openaiCompatibility && (
  • - Uses OpenAI compatibility layer + Uses{" "} + + OpenAI compatibility layer +
  • )} - {Object.keys(features) - .map((id) => ({ id, supported: info[id] })) - .filter(({ supported }) => supported === false) - .map(({ id }) => ( -
  • {features[id]?.name || id}
  • - ))} + {unsupported.map(({ id }) => ( +
  • {features[id]?.name || id}
  • + ))}
) : null diff --git a/docs/src/content/docs/getting-started/configuration.mdx b/docs/src/content/docs/getting-started/configuration.mdx index 1123382b1..00ec0dc96 100644 --- a/docs/src/content/docs/getting-started/configuration.mdx +++ b/docs/src/content/docs/getting-started/configuration.mdx @@ -984,7 +984,7 @@ script({ - + ## Alibaba Cloud