diff --git a/.github/workflows/llmsecops-cicd.llm.yml b/.github/workflows/llmsecops-cicd.llm.yml index cb261f2d6..d36ff3ca6 100644 --- a/.github/workflows/llmsecops-cicd.llm.yml +++ b/.github/workflows/llmsecops-cicd.llm.yml @@ -60,7 +60,6 @@ jobs: - name: 'Run test API request' run: ${{ github.workspace }}/.github/scripts/test_api.sh - if: false - name: 'Start system monitoring' run: ${{ github.workspace }}/.github/scripts/start_monitoring.sh & diff --git a/src/api/http_api.py b/src/api/http_api.py index 6e0235d9e..ed0366878 100644 --- a/src/api/http_api.py +++ b/src/api/http_api.py @@ -1,6 +1,13 @@ +""" + Usage: + $ uvicorn src.api.http_api:app --host 0.0.0.0 --port 9999 +""" + from fastapi import FastAPI from pathlib import Path from pydantic import BaseModel +from src.llm.llm import Phi3LanguageModel + STATIC_PATH = Path(__file__).parent.absolute() / 'static' @@ -19,3 +26,10 @@ class LanguageModelResponse(BaseModel): @app.get('/', response_model=str) async def health_check(): return 'success' + + +@app.post('/api/conversations', response_model=LanguageModelResponse) +async def get_llm_conversation_response(request: LanguageModelPrompt): + service = Phi3LanguageModel() + response = service.invoke(user_input=request.prompt) + return LanguageModelResponse(response=response)