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

community: fix an issue with deepinfra integration #28715

Merged
merged 3 commits into from
Dec 14, 2024
Merged
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
6 changes: 5 additions & 1 deletion libs/community/langchain_community/chat_models/deepinfra.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ class ChatDeepInfra(BaseChatModel):
# client: Any #: :meta private:
model_name: str = Field(default="meta-llama/Llama-2-70b-chat-hf", alias="model")
"""Model name to use."""

url: str = "https://api.deepinfra.com/v1/openai/chat/completions"
"""URL to use for the API call."""

deepinfra_api_token: Optional[str] = None
request_timeout: Optional[float] = Field(default=None, alias="timeout")
temperature: Optional[float] = 1
Expand Down Expand Up @@ -469,7 +473,7 @@ def _handle_status(self, code: int, text: Any) -> None:
)

def _url(self) -> str:
return "https://stage.api.deepinfra.com/v1/openai/chat/completions"
return self.url

def _headers(self) -> Dict:
return {
Expand Down
Loading