langsmith 0.10.10 → 0.10.11

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/lib/client.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as uuid from "./utils/uuid/src/index.mjs";
2
+ import { getOpenAPIBaseUrl } from "./utils/api_url.mjs";
2
3
  import { LangSmithToOTELTranslator, } from "./experimental/otel/translator.mjs";
3
4
  import { getDefaultOTLPTracerComponents, getOTELTrace, getOTELContext, } from "./singletons/otel.mjs";
4
5
  import { AsyncCaller } from "./utils/async_caller.mjs";
@@ -1116,12 +1117,7 @@ export class Client {
1116
1117
  this._customHeaders = value ?? {};
1117
1118
  }
1118
1119
  _getOpenAPIBaseUrl() {
1119
- const url = this.apiUrl.replace(/\/$/, "");
1120
- for (const suffix of ["/api/v1", "/api"]) {
1121
- if (url.endsWith(suffix))
1122
- return url.slice(0, -suffix.length);
1123
- }
1124
- return url;
1120
+ return getOpenAPIBaseUrl(this.apiUrl);
1125
1121
  }
1126
1122
  /**
1127
1123
  * The generated OpenAPI client, rebuilt whenever its auth or headers change.