Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f73c866
feat(api): api update
stainless-app[bot] Dec 10, 2025
3979c5b
codegen metadata
stainless-app[bot] Dec 12, 2025
6c16599
codegen metadata
stainless-app[bot] Dec 12, 2025
9c66288
feat(api): api update
stainless-app[bot] Dec 12, 2025
8895f35
feat(api): api update
stainless-app[bot] Dec 13, 2025
96a6948
feat(api): api update
stainless-app[bot] Dec 16, 2025
2e76dd3
codegen metadata
stainless-app[bot] Dec 17, 2025
e2e98b7
feat(api): api update
stainless-app[bot] Dec 19, 2025
5703f0f
feat(api): api update
stainless-app[bot] Dec 19, 2025
748273d
codegen metadata
stainless-app[bot] Dec 20, 2025
ec75b8b
codegen metadata
stainless-app[bot] Dec 23, 2025
c2f914b
codegen metadata
stainless-app[bot] Dec 23, 2025
4b197f0
feat(api): api update
stainless-app[bot] Dec 23, 2025
efb8d58
codegen metadata
stainless-app[bot] Dec 24, 2025
a3655ed
codegen metadata
stainless-app[bot] Dec 31, 2025
7c51e6a
feat(client): add `HttpRequest#url()` method
stainless-app[bot] Jan 6, 2026
3f58d74
codegen metadata
stainless-app[bot] Jan 7, 2026
db435a0
codegen metadata
stainless-app[bot] Jan 7, 2026
5bb589d
codegen metadata
stainless-app[bot] Jan 8, 2026
51ac9e2
codegen metadata
stainless-app[bot] Jan 9, 2026
4a50a22
feat(client): allow configuring dispatcher executor service
stainless-app[bot] Jan 9, 2026
7239df9
codegen metadata
stainless-app[bot] Jan 9, 2026
e37bbf1
codegen metadata
stainless-app[bot] Jan 9, 2026
b4b52e0
codegen metadata
stainless-app[bot] Jan 12, 2026
7cc379e
release: 0.1.0-alpha.20
stainless-app[bot] Jan 12, 2026
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.19"
".": "0.1.0-alpha.20"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 100
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-624b469e0a8ed90f1574e609929702b6da43306d0681975f690ebda2d40a1c74.yml
openapi_spec_hash: 389b1d06dd9a4b9e83d410d8d8ece950
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/langsmith%2Flangsmith-api-1a666a4bb1fa09efbdefe10ff1c32bb7bc950e53a83e11a945671db09e4deee0.yml
openapi_spec_hash: 88ebc1c9e77c70846ece98e4fd62cca3
config_hash: 4c81a93850b2f9805605749a196ed2df
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.20 (2026-01-12)

Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/langchain-ai/langsmith-java/compare/v0.1.0-alpha.19...v0.1.0-alpha.20)

### Features

