together[patch]: update base url (#25524)

Updated the Together base URL from `.ai` to `.xyz` since some customers
have reported problems with `.ai`.
This commit is contained in:
Hassan El Mghari 2024-08-18 10:48:30 -07:00 committed by GitHub
parent bda3becbe7
commit 937b3904eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -315,12 +315,12 @@ class ChatTogether(BaseChatOpenAI):
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",
)

View File

@ -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
@ -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",
)

View File

@ -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