Spaces:
Sleeping
Sleeping
helloguddn (PC helloguddn)
feat: 의존성, chat 엔드포인트, gemini function calling, 이미지 추출, Maps 연동, 노동법 RAG(google.text-embedding-004)
f4bf832 Download routers/chat.py from helloguddn/Suwon_multiculturalism: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/helloguddn/Suwon_multiculturalism/resolve/main/routers/chat.py
- Command line
-
hf download hf://spaces/helloguddn/Suwon_multiculturalism/routers/chat.py
-
curl -L -o chat.py https://huggingface.co/spaces/helloguddn/Suwon_multiculturalism/resolve/main/routers/chat.py
400 Bytes
| from fastapi import APIRouter, HTTPException | |
| from schemas.chat import ChatRequest, ChatResponse | |
| from agents.main_agent import run_agent | |
| router = APIRouter() | |
| async def chat(request: ChatRequest) -> ChatResponse: | |
| try: | |
| return await run_agent(request) | |
| except Exception as exc: | |
| raise HTTPException(status_code=500, detail=str(exc)) | |