diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml index 4e86dfbc55a223672dbe56b2145f2660cae3d74e..e9db72d81ed26d07d1cef34e272139a8f98cedab 100644 --- a/.github/workflows/pr_agent.yml +++ b/.github/workflows/pr_agent.yml @@ -14,5 +14,5 @@ jobs: id: pragent uses: Codium-ai/pr-agent@main env: - OPENAI_KEY: ${{ secrets.OPENAI_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/semantic_router/utils/llm.py b/semantic_router/utils/llm.py index 6ce28ff8c3f16e7200c15139095715bf6078d1b3..e92c1bcf7752b5fce5a071dde41da4a24d0851a9 100644 --- a/semantic_router/utils/llm.py +++ b/semantic_router/utils/llm.py @@ -33,6 +33,7 @@ def llm(prompt: str) -> str | None: logger.error(f"LLM error: {e}") raise Exception(f"LLM error: {e}") + # TODO integrate async LLM function # async def allm(prompt: str) -> str | None: # try: diff --git a/tests/unit/test_layer.py b/tests/unit/test_layer.py index c6898235fa01b15a5786f736ed740fe5189b1859..4520adf414576e4fd02a80ed88142b8bd273149a 100644 --- a/tests/unit/test_layer.py +++ b/tests/unit/test_layer.py @@ -178,7 +178,10 @@ class TestRouteLayer: route_layer.to_json("test_output.json") assert os.path.exists("test_output.json") route_layer_from_file = RouteLayer.from_json("test_output.json") - assert route_layer_from_file.index is not None and route_layer_from_file.categories is not None + assert ( + route_layer_from_file.index is not None + and route_layer_from_file.categories is not None + ) os.remove("test_output.json") def test_yaml(self, openai_encoder, routes): @@ -186,7 +189,10 @@ class TestRouteLayer: route_layer.to_yaml("test_output.yaml") assert os.path.exists("test_output.yaml") route_layer_from_file = RouteLayer.from_yaml("test_output.yaml") - assert route_layer_from_file.index is not None and route_layer_from_file.categories is not None + assert ( + route_layer_from_file.index is not None + and route_layer_from_file.categories is not None + ) os.remove("test_output.yaml") def test_config(self, openai_encoder, routes): @@ -200,6 +206,7 @@ class TestRouteLayer: assert (route_layer_from_config.categories == route_layer.categories).all() assert route_layer_from_config.score_threshold == route_layer.score_threshold + # Add more tests for edge cases and error handling as needed.