fix(ui): resolve alias conflict for jina-reader in curl example (#1241)

* fix(ui): resolve alias conflict for jina-reader in curl example

* docs(skills): correct web-fetch and web-search model examples
This commit is contained in:
Blue Hoang
2026-05-18 11:59:43 +07:00
committed by GitHub
parent 0e4e58930f
commit 462d1c5ca3
3 changed files with 37 additions and 9 deletions
@@ -5,7 +5,7 @@ import Link from "next/link";
import { useState, useEffect } from "react";
import { Card, Badge, Button, AddCustomEmbeddingModal, NoAuthProxyCard, ProviderInfoCard } from "@/shared/components";
import ProviderIcon from "@/shared/components/ProviderIcon";
import { MEDIA_PROVIDER_KINDS, AI_PROVIDERS, getProviderAlias, isCustomEmbeddingProvider } from "@/shared/constants/providers";
import { MEDIA_PROVIDER_KINDS, AI_PROVIDERS, getProviderAlias, isCustomEmbeddingProvider, resolveProviderId } from "@/shared/constants/providers";
import { getModelsByProviderId } from "@/shared/constants/models";
import { useCopyToClipboard } from "@/shared/hooks/useCopyToClipboard";
import ConnectionsCard from "@/app/(dashboard)/dashboard/providers/components/ConnectionsCard";
@@ -917,6 +917,8 @@ function TtsExampleCard({ providerId }) {
// Generic Example Card — config-driven for webSearch, webFetch, image, imageToText, stt, video, music
function GenericExampleCard({ providerId, kind }) {
const providerAlias = getProviderAlias(providerId);
const resolvedId = resolveProviderId(providerAlias);
const safeProviderAlias = resolvedId === providerId ? providerAlias : providerId;
const kindConfig = MEDIA_PROVIDER_KINDS.find((k) => k.id === kind);
const exConfig = KIND_EXAMPLE_CONFIG[kind];
const safeExConfig = exConfig || {};
@@ -979,10 +981,10 @@ function GenericExampleCard({ providerId, kind }) {
const endpoint = useTunnel ? tunnelEndpoint : localEndpoint;
const apiPath = kindConfig.endpoint.path;
// webSearch/webFetch: use providerAlias only. Other kinds: append model when present.
// webSearch/webFetch: use safeProviderAlias only. Other kinds: append model when present.
const modelFull = !needsModel
? providerAlias
: (selectedModel ? `${providerAlias}/${selectedModel}` : (allowManualModel ? "" : providerAlias));
? safeProviderAlias
: (selectedModel ? `${safeProviderAlias}/${selectedModel}` : (allowManualModel ? "" : safeProviderAlias));
const imageEditDefaults = getImageEditDefaults(providerId, selectedModel);
const effectiveRefImage = refImage.trim() || imageEditDefaults.image || "";
const effectiveMaskImage = maskImage.trim() || imageEditDefaults.mask_image || "";