Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/src/commands/models/   (Openclaw AI Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  list.row-sources.ts

  Sprache: JAVA
 

import type { ModelRegistry } from "@mariozechner/pi-coding-agent";
import {
  appendCatalogSupplementRows,
  appendConfiguredProviderRows,
  appendConfiguredRows,
  appendDiscoveredRows,
  appendProviderCatalogRows,
  type RowBuilderContext,
} from "./list.rows.js";
import type { ConfiguredEntry, ModelRow } from "./list.types.js";

type AllModelRowSources = {
  rows: ModelRow[];
  context: RowBuilderContext;
  modelRegistry?: ModelRegistry;
  useProviderCatalogFastPath: boolean;
};

type AppendAllModelRowSourcesResult = {
  requiresRegistryFallback: boolean;
};

export function modelRowSourcesRequireRegistry(params: {
  all?: boolean;
  providerFilter?: string;
  useProviderCatalogFastPath: boolean;
}): boolean {
  if (!params.all) {
    return false;
  }
  if (params.providerFilter && params.useProviderCatalogFastPath) {
    return false;
  }
  return true;
}

export async function appendAllModelRowSources(
  params: AllModelRowSources,
): Promise<AppendAllModelRowSourcesResult> {
  if (params.context.filter.provider && params.useProviderCatalogFastPath) {
    let seenKeys = new Set<string>();
    appendConfiguredProviderRows({
      rows: params.rows,
      context: params.context,
      seenKeys,
    });
    const catalogRows = await appendProviderCatalogRows({
      rows: params.rows,
      context: params.context,
      seenKeys,
      staticOnly: true,
    });
    if (catalogRows === 0) {
      if (!params.modelRegistry) {
        return { requiresRegistryFallback: true };
      }
      appendDiscoveredRows({
        rows: params.rows,
        models: params.modelRegistry.getAll(),
        modelRegistry: params.modelRegistry,
        context: params.context,
      });
    }
    return { requiresRegistryFallback: false };
  }

  const seenKeys = appendDiscoveredRows({
    rows: params.rows,
    models: params.modelRegistry?.getAll() ?? [],
    modelRegistry: params.modelRegistry,
    context: params.context,
  });

  appendConfiguredProviderRows({
    rows: params.rows,
    context: params.context,
    seenKeys,
  });

  if (params.modelRegistry && !params.context.filter.provider) {
    await appendCatalogSupplementRows({
      rows: params.rows,
      modelRegistry: params.modelRegistry,
      context: params.context,
      seenKeys,
    });
    return { requiresRegistryFallback: false };
  }

  await appendProviderCatalogRows({
    rows: params.rows,
    context: params.context,
    seenKeys,
  });
  return { requiresRegistryFallback: false };
}

export function appendConfiguredModelRowSources(params: {
  rows: ModelRow[];
  entries: ConfiguredEntry[];
  modelRegistry: ModelRegistry;
  context: RowBuilderContext;
}): void {
  appendConfiguredRows(params);
}

Messung V0.5 in Prozent
C=100 H=98 G=98

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.