Itration 0 from deepseek
This commit is contained in:
26
services/orchestrator/app.py
Normal file
26
services/orchestrator/app.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from fastapi import FastAPI
|
||||
import redis
|
||||
import os
|
||||
import json
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||
redis_port = int(os.getenv("REDIS_PORT", 6379))
|
||||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True)
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "ok", "service": "orchestrator"}
|
||||
|
||||
@app.post("/process")
|
||||
async def process_text(request: dict):
|
||||
# Здесь будет логика обработки текста и вызова инструментов
|
||||
text = request.get("text", "")
|
||||
user = request.get("user", "guest")
|
||||
print(f"Processing from {user}: {text}")
|
||||
|
||||
# Простой ответ для теста
|
||||
response = "Я получил ваше сообщение, но пока не умею отвечать."
|
||||
|
||||
return {"response": response}
|
||||
10
services/orchestrator/dockerfile
Normal file
10
services/orchestrator/dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
5
services/orchestrator/requirements.txt
Normal file
5
services/orchestrator/requirements.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
fastapi==0.115.0
|
||||
uvicorn[standard]==0.30.1
|
||||
redis==5.0.4
|
||||
pydantic==2.8.2
|
||||
python-dotenv==1.0.1
|
||||
Reference in New Issue
Block a user