-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🔧 add LLMProviderFeatures component and update docs
- Loading branch information
Showing
4 changed files
with
100 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
import LLMS from "../../../packages/core/src/llms.json" | ||
interface Props { | ||
provider: string | ||
} | ||
const { provider } = Astro.props | ||
const info: Record<string, boolean> & { openaiCompatibility?: string } = | ||
LLMS.providers.find(({ id }) => id === provider) as any | ||
if (!info) { | ||
throw new Error(`Provider ${provider} not found`) | ||
} | ||
const features: Record<string, { name?: string; url?: string }> = { | ||
seed: { | ||
name: "Seed ignored", | ||
}, | ||
topP: { | ||
name: "top_p ignored", | ||
}, | ||
logprobs: { | ||
name: "logprobs (and top logprobs) ignored", | ||
}, | ||
topLogrobs: { | ||
name: "Top logprobs ignored", | ||
}, | ||
tools: { | ||
name: "Tools implemented as fallback tools automatically.", | ||
}, | ||
} | ||
const oai = info.openaiCompatibility | ||
const unsupported = Object.keys(info) | ||
.sort() | ||
.map((id) => ({ id, supported: info[id] })) | ||
.filter(({ supported }) => supported === false) | ||
--- | ||
|
||
{ | ||
oai || unsupported?.length > 0 ? ( | ||
<> | ||
<h3>Limitations</h3> | ||
<ul> | ||
{!!oai && ( | ||
<li> | ||
Uses <a href={oai}>OpenAI compatibility layer</a> | ||
</li> | ||
)} | ||
{Object.keys(features) | ||
.map((id) => ({ id, supported: info[id] })) | ||
.filter(({ supported }) => supported === false) | ||
.map(({ id }) => ( | ||
<li>{features[id]?.name || id}</li> | ||
))} | ||
</ul> | ||
</> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters