From d06d95ed8a6e775873c1742f9f78642456704f15 Mon Sep 17 00:00:00 2001 From: James McKeown Date: Mon, 8 Jan 2024 20:54:44 -0500 Subject: [PATCH] add score_threshold to init for AzureOpenAIEncoder (newly required to extend BaseEncoder) --- semantic_router/encoders/zure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semantic_router/encoders/zure.py b/semantic_router/encoders/zure.py index b4949bf3..1ac78392 100644 --- a/semantic_router/encoders/zure.py +++ b/semantic_router/encoders/zure.py @@ -25,11 +25,12 @@ def __init__( azure_endpoint: str | None = None, api_version: str | None = None, model: str | None = None, + score_threshold: float = 0.82, ): name = deployment_name if name is None: name = os.getenv("AZURE_OPENAI_DEPLOYMENT_NAME", "text-embedding-ada-002") - super().__init__(name=name) + super().__init__(name=name, score_threshold=score_threshold) self.api_key = api_key self.deployment_name = deployment_name self.azure_endpoint = azure_endpoint