Skip to content

Commit f8f2e57

Browse files
committed
RDoc-3621 Add missing embeddings_max_concurrent_batches parameter
1 parent a1b1f07 commit f8f2e57

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

ravendb/documents/operations/ai/abstract_ai_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class AbstractAiSettings(ABC):
6-
def __init__(self):
7-
self.embeddings_max_concurrent_batches = None
6+
def __init__(self, embeddings_max_concurrent_batches: int = None):
7+
self.embeddings_max_concurrent_batches = embeddings_max_concurrent_batches
88

99
@classmethod
1010
@abstractmethod

ravendb/documents/operations/ai/azure_open_ai_settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def __init__(
1212
deployment_name: str = None,
1313
dimensions: int = None,
1414
temperature: float = None,
15+
embeddings_max_concurrent_batches: int = None,
1516
):
16-
super().__init__(api_key, endpoint, model, dimensions, temperature)
17+
super().__init__(api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches)
1718
if deployment_name is None:
1819
raise ValueError("deployment_name cannot be None")
1920
self.deployment_name = deployment_name
@@ -27,6 +28,9 @@ def from_json(cls, json_dict: Dict[str, Any]) -> "AzureOpenAiSettings":
2728
dimensions=json_dict["Dimensions"] if "Dimensions" in json_dict else None,
2829
temperature=json_dict["Temperature"] if "Temperature" in json_dict else None,
2930
deployment_name=json_dict["DeploymentName"] if "DeploymentName" in json_dict else None,
31+
embeddings_max_concurrent_batches=(
32+
json_dict["EmbeddingsMaxConcurrentBatches"] if "EmbeddingsMaxConcurrentBatches" in json_dict else None
33+
),
3034
)
3135

3236
def to_json(self) -> Dict[str, Any]:
@@ -37,4 +41,5 @@ def to_json(self) -> Dict[str, Any]:
3741
"Dimensions": self.dimensions,
3842
"Temperature": self.temperature,
3943
"DeploymentName": self.deployment_name,
44+
"EmbeddingsMaxConcurrentBatches": self.embeddings_max_concurrent_batches,
4045
}

ravendb/documents/operations/ai/open_ai_base_settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ def __init__(
1111
model: str = None,
1212
dimensions: int = None,
1313
temperature: float = None,
14+
embeddings_max_concurrent_batches: int = None,
1415
):
15-
super().__init__()
16+
super().__init__(embeddings_max_concurrent_batches)
1617
self.api_key = api_key
1718
self.endpoint = endpoint
1819
self.model = model

ravendb/documents/operations/ai/open_ai_settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ def __init__(
1313
project_id: str = None,
1414
dimensions: int = None,
1515
temperature: float = None,
16+
embeddings_max_concurrent_batches: int = None,
1617
):
17-
super().__init__(api_key, endpoint, model, dimensions, temperature)
18+
super().__init__(api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches)
1819
self.organization_id = organization_id
1920
self.project_id = project_id
2021

@@ -28,6 +29,9 @@ def from_json(cls, json_dict: Dict[str, Any]) -> "OpenAiSettings":
2829
temperature=json_dict["Temperature"] if "Temperature" in json_dict else None,
2930
organization_id=json_dict["OrganizationId"] if "OrganizationId" in json_dict else None,
3031
project_id=json_dict["ProjectId"] if "ProjectId" in json_dict else None,
32+
embeddings_max_concurrent_batches=(
33+
json_dict["EmbeddingsMaxConcurrentBatches"] if "EmbeddingsMaxConcurrentBatches" in json_dict else None
34+
),
3135
)
3236

3337
def to_json(self) -> Dict[str, Any]:

0 commit comments

Comments
 (0)