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

update langchainplus client and docker file to reflect port changes #5005

Merged
merged 2 commits into from
May 22, 2023
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
2 changes: 1 addition & 1 deletion langchain/callbacks/tracers/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_headers() -> Dict[str, Any]:


def get_endpoint() -> str:
return os.getenv("LANGCHAIN_ENDPOINT", "http://localhost:8000")
return os.getenv("LANGCHAIN_ENDPOINT", "http://localhost:1984")


@retry(stop=stop_after_attempt(3), wait=wait_fixed(0.5))
Expand Down
8 changes: 3 additions & 5 deletions langchain/cli/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ services:
ports:
- 80:80
environment:
- BACKEND_URL=http://langchain-backend:8000
- PUBLIC_BASE_URL=http://localhost:8000
- PUBLIC_DEV_MODE=true
- REACT_APP_BACKEND_URL=http://localhost:1984
depends_on:
- langchain-backend
volumes:
Expand All @@ -18,11 +16,11 @@ services:
langchain-backend:
image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-backend:latest
environment:
- PORT=8000
- PORT=1984
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
ports:
- 8000:8000
- 1984:1984
depends_on:
- langchain-db
build:
Expand Down
4 changes: 2 additions & 2 deletions langchain/client/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ class LangChainPlusClient(BaseSettings):
"""Client for interacting with the LangChain+ API."""

api_key: Optional[str] = Field(default=None, env="LANGCHAIN_API_KEY")
api_url: str = Field(default="http://localhost:8000", env="LANGCHAIN_ENDPOINT")
api_url: str = Field(default="http://localhost:1984", env="LANGCHAIN_ENDPOINT")
tenant_id: Optional[str] = None

@root_validator(pre=True)
def validate_api_key_if_hosted(cls, values: Dict[str, Any]) -> Dict[str, Any]:
"""Verify API key is provided if url not localhost."""
api_url: str = values.get("api_url", "http://localhost:8000")
api_url: str = values.get("api_url", "http://localhost:1984")
api_key: Optional[str] = values.get("api_key")
if not _is_localhost(api_url):
if not api_key:
Expand Down