diff --git a/.github/workflows/llmsecops-cicd.llm.yml b/.github/workflows/llmsecops-cicd.llm.yml index 4c0b6b851..d9c479fd8 100644 --- a/.github/workflows/llmsecops-cicd.llm.yml +++ b/.github/workflows/llmsecops-cicd.llm.yml @@ -43,6 +43,11 @@ jobs: run: | curl -i http://localhost:9999/ + echo "Making API request..." + curl -X POST -i http://localhost:9999/api/conversations \ + -d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' \ + -H "Content-Type: application/json" || exit 1 + garak -v \ --config ${{ github.workspace }}/src/tools/garak.config.yml \ --generator_option_file ${{ github.workspace }}/src/tools/garak.rest.llm.json \ diff --git a/src/api/controller.py b/src/api/controller.py index 75d4a491d..3ff759964 100644 --- a/src/api/controller.py +++ b/src/api/controller.py @@ -8,7 +8,7 @@ app = Flask(__name__) @app.route('/', methods=['GET']) def health_check(): - return "Server is running", 200 + return f"Server is running\n", 200 @app.route('/api/conversations', methods=['POST']) def get_llm_response(): @@ -22,5 +22,5 @@ if __name__ == '__main__': print('test') logger.debug('running...') - # Production mode with Waitress: + # TODO set up port # as env var serve(app, host='0.0.0.0', port=9999) \ No newline at end of file diff --git a/src/llm/llm.py b/src/llm/llm.py index 0bdf80781..c78ca1190 100644 --- a/src/llm/llm.py +++ b/src/llm/llm.py @@ -91,4 +91,5 @@ class Phi3LanguageModel: return response except Exception as e: print(f"Failed: {e}") + return e