diff --git a/aidial_adapter_dial/app.py b/aidial_adapter_dial/app.py index 4e46da3..f77a7b8 100644 --- a/aidial_adapter_dial/app.py +++ b/aidial_adapter_dial/app.py @@ -124,7 +124,7 @@ async def parse( ) -@app.post("/openai/deployments/{deployment_id}/embeddings") +@app.post("/openai/deployments/{deployment_id:path}/embeddings") @dial_exception_decorator async def embeddings_proxy(request: Request, deployment_id: str): body = await request.json() @@ -137,7 +137,7 @@ async def embeddings_proxy(request: Request, deployment_id: str): return response.to_dict() -@app.post("/openai/deployments/{deployment_id}/chat/completions") +@app.post("/openai/deployments/{deployment_id:path}/chat/completions") @dial_exception_decorator async def chat_completions_proxy(request: Request, deployment_id: str): diff --git a/docker-compose/local/generate_config_from_listing.sh b/docker-compose/local/generate_config_from_listing.sh index e0e36b8..32410e8 100755 --- a/docker-compose/local/generate_config_from_listing.sh +++ b/docker-compose/local/generate_config_from_listing.sh @@ -2,14 +2,31 @@ set -e +get_python_cmd() { + # Check if python is defined + if command -v python &> /dev/null + then + echo "python" + elif command -v python3 &> /dev/null + then + echo "python3" + else + echo "Error: Neither python nor python3 is installed." >&2 + return 1 + fi +} + cd ../generate-config +PYTHON_CMD=$(get_python_cmd) || exit 1 + echo "Installing Python dependencies..." -python -m venv .venv +$PYTHON_CMD -m venv .venv source .venv/bin/activate pip install -r requirements.txt > /dev/null echo "Generating config file..." -python app.py --local-app-port=5005 $@ > ../local/core/config.json +mkdir -p ../local/core +$PYTHON_CMD app.py --local-app-port=5005 $@ > ../local/core/config.json echo "Config file saved to ./core/config.json" \ No newline at end of file