mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 13:19:20 +00:00
修改(报错的是api问题)
This commit is contained in:
parent
51e483c6a1
commit
7cd3ca0f72
@ -1,8 +1,8 @@
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from ...config import settings
|
||||
from ..services.ai_service import call_ai_api
|
||||
from src.backend.config import settings
|
||||
from src.backend.app.services.ai_service import call_ai_api
|
||||
import logging
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -1,6 +1,6 @@
|
||||
from fastapi import APIRouter
|
||||
from .command_parser import router as command_router
|
||||
from .network_config import router as config_router
|
||||
from src.backend.app.api.command_parser import router as command_router
|
||||
from src.backend.app.api.network_config import router as config_router
|
||||
|
||||
router = APIRouter()
|
||||
router.include_router(command_router, prefix="/parse_command", tags=["Command Parsing"])
|
||||
|
@ -1,7 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from .api import router as api_router
|
||||
from .config import settings
|
||||
from src.backend.app.api.command_parser import router as api_router
|
||||
from src.backend.config import settings
|
||||
|
||||
app = FastAPI(title=settings.app_name)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import aiohttp
|
||||
import logging
|
||||
from typing import Dict, Any
|
||||
from ...config import settings
|
||||
from src.backend.config import settings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -56,4 +56,4 @@ async def call_ai_api(command: str, device_type: str, vendor: str, api_key: str)
|
||||
return {
|
||||
"success": False,
|
||||
"message": f"Error calling AI API: {str(e)}"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user