Skip to content

Commit

Permalink
0.0.35 (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Sep 8, 2023
1 parent df947ee commit 2ee34d9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 59 deletions.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langsmith",
"version": "0.0.34",
"version": "0.0.35",
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
"files": [
"dist/",
Expand Down
3 changes: 0 additions & 3 deletions js/src/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as util from "util";
import { Command } from "commander";
import * as child_process from "child_process";
import {
getDockerEnvironment,
getLangChainEnvVars,
getRuntimeEnvironment,
setEnvironmentVariable,
Expand Down Expand Up @@ -295,11 +294,9 @@ class SmithCommand {

async env() {
const env = await getRuntimeEnvironment();
const dockerEnv = await getDockerEnvironment();
const envVars = await getLangChainEnvVars();
const envDict = {
...env,
...dockerEnv,
...envVars,
};
// Pretty print
Expand Down
54 changes: 0 additions & 54 deletions js/src/utils/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { exec } from "child_process";

// Inlined from https://github.com/flexdinesh/browser-or-node
declare global {
const Deno:
Expand Down Expand Up @@ -78,58 +76,6 @@ export async function getRuntimeEnvironment(): Promise<RuntimeEnvironment> {
return runtimeEnvironment;
}

export async function getDockerEnvironment(): Promise<{
dockerVersion: string | undefined;
dockerComposeCommand: string | undefined;
dockerComposeVersion: string | undefined;
}> {
const getDockerVersion = () =>
new Promise<string | undefined>((resolve) => {
exec("docker --version", (error, stdout) => {
if (error) {
resolve(undefined);
} else {
resolve(stdout.trim());
}
});
});

const getDockerComposeCommand = () =>
new Promise<string | undefined>((resolve) => {
exec("which docker-compose", (error, stdout) => {
if (error) {
resolve(undefined);
} else {
resolve(stdout.trim());
}
});
});

const getDockerComposeVersion = () =>
new Promise<string | undefined>((resolve) => {
exec("docker-compose --version", (error, stdout) => {
if (error) {
resolve(undefined);
} else {
resolve(stdout.trim());
}
});
});

const [dockerVersion, dockerComposeCommand, dockerComposeVersion] =
await Promise.all([
getDockerVersion(),
getDockerComposeCommand(),
getDockerComposeVersion(),
]);

return {
dockerVersion,
dockerComposeCommand,
dockerComposeVersion,
};
}

/**
* Retrieves the LangChain-specific environment variables from the current runtime environment.
* Sensitive keys (containing the word "key") have their values redacted for security.
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.0.34"
version = "0.0.35"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <support@langchain.dev>"]
license = "MIT"
Expand Down

0 comments on commit 2ee34d9

Please sign in to comment.