Skip to content

Commit

Permalink
update langchainplus client and docker file to reflect port changes (#…
Browse files Browse the repository at this point in the history
…5005)

# Currently, only the dev images are updated
  • Loading branch information
agola11 committed May 22, 2023
1 parent 9e64946 commit 467ca6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
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 @@ -64,13 +64,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

0 comments on commit 467ca6f

Please sign in to comment.