Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

together[minor]: release 0.3 #12

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions libs/together/langchain_together/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,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 @@ -343,10 +343,11 @@ def validate_environment(self) -> Self:
),
"base_url": self.together_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
20 changes: 10 additions & 10 deletions libs/together/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions libs/together/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "langchain-together"
version = "0.2.1"
version = "0.3.0"
description = "An integration package connecting Together AI and LangChain"
authors = []
readme = "README.md"
Expand All @@ -20,8 +20,8 @@ disallow_untyped_defs = "True"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
langchain-openai = "^0.2"
langchain-core = "^0.3.27"
langchain-openai = "^0.3"
langchain-core = "^0.3.29"
requests = "^2"
aiohttp = "^3.9.1"

Expand Down
8 changes: 0 additions & 8 deletions libs/together/tests/integration_tests/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ def test_chat_together_extra_kwargs() -> None:
with pytest.raises(ValueError):
ChatTogether(foo=3, model_kwargs={"foo": 2}) # type: ignore[call-arg]

# Test that if explicit param is specified in kwargs it errors
with pytest.raises(ValueError):
ChatTogether(model_kwargs={"temperature": 0.2})

# Test that "model" cannot be specified in kwargs
with pytest.raises(ValueError):
ChatTogether(model_kwargs={"model": "meta-llama/Llama-3-8b-chat-hf"})

Comment on lines -69 to -76
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have been failing for some time. Confirmed they both fail on main.


def test_stream() -> None:
"""Test streaming tokens from Together AI."""
Expand Down
Loading