diff --git a/poetry.lock b/poetry.lock index 2b5646148..97094b4dd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5753,4 +5753,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "668861e04c054609210aa5abaf5c75df9818d05ad25147667f73060e8a4aefeb" +content-hash = "3e1d5e661a0393060e8f82ad58caaac371c55a2c201f83988f49976502ff12cc" diff --git a/run.py b/run.py deleted file mode 100644 index 359762c75..000000000 --- a/run.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Fastapi server to run predictions.""" - -from dotenv import load_dotenv -from fastapi import Depends, FastAPI - -from intelligence_layer.core import ControlModel, LuminousControlModel, NoOpTracer -from intelligence_layer.examples.classify.classify import ( - ClassifyInput, - SingleLabelClassifyOutput, -) -from intelligence_layer.examples.classify.prompt_based_classify import ( - PromptBasedClassify, -) - -app = FastAPI() - -load_dotenv() - - -def model() -> ControlModel: - return LuminousControlModel("luminous-base-control") - - -@app.post("/classify") -async def classify( - classify_input: ClassifyInput, - luminous_control_model: LuminousControlModel = Depends(model), # noqa: B008 -) -> SingleLabelClassifyOutput: - classify = PromptBasedClassify(luminous_control_model) - classify_output = classify.run(classify_input, NoOpTracer()) - return classify_output diff --git a/tests/test_fastapi.py b/tests/test_fastapi.py deleted file mode 100644 index 2ff50ca8f..000000000 --- a/tests/test_fastapi.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Test prediction via api.""" - -from http import HTTPStatus - -from dotenv import load_dotenv -from fastapi.testclient import TestClient -from pytest import fixture - -from run import app - -load_dotenv() - - -@fixture -def client() -> TestClient: - """Provide fixture for api.""" - return TestClient(app) - - -def test_classify(client: TestClient) -> None: - response = client.post( - "/classify", json={"chunk": "Hello", "labels": ["yes", "no"]} - ) - assert response.status_code == HTTPStatus.OK - assert response.headers.get("content-type", "") == "application/json" - data = response.json() - assert "scores" in data