Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ad6764bf3 | ||
|
|
8c3b8d514a | ||
|
|
6e5eb92022 | ||
|
|
4e9fed6266 |
@@ -9,7 +9,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# App
|
# App
|
||||||
APP_NAME: str = "AI Worker Platform"
|
APP_NAME: str = "AI Worker Platform"
|
||||||
APP_VERSION: str = "1.0.0"
|
APP_VERSION: str = "1.1.0"
|
||||||
SECRET_KEY: str = "dev-secret-key-change-in-production"
|
SECRET_KEY: str = "dev-secret-key-change-in-production"
|
||||||
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24 hours
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24 hours
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ class Settings(BaseSettings):
|
|||||||
REDIS_URL: str = ""
|
REDIS_URL: str = ""
|
||||||
|
|
||||||
# LLM Defaults
|
# LLM Defaults
|
||||||
DEFAULT_LLM_PROVIDER: str = "openai"
|
DEFAULT_LLM_PROVIDER: str = "deepseek"
|
||||||
DEFAULT_LLM_API_KEY: str = ""
|
DEFAULT_LLM_API_KEY: str = ""
|
||||||
DEFAULT_LLM_BASE_URL: str = "https://api.openai.com/v1"
|
DEFAULT_LLM_BASE_URL: str = "https://api.deepseek.com"
|
||||||
DEFAULT_LLM_MODEL: str = "gpt-4o-mini"
|
DEFAULT_LLM_MODEL: str = "deepseek-v4-flash"
|
||||||
|
|
||||||
# CORS
|
# CORS
|
||||||
CORS_ORIGINS: str = "http://localhost:5173,http://localhost:3000"
|
CORS_ORIGINS: str = "http://localhost:5173,http://localhost:3000"
|
||||||
|
|||||||
@@ -99,11 +99,13 @@ class LLMGateway:
|
|||||||
"""Estimate cost in cents. Rough pricing, adjustable."""
|
"""Estimate cost in cents. Rough pricing, adjustable."""
|
||||||
# Per 1M tokens, in cents (1 USD = 100 cents)
|
# Per 1M tokens, in cents (1 USD = 100 cents)
|
||||||
pricing = {
|
pricing = {
|
||||||
"gpt-4o": {"input": 250, "output": 1000}, # $2.50 / $10 per 1M
|
"gpt-4o": {"input": 250, "output": 1000},
|
||||||
"gpt-4o-mini": {"input": 15, "output": 60}, # $0.15 / $0.60 per 1M
|
"gpt-4o-mini": {"input": 15, "output": 60},
|
||||||
"gpt-4-turbo": {"input": 1000, "output": 3000},
|
"gpt-4-turbo": {"input": 1000, "output": 3000},
|
||||||
"deepseek-chat": {"input": 14, "output": 28},
|
"deepseek-chat": {"input": 14, "output": 28},
|
||||||
"deepseek-reasoner": {"input": 55, "output": 219},
|
"deepseek-reasoner": {"input": 55, "output": 219},
|
||||||
|
"deepseek-v4-flash": {"input": 14, "output": 28},
|
||||||
|
"qwen3.6-plus": {"input": 40, "output": 120},
|
||||||
}
|
}
|
||||||
rates = pricing.get(model, {"input": 15, "output": 60}) # default: cheap
|
rates = pricing.get(model, {"input": 15, "output": 60}) # default: cheap
|
||||||
cost = (
|
cost = (
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import ProjectDetail from '@/pages/ProjectDetail';
|
|||||||
import Tasks from '@/pages/Tasks';
|
import Tasks from '@/pages/Tasks';
|
||||||
import Workers from '@/pages/Workers';
|
import Workers from '@/pages/Workers';
|
||||||
import Reviews from '@/pages/Reviews';
|
import Reviews from '@/pages/Reviews';
|
||||||
|
import Alerts from '@/pages/Alerts';
|
||||||
|
import KnowledgeBase from '@/pages/KnowledgeBase';
|
||||||
|
|
||||||
function ProtectedRoute({ children }: { children: React.ReactNode }) {
|
function ProtectedRoute({ children }: { children: React.ReactNode }) {
|
||||||
const { isAuthenticated } = useAuthStore();
|
const { isAuthenticated } = useAuthStore();
|
||||||
@@ -57,6 +59,8 @@ export default function App() {
|
|||||||
<Route path="tasks" element={<Tasks />} />
|
<Route path="tasks" element={<Tasks />} />
|
||||||
<Route path="workers" element={<Workers />} />
|
<Route path="workers" element={<Workers />} />
|
||||||
<Route path="reviews" element={<Reviews />} />
|
<Route path="reviews" element={<Reviews />} />
|
||||||
|
<Route path="alerts" element={<Alerts />} />
|
||||||
|
<Route path="knowledge" element={<KnowledgeBase />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="*" element={<Navigate to="/" replace />} />
|
<Route path="*" element={<Navigate to="/" replace />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import {
|
|||||||
CheckSquareOutlined,
|
CheckSquareOutlined,
|
||||||
RobotOutlined,
|
RobotOutlined,
|
||||||
AuditOutlined,
|
AuditOutlined,
|
||||||
|
AlertOutlined,
|
||||||
|
BookOutlined,
|
||||||
LogoutOutlined,
|
LogoutOutlined,
|
||||||
MenuFoldOutlined,
|
MenuFoldOutlined,
|
||||||
MenuUnfoldOutlined,
|
MenuUnfoldOutlined,
|
||||||
@@ -70,6 +72,16 @@ const menuItems: MenuProps['items'] = [
|
|||||||
icon: <AuditOutlined />,
|
icon: <AuditOutlined />,
|
||||||
label: '审核管理',
|
label: '审核管理',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: '/alerts',
|
||||||
|
icon: <AlertOutlined />,
|
||||||
|
label: '告警中心',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '/knowledge',
|
||||||
|
icon: <BookOutlined />,
|
||||||
|
label: '知识库',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function AppLayout() {
|
export default function AppLayout() {
|
||||||
|
|||||||
Reference in New Issue
Block a user