diff --git a/src/api.ts b/src/api.ts index 948559e..99a635e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -512,8 +512,17 @@ export interface LLMProvider { updatedAt: number; } +export interface AgentAllowedLLMResponse { + agentId: string; + model: string; +} + export const LLMProviderAPI = { list: () => api.get('/llm-providers').then((r) => r.data), + allowedModels: (agentId: string) => + api + .get('/llm-providers', { params: { agent_id: agentId } }) + .then((r) => r.data), create: (payload: Partial & { apiKey?: string }) => api.post<{ id: string }>('/llm-providers', payload).then((r) => r.data), update: (id: string, payload: Partial & { apiKey?: string }) => diff --git a/src/pages/AgentEditor.tsx b/src/pages/AgentEditor.tsx index 82f42c2..cd4efee 100644 --- a/src/pages/AgentEditor.tsx +++ b/src/pages/AgentEditor.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react'; -import { Button, Form, Input, InputNumber, Modal, Upload, App as AntApp, List, Popconfirm, Tag, Switch, Select, Collapse } from 'antd'; +import { Button, Form, Input, InputNumber, Modal, Upload, App as AntApp, List, Popconfirm, Tag, Switch, Select, Collapse, Checkbox } from 'antd'; import type { UploadFile } from 'antd/es/upload/interface'; import { useNavigate, useParams } from 'react-router-dom'; import { Agent, AgentAPI, ImageAPI, KnowledgeStatus, SkillType, Team, TeamAPI, AiModel, ModelAPI } from '../api'; @@ -493,33 +493,30 @@ export default function AgentEditor() { Array.isArray(value) ? value.map((item) => String(item).trim()).filter(Boolean).join(', ') : '' } > -