Skip to content

Commit

Permalink
together[patch]: update base url (#25524)
Browse files Browse the repository at this point in the history
Updated the Together base URL from `.ai` to `.xyz` since some customers
have reported problems with `.ai`.
  • Loading branch information
Nutlope authored Aug 18, 2024
1 parent bda3bec commit 937b390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libs/partners/together/langchain_together/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ def _get_ls_params(
default_factory=secret_from_env("TOGETHER_API_KEY", default=None),
)
"""Together AI API key.
Automatically read from env variable `TOGETHER_API_KEY` if not provided.
"""
together_api_base: str = Field(
default_factory=from_env(
"TOGETHER_API_BASE", default="https://api.together.ai/v1/"
"TOGETHER_API_BASE", default="https://api.together.xyz/v1/"
),
alias="base_url",
)
Expand Down
6 changes: 3 additions & 3 deletions libs/partners/together/langchain_together/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class TogetherEmbeddings(BaseModel, Embeddings):
client: Any = Field(default=None, exclude=True) #: :meta private:
async_client: Any = Field(default=None, exclude=True) #: :meta private:
model: str = "togethercomputer/m2-bert-80M-8k-retrieval"
"""Embeddings model name to use.
"""Embeddings model name to use.
Instead, use 'togethercomputer/m2-bert-80M-8k-retrieval' for example.
"""
dimensions: Optional[int] = None
Expand All @@ -119,12 +119,12 @@ class TogetherEmbeddings(BaseModel, Embeddings):
default_factory=secret_from_env("TOGETHER_API_KEY", default=None),
)
"""Together AI API key.
Automatically read from env variable `TOGETHER_API_KEY` if not provided.
"""
together_api_base: str = Field(
default_factory=from_env(
"TOGETHER_API_BASE", default="https://api.together.ai/v1/"
"TOGETHER_API_BASE", default="https://api.together.xyz/v1/"
),
alias="base_url",
)
Expand Down
4 changes: 2 additions & 2 deletions libs/partners/together/langchain_together/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class Together(LLM):
model = Together(model_name="mistralai/Mixtral-8x7B-Instruct-v0.1")
"""

base_url: str = "https://api.together.ai/v1/completions"
base_url: str = "https://api.together.xyz/v1/completions"
"""Base completions API URL."""
together_api_key: SecretStr = Field(
alias="api_key",
default_factory=secret_from_env("TOGETHER_API_KEY"),
)
"""Together AI API key.
Automatically read from env variable `TOGETHER_API_KEY` if not provided.
"""
model: str
Expand Down

0 comments on commit 937b390

Please sign in to comment.