llamaindex server port change
This commit is contained in:
@@ -3,13 +3,13 @@
|
|||||||
HTTP API server for querying the vector storage via the existing retrieval pipeline.
|
HTTP API server for querying the vector storage via the existing retrieval pipeline.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from fastapi import FastAPI, HTTPException
|
from fastapi import FastAPI, HTTPException
|
||||||
from pydantic import BaseModel, Field
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
from retrieval import initialize_retriever
|
from retrieval import initialize_retriever
|
||||||
|
|
||||||
@@ -91,9 +91,7 @@ def test_query(payload: TestQueryRequest) -> TestQueryResponse:
|
|||||||
)
|
)
|
||||||
|
|
||||||
response_text = str(result)
|
response_text = str(result)
|
||||||
logger.info(
|
logger.info(f"/api/test-query completed successfully (sources={len(sources)})")
|
||||||
f"/api/test-query completed successfully (sources={len(sources)})"
|
|
||||||
)
|
|
||||||
return TestQueryResponse(query=query, response=response_text, sources=sources)
|
return TestQueryResponse(query=query, response=response_text, sources=sources)
|
||||||
|
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
@@ -106,4 +104,4 @@ def test_query(payload: TestQueryRequest) -> TestQueryResponse:
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
uvicorn.run("server:app", host="0.0.0.0", port=8000, reload=False)
|
uvicorn.run("server:app", host="0.0.0.0", port=8334, reload=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user