* **api:** api update ([4b197f0](https://github.com/langchain-ai/langsmith-java/commit/4b197f03e8a2d7658d2e268d854114398429f7a9))
* **api:** api update ([5703f0f](https://github.com/langchain-ai/langsmith-java/commit/5703f0f838d16543a4c518dc108065d4e72e58b6))
* **api:** api update ([e2e98b7](https://github.com/langchain-ai/langsmith-java/commit/e2e98b7e9ab23ea0298e79cfc38a49797db0e978))
* **api:** api update ([96a6948](https://github.com/langchain-ai/langsmith-java/commit/96a69483bf3e39b21a65dfb1af1eea6914939dfa))
* **api:** api update ([8895f35](https://github.com/langchain-ai/langsmith-java/commit/8895f3571aafdffce373dac1052a4f26fd38347d))
* **api:** api update ([9c66288](https://github.com/langchain-ai/langsmith-java/commit/9c66288568aceb6d7b77b8742dc34e132c122b66))
* **api:** api update ([f73c866](https://github.com/langchain-ai/langsmith-java/commit/f73c86620f221064be73d86d9ce540f4e8aeb5c6))
* **client:** add `HttpRequest#url()` method ([7c51e6a](https://github.com/langchain-ai/langsmith-java/commit/7c51e6a7139f20c181bc4349c247da8aaa151a89))
* **client:** allow configuring dispatcher executor service ([4a50a22](https://github.com/langchain-ai/langsmith-java/commit/4a50a22f62527d90e5584b9c805b34cfa8c0a7c8))

## 0.1.0-alpha.19 (2025-12-10)

Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/langchain-ai/langsmith-java/compare/v0.1.0-alpha.18...v0.1.0-alpha.19)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2025 langChain
Copyright 2026 langChain

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.langchain.smith/langsmith-java)](https://central.sonatype.com/artifact/com.langchain.smith/langsmith-java/0.1.0-alpha.19)
[![javadoc](https://javadoc.io/badge2/com.langchain.smith/langsmith-java/0.1.0-alpha.19/javadoc.svg)](https://javadoc.io/doc/com.langchain.smith/langsmith-java/0.1.0-alpha.19)
[![Maven Central](https://img.shields.io/maven-central/v/com.langchain.smith/langsmith-java)](https://central.sonatype.com/artifact/com.langchain.smith/langsmith-java/0.1.0-alpha.20)
[![javadoc](https://javadoc.io/badge2/com.langchain.smith/langsmith-java/0.1.0-alpha.20/javadoc.svg)](https://javadoc.io/doc/com.langchain.smith/langsmith-java/0.1.0-alpha.20)

<!-- x-release-please-end -->

Expand All @@ -13,7 +13,7 @@ To learn more about LangSmith, check out the [docs](https://docs.smith.langchain

<!-- x-release-please-start-version -->

The REST API documentation can be found on [docs.smith.langchain.com](https://docs.smith.langchain.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.langchain.smith/langsmith-java/0.1.0-alpha.19).
The REST API documentation can be found on [docs.smith.langchain.com](https://docs.smith.langchain.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.langchain.smith/langsmith-java/0.1.0-alpha.20).

<!-- x-release-please-end -->

Expand All @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.smith.langchain.com](https://do
### Gradle

```kotlin
implementation("com.langchain.smith:langsmith-java:0.1.0-alpha.19")
implementation("com.langchain.smith:langsmith-java:0.1.0-alpha.20")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.langchain.smith:langsmith-java:0.1.0-alpha.19")
<dependency>
<groupId>com.langchain.smith</groupId>
<artifactId>langsmith-java</artifactId>
<version>0.1.0-alpha.19</version>
<version>0.1.0-alpha.20</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.langchain.smith"
version = "0.1.0-alpha.19" // x-release-please-version
version = "0.1.0-alpha.20" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
Expand Down Expand Up @@ -46,11 +47,31 @@ class LangsmithOkHttpClient private constructor() {
class Builder internal constructor() {

private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null

/**
* The executor service to use for running HTTP requests.
*
* Defaults to OkHttp's
* [default executor service](https://github.com/square/okhttp/blob/ace792f443b2ffb17974f5c0d1cecdf589309f26/okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt#L98-L104).
*
* This class takes ownership of the executor service and shuts it down when closed.
*/
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}

/**
* Alias for calling [Builder.dispatcherExecutorService] with
* `dispatcherExecutorService.orElse(null)`.
*/
fun dispatcherExecutorService(dispatcherExecutorService: Optional<ExecutorService>) =
dispatcherExecutorService(dispatcherExecutorService.getOrNull())

fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }

/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
Expand Down Expand Up @@ -334,6 +355,7 @@ class LangsmithOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
.hostnameVerifier(hostnameVerifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
Expand Down Expand Up @@ -46,11 +47,31 @@ class LangsmithOkHttpClientAsync private constructor() {
class Builder internal constructor() {

private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null

/**
* The executor service to use for running HTTP requests.
*
* Defaults to OkHttp's
* [default executor service](https://github.com/square/okhttp/blob/ace792f443b2ffb17974f5c0d1cecdf589309f26/okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt#L98-L104).
*
* This class takes ownership of the executor service and shuts it down when closed.
*/
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}

/**
* Alias for calling [Builder.dispatcherExecutorService] with
* `dispatcherExecutorService.orElse(null)`.
*/
fun dispatcherExecutorService(dispatcherExecutorService: Optional<ExecutorService>) =
dispatcherExecutorService(dispatcherExecutorService.getOrNull())

fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }

/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
Expand Down Expand Up @@ -334,6 +355,7 @@ class LangsmithOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
.hostnameVerifier(hostnameVerifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import java.net.Proxy
import java.time.Duration
import java.util.concurrent.CancellationException
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import okhttp3.Call
import okhttp3.Callback
import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaType
Expand Down Expand Up @@ -93,9 +95,9 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
clientBuilder.addNetworkInterceptor(
HttpLoggingInterceptor().setLevel(logLevel).apply {
redactHeader("X-API-Key")
redactHeader("X-Tenant-Id")
redactHeader("Authorization")
redactHeader("X-Organization-Id")
redactHeader("Authorization")
redactHeader("X-Tenant-Id")
}
)
}
Expand Down Expand Up @@ -203,6 +205,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien

private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
Expand All @@ -213,6 +216,10 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien

fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }

fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}

fun sslSocketFactory(sslSocketFactory: SSLSocketFactory?) = apply {
this.sslSocketFactory = sslSocketFactory
}
Expand All @@ -234,6 +241,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
.callTimeout(timeout.request())
.proxy(proxy)
.apply {
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }

val sslSocketFactory = sslSocketFactory
val trustManager = trustManager
if (sslSocketFactory != null && trustManager != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,19 +507,19 @@ private constructor(
headers.put("X-API-Key", it)
}
}
tenantId?.let {
organizationId?.let {
if (!it.isEmpty()) {
headers.put("X-Tenant-Id", it)
headers.put("X-Organization-Id", it)
}
}
bearerToken?.let {
if (!it.isEmpty()) {
headers.put("Authorization", "Bearer $it")
}
}
organizationId?.let {
tenantId?.let {
if (!it.isEmpty()) {
headers.put("X-Organization-Id", it)
headers.put("X-Tenant-Id", it)
}
}
headers.replaceAll(this.headers.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.langchain.smith.core.http

import com.langchain.smith.core.checkRequired
import com.langchain.smith.core.toImmutable
import java.net.URLEncoder

class HttpRequest
private constructor(
Expand All @@ -13,6 +14,35 @@ private constructor(
@get:JvmName("body") val body: HttpRequestBody?,
) {

fun url(): String = buildString {
append(baseUrl)

pathSegments.forEach { segment ->
if (!endsWith("/")) {
append("/")
}
append(URLEncoder.encode(segment, "UTF-8"))
}

if (queryParams.isEmpty()) {
return@buildString
}

append("?")
var isFirst = true
queryParams.keys().forEach { key ->
queryParams.values(key).forEach { value ->
if (!isFirst) {
append("&")
}
append(URLEncoder.encode(key, "UTF-8"))
append("=")
append(URLEncoder.encode(value, "UTF-8"))
isFirst = false
}
}
}

fun toBuilder(): Builder = Builder().from(this)

override fun toString(): String =
Expand Down
Loading