import System from "@/models/system"; import { useState, useEffect } from "react"; export default function TogetherAiOptions({ settings }) { return (
{!settings?.credentialsOnly && ( )}
); } function TogetherAiModelSelection({ settings }) { const [groupedModels, setGroupedModels] = useState({}); const [loading, setLoading] = useState(true); useEffect(() => { async function findCustomModels() { setLoading(true); const { models } = await System.customModels("togetherai"); if (models?.length > 0) { const modelsByOrganization = models.reduce((acc, model) => { acc[model.organization] = acc[model.organization] || []; acc[model.organization].push(model); return acc; }, {}); setGroupedModels(modelsByOrganization); } setLoading(false); } findCustomModels(); }, []); if (loading || Object.keys(groupedModels).length === 0) { return (
); } return (
); }