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

Wfh/update js license #260

Merged
merged 4 commits into from
Oct 19, 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
1 change: 1 addition & 0 deletions js/src/cli/docker-compose.beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- PORT=1985
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
- LANGSMITH_LICENSE_KEY=${LANGSMITH_LICENSE_KEY}
ports:
- 1985:1985
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions js/src/cli/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: '3'
services:
# TODO: Move to the regular docker-compose.yaml once deployed
langchain-hub:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainhub-backend:latest
environment:
- PORT=1985
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
- LANGSMITH_LICENSE_KEY=${LANGSMITH_LICENSE_KEY}
ports:
- 1985:1985
depends_on:
Expand Down
3 changes: 3 additions & 0 deletions js/src/cli/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
- OPENAI_API_KEY=${OPENAI_API_KEY}
- LANGSMITH_LICENSE_KEY=${LANGSMITH_LICENSE_KEY}
ports:
- 1984:1984
depends_on:
Expand All @@ -26,13 +27,15 @@ services:
environment:
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
- LANGSMITH_LICENSE_KEY=${LANGSMITH_LICENSE_KEY}
entrypoint: "rq worker --with-scheduler -u redis://langchain-redis:6379 --serializer lc_database.queue.serializer.ORJSONSerializer --worker-class lc_database.queue.worker.Worker --connection-class lc_database.queue.connection.RedisRetry --job-class lc_database.queue.job.AsyncJob"
langchain-hub:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainhub-backend:latest
environment:
- PORT=1985
- LANGCHAIN_ENV=local_docker
- LOG_LEVEL=warning
- LANGSMITH_LICENSE_KEY=${LANGSMITH_LICENSE_KEY}
ports:
- 1985:1985
depends_on:
Expand Down
15 changes: 13 additions & 2 deletions js/src/cli/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import * as child_process from "child_process";
import * as fs from "fs";
import * as path from "path";
import * as util from "util";
import { Command } from "commander";
import * as child_process from "child_process";

import {
getLangChainEnvVars,
getRuntimeEnvironment,
setEnvironmentVariable,
} from "../utils/env.js";

import { Command } from "commander";
import { spawn } from "child_process";

const currentFileName = __filename;
Expand Down Expand Up @@ -330,6 +332,12 @@ const startCommand = new Command("start")
" from the OPENAI_API_KEY environment variable. If neither are provided," +
" some features of LangSmith will not be available."
)
.option(
"--langsmith-license-key <langsmithLicenseKey>",
"The LangSmith license key to use for LangSmith. If not provided, the LangSmith" +
" License Key will be read from the LANGSMITH_LICENSE_KEY environment variable." +
" If neither are provided, the Langsmith application will not spin up."
)
.action(async (args) => {
const smith = await SmithCommand.create();
if (args.stage === "dev") {
Expand All @@ -340,6 +348,9 @@ const startCommand = new Command("start")
if (args.openaiApiKey) {
setEnvironmentVariable("OPENAI_API_KEY", args.openaiApiKey);
}
if (args.langsmithLicenseKey) {
setEnvironmentVariable("LANGSMITH_LICENSE_KEY", args.langsmithLicenseKey);
}
await smith.pull({ stage: args.stage });
if (args.expose) {
await smith.startAndExpose(args.ngrokAuthtoken, args.stage);
Expand Down