Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
italianconcerto committed Dec 15, 2023
1 parent 3ab633d commit 74acb78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/examples/function_calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"import openai\n",
"from semantic_router.utils.logger import logger\n",
"\n",
"\n",
"# Docs # https://platform.openai.com/docs/guides/function-calling\n",
"def llm_openai(prompt: str, model: str = \"gpt-4\") -> str:\n",
" try:\n",
Expand Down Expand Up @@ -349,7 +350,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"def get_time(location: str) -> str:\n",
" \"\"\"Useful to get the time in a specific location\"\"\"\n",
" print(f\"Calling `get_time` function with location: {location}\")\n",
Expand Down
1 change: 1 addition & 0 deletions semantic_router/encoders/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import openai
from openai import OpenAIError
from openai.types import CreateEmbeddingResponse

from semantic_router.encoders import BaseEncoder
from semantic_router.utils.logger import logger

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/encoders/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_openai_encoder_call_failure_non_openai_error(self, openai_encoder, mock
)
with pytest.raises(ValueError) as e:
openai_encoder(["test document"])

assert "OpenAI API call failed. Error: Non-OpenAIError" in str(e.value)

def test_openai_encoder_call_successful_retry(self, openai_encoder, mocker):
Expand Down

0 comments on commit 74acb78

Please sign in to comment.