Use openai compatible as vendor
This commit is contained in:
@@ -13,7 +13,7 @@ const maskApiKey = (key?: string) => {
|
||||
export const LLMLibraryPage: React.FC = () => {
|
||||
const [models, setModels] = useState<LLMModel[]>([]);
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [vendorFilter, setVendorFilter] = useState<string>('all');
|
||||
const [vendorFilter, setVendorFilter] = useState<string>('OpenAI Compatible');
|
||||
const [typeFilter, setTypeFilter] = useState<string>('all');
|
||||
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
|
||||
const [editingModel, setEditingModel] = useState<LLMModel | null>(null);
|
||||
@@ -41,7 +41,7 @@ export const LLMLibraryPage: React.FC = () => {
|
||||
m.name.toLowerCase().includes(q) ||
|
||||
(m.modelName || '').toLowerCase().includes(q) ||
|
||||
(m.baseUrl || '').toLowerCase().includes(q);
|
||||
const matchesVendor = vendorFilter === 'all' || m.vendor === vendorFilter;
|
||||
const matchesVendor = m.vendor === vendorFilter;
|
||||
const matchesType = typeFilter === 'all' || m.type === typeFilter;
|
||||
return matchesSearch && matchesVendor && matchesType;
|
||||
});
|
||||
@@ -64,8 +64,6 @@ export const LLMLibraryPage: React.FC = () => {
|
||||
setModels((prev) => prev.filter((item) => item.id !== id));
|
||||
};
|
||||
|
||||
const vendorOptions = Array.from(new Set(models.map((m) => m.vendor).filter(Boolean)));
|
||||
|
||||
return (
|
||||
<div className="space-y-6 animate-in fade-in py-4 pb-10">
|
||||
<div className="flex items-center justify-between">
|
||||
@@ -92,10 +90,7 @@ export const LLMLibraryPage: React.FC = () => {
|
||||
value={vendorFilter}
|
||||
onChange={(e) => setVendorFilter(e.target.value)}
|
||||
>
|
||||
<option value="all">所有厂商</option>
|
||||
{vendorOptions.map((vendor) => (
|
||||
<option key={vendor} value={vendor}>{vendor}</option>
|
||||
))}
|
||||
<option value="OpenAI Compatible">OpenAI Compatible</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
@@ -284,8 +279,6 @@ const LLMModelModal: React.FC<{
|
||||
onChange={(e) => setVendor(e.target.value)}
|
||||
>
|
||||
<option value="OpenAI Compatible">OpenAI Compatible</option>
|
||||
<option value="OpenAI">OpenAI</option>
|
||||
<option value="SiliconFlow">SiliconFlow</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user