langsmith 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ Tracing can be activated by setting the following environment variables or by ma
46
46
 
47
47
  ```typescript
48
48
  process.env["LANGCHAIN_TRACING_V2"] = "true";
49
- process.env["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"; // or your own server
49
+ process.env["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com";
50
50
  process.env["LANGCHAIN_API_KEY"] = "<YOUR-LANGSMITH-API-KEY>";
51
51
  // process.env["LANGCHAIN_PROJECT"] = "My Project Name"; // Optional: "default" is used if not set
52
52
  ```
package/dist/client.cjs CHANGED
@@ -48,6 +48,15 @@ async function toArray(iterable) {
48
48
  }
49
49
  return result;
50
50
  }
51
+ function trimQuotes(str) {
52
+ if (str === undefined) {
53
+ return undefined;
54
+ }
55
+ return str
56
+ .trim()
57
+ .replace(/^"(.*)"$/, "$1")
58
+ .replace(/^'(.*)'$/, "$1");
59
+ }
51
60
  class Client {
52
61
  constructor(config = {}) {
53
62
  Object.defineProperty(this, "apiKey", {
@@ -75,8 +84,8 @@ class Client {
75
84
  value: void 0
76
85
  });
77
86
  const defaultConfig = Client.getDefaultClientConfig();
78
- this.apiUrl = config.apiUrl ?? defaultConfig.apiUrl;
79
- this.apiKey = config.apiKey ?? defaultConfig.apiKey;
87
+ this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
88
+ this.apiKey = trimQuotes(config.apiKey ?? defaultConfig.apiKey);
80
89
  this.validateApiKeyIfHosted();
81
90
  this.timeout_ms = config.timeout_ms ?? 4000;
82
91
  this.caller = new async_caller_js_1.AsyncCaller(config.callerOptions ?? {});
package/dist/client.js CHANGED
@@ -22,6 +22,15 @@ async function toArray(iterable) {
22
22
  }
23
23
  return result;
24
24
  }
25
+ function trimQuotes(str) {
26
+ if (str === undefined) {
27
+ return undefined;
28
+ }
29
+ return str
30
+ .trim()
31
+ .replace(/^"(.*)"$/, "$1")
32
+ .replace(/^'(.*)'$/, "$1");
33
+ }
25
34
  export class Client {
26
35
  constructor(config = {}) {
27
36
  Object.defineProperty(this, "apiKey", {
@@ -49,8 +58,8 @@ export class Client {
49
58
  value: void 0
50
59
  });
51
60
  const defaultConfig = Client.getDefaultClientConfig();
52
- this.apiUrl = config.apiUrl ?? defaultConfig.apiUrl;
53
- this.apiKey = config.apiKey ?? defaultConfig.apiKey;
61
+ this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
62
+ this.apiKey = trimQuotes(config.apiKey ?? defaultConfig.apiKey);
54
63
  this.validateApiKeyIfHosted();
55
64
  this.timeout_ms = config.timeout_ms ?? 4000;
56
65
  this.caller = new AsyncCaller(config.callerOptions ?? {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
5
5
  "files": [
6
6
  "dist/",