Spaces:
Sleeping
Sleeping
metadata
title: CAAINP Backend
emoji: π§
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
license: mit
caanip-backend
κ°μ
μ΄ νλ‘μ νΈλ μ€λ΄ λ€λΉκ²μ΄μ μ μν λ°±μλ APIλ₯Ό μ 곡ν©λλ€. μ¬μ©μμ μμ°μ΄ μμ²κ³Ό νμ₯ μ΄λ―Έμ§λ₯Ό λ°μ λ€λΉκ²μ΄μ μλ΄λ₯Ό μμ±ν©λλ€.
μ€μΉ λ° μ€ν
μ¬μ μꡬμ¬ν
- Python 3.12 μ΄μ
- uv
μ€μΉ
uv sync
μ€ν
uvicorn server:app --reload
μλ²λ κΈ°λ³Έμ μΌλ‘ http://localhost:8000μμ μ€νλ©λλ€.
API λ¬Έμλ http://localhost:8000/docsμμ νμΈν μ μμ΅λλ€.
API μλν¬μΈνΈ
POST /api/navigation/start
- μμ°μ΄ μμ²κ³Ό μμ λ°©, νμ₯ μ΄λ―Έμ§λ₯Ό λ°μ λ€λΉκ²μ΄μ μΈμ μ μμ±νκ³ μ²« μλ΄λ₯Ό λ°ν
- Form λ°μ΄ν°:
request_text(μμ°μ΄ μμ²),start_room(μμ λ°© λ²νΈ), File:image(νμ₯ μ΄λ―Έμ§) - μλ΅: 첫 λ€λΉκ²μ΄μ
μλ΄(JSON). μΈμ
μνκ°
CAAINP-NAVIGATION-COOKIEμ μ μ₯λ¨.
POST /api/navigation/step
- μΏ ν€μ μ μ₯λ μΈμ μν(plan, prev_node)λ₯Ό μ¬μ©ν΄ λ€μ λ¨κ³ μλ΄λ₯Ό λ°ν
- File:
image(νμ₯ μ΄λ―Έμ§) - μΈμ
μ΄ μμΌλ©΄
{ "status": "error", "message": "/api/navigation/startλ₯Ό λ¨Όμ νΈμΆνμΈμ." }λ°ν - μλ΅ μμ:
{
"schema_version": 1,
"current_node": 4106,
"next_node": 4103,
"move_instruction": {
"direction_type": "STRAIGHT",
"angle_deg": 0.0,
"text_ko": "μ§μ§νμΈμ."
},
"route_summary": {
"current_step": 1,
"total_steps": 3,
"remaining_steps_text": "μλ¦¬λ² μ΄ν° β 4μΈ΅ 410νΈ β 7μΈ΅ 7201νΈ μμΌλ‘ μ΄λ",
"via_nodes": [4150, 410, 7201]
}
}
POST /api/navigation/reset
- μ μ₯λ λ€λΉκ²μ΄μ μΏ ν€ μμ ν μΈμ μ΄κΈ°ν
- μλ΅:
{ "status": "success", "message": "λ€λΉκ²μ΄μ μΈμ μ΄ μ΄κΈ°νλμμ΅λλ€." }
POST /api/navigation/mock
- μ€μ μμ§ λμ λͺ¨μ μλ΅ λ°ν(λλ²κΉ /νλ‘ νΈμλ μ°λμ©)
- Form:
request_text, File:image - μλ΅: λͺ¨μ λ€λΉκ²μ΄μ JSON
GET /api/cookie/get
- νμ¬ μμ²μ
CAAINP-NAVIGATION-COOKIEκ°μ μ‘°ν - μλ΅:
{ "cookie": {plan, prev_node} | null }
GET /api/cookie/delete
- λ€λΉκ²μ΄μ μΏ ν€ μμ
- μλ΅:
{ "status": "success", "message": "μΏ ν€κ° μ±κ³΅μ μΌλ‘ μμ λμμ΅λλ€." }
ν μ€νΈ
uv run tests/navigation_test.py
νλ‘μ νΈ κ΅¬μ‘°
caanip-backend/
βββ server.py # FastAPI μ ν리μΌμ΄μ
λ©μΈ νμΌ
βββ mock_responses.py # λͺ¨μ λ€λΉκ²μ΄μ
μλ΅ μμ± λͺ¨λ
βββ pyproject.toml # νλ‘μ νΈ μ€μ λ° μμ‘΄μ±
βββ README.md # νλ‘μ νΈ λ¬Έμ