Skip to content

Commit

Permalink
upstage[minor]: release 0.6 (#45)
Browse files Browse the repository at this point in the history
* bump langchain-openai and increment version

* update
  • Loading branch information
ccurme authored Jan 10, 2025
1 parent bd13c2c commit 79ec4f5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 93 deletions.
7 changes: 4 additions & 3 deletions libs/upstage/langchain_upstage/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def _get_ls_params(
@model_validator(mode="after")
def validate_environment(self) -> Self:
"""Validate that api key and python package exists in environment."""
if self.n < 1:
if self.n is not None and self.n < 1:
raise ValueError("n must be at least 1.")
if self.n > 1 and self.streaming:
if self.n is not None and self.n > 1 and self.streaming:
raise ValueError("n must be 1 when streaming.")

client_params: dict = {
Expand All @@ -153,10 +153,11 @@ def validate_environment(self) -> Self:
),
"base_url": self.upstage_api_base,
"timeout": self.request_timeout,
"max_retries": self.max_retries,
"default_headers": self.default_headers,
"default_query": self.default_query,
}
if self.max_retries is not None:
client_params["max_retries"] = self.max_retries

if not (self.client or None):
sync_specific: dict = {"http_client": self.http_client}
Expand Down
Loading

0 comments on commit 79ec4f5

Please sign in to comment.