mirror of
https://github.com/Routstr/routstrd.git
synced 2026-08-09 03:44:38 +00:00
Merge pull request #38 from Routstr/feat/pi-integration-contexts
feat: add context window support to pi integration
This commit is contained in:
@@ -7,6 +7,7 @@ import { callDaemon, getDaemonBaseUrl } from "../utils/daemon-client";
|
||||
|
||||
type PiModelEntry = {
|
||||
id: string;
|
||||
contextWindow?: number;
|
||||
};
|
||||
|
||||
type PiProviderConfig = {
|
||||
@@ -59,9 +60,13 @@ export async function installPiIntegration(
|
||||
return;
|
||||
}
|
||||
|
||||
const providerModels: PiModelEntry[] = models.map((model) => ({
|
||||
id: model.id,
|
||||
}));
|
||||
const providerModels: PiModelEntry[] = models.map((model) => {
|
||||
const entry: PiModelEntry = { id: model.id };
|
||||
if (model.context_length !== undefined && model.context_length > 0) {
|
||||
entry.contextWindow = model.context_length;
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
|
||||
piConfig.providers["routstr"] = {
|
||||
baseUrl,
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface IntegrationConfig {
|
||||
export type RoutstrModel = {
|
||||
id: string;
|
||||
name?: string;
|
||||
context_length?: number;
|
||||
};
|
||||
|
||||
export type IntegrationFn = (
|
||||
|
||||
Reference in New Issue
Block a user