Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/qa-lab/src/providers/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  image-generation.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { QA_BASE_RUNTIME_PLUGIN_IDS } from "../qa-gateway-config.js";
import type { QaProviderMode } from "./index.js";
import { getQaProvider } from "./index.js";

type QaImageGenerationPatchInput = {
  providerMode: QaProviderMode;
  providerBaseUrl?: string;
  requiredPluginIds: readonly string[];
  existingPluginIds?: readonly string[];
};

function splitModelProviderId(modelRef: string) {
  const slash = modelRef.indexOf("/");
  return slash > 0 ? modelRef.slice(0, slash) : null;
}

function uniqueNonEmpty(values: readonly (string | null | undefined)[]) {
  return [
    ...new Set(values.map((value) => value?.trim()).filter((value): value is string => !!value)),
  ];
}

export function buildQaImageGenerationConfigPatch(input: QaImageGenerationPatchInput) {
  const provider = getQaProvider(input.providerMode);
  const imageModelRef = provider.defaultImageGenerationModel({
    modelProviderIds: provider.defaultImageGenerationProviderIds,
  });
  if (!imageModelRef) {
    throw new Error(
      `QA provider "${input.providerMode}" does not expose an image generation model`,
    );
  }
  const imageProviderId = splitModelProviderId(imageModelRef);
  const modelPatch = (() => {
    if (provider.kind !== "mock") {
      return null;
    }
    if (!input.providerBaseUrl) {
      throw new Error(`QA provider "${input.providerMode}" requires a mock provider URL`);
    }
    return provider.buildGatewayModels({
      providerBaseUrl: input.providerBaseUrl,
    });
  })();
  const providerPluginIds = provider.usesModelProviderPlugins ? [imageProviderId] : [];
  const enabledPluginIds = uniqueNonEmpty(providerPluginIds);

  return {
    plugins: {
      allow: uniqueNonEmpty([
        ...QA_BASE_RUNTIME_PLUGIN_IDS,
        ...(input.existingPluginIds ?? []),
        ...enabledPluginIds,
        ...input.requiredPluginIds,
      ]),
      ...(enabledPluginIds.length > 0
        ? {
            entries: Object.fromEntries(
              enabledPluginIds.map((pluginId) => [pluginId, { enabled: true }]),
            ),
          }
        : {}),
    },
    ...(modelPatch
      ? {
          models: {
            mode: modelPatch.mode,
            providers: modelPatch.providers,
          },
        }
      : {}),
    agents: {
      defaults: {
        imageGenerationModel: {
          primary: imageModelRef,
        },
      },
    },
  };
}

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.