diff --git a/langsmith-java-core/src/main/kotlin/com/langchain/smith/models/datasets/DatasetListParams.kt b/langsmith-java-core/src/main/kotlin/com/langchain/smith/models/datasets/DatasetListParams.kt index 7f413e0c..c5645433 100644 --- a/langsmith-java-core/src/main/kotlin/com/langchain/smith/models/datasets/DatasetListParams.kt +++ b/langsmith-java-core/src/main/kotlin/com/langchain/smith/models/datasets/DatasetListParams.kt @@ -354,7 +354,7 @@ private constructor( put("data_type", dataTypes.joinToString(",") { it.toString() }) } - override fun visitDataType(dataType: DataType) { + override fun visitDataType(dataType: com.langchain.smith.models.datasets.DataType) { put("data_type", dataType.toString()) } } @@ -384,7 +384,7 @@ private constructor( fun dataTypes(): Optional> = Optional.ofNullable(dataTypes) /** Enum for dataset data types. */ - fun dataType(): Optional = Optional.ofNullable(dataType) + fun dataType(): Optional = Optional.ofNullable(dataType) fun isDataTypes(): Boolean = dataTypes != null @@ -393,7 +393,7 @@ private constructor( fun asDataTypes(): List = dataTypes.getOrThrow("dataTypes") /** Enum for dataset data types. */ - fun asDataType(): DataType = dataType.getOrThrow("dataType") + fun asDataType(): com.langchain.smith.models.datasets.DataType = dataType.getOrThrow("dataType") fun accept(visitor: Visitor): T = when { @@ -437,7 +437,7 @@ private constructor( fun visitDataTypes(dataTypes: List): T /** Enum for dataset data types. */ - fun visitDataType(dataType: DataType): T + fun visitDataType(dataType: com.langchain.smith.models.datasets.DataType): T } } diff --git a/langsmith-java-example/src/main/java/com/langchain/smith/example/CreateExamplesExample.java b/langsmith-java-example/src/main/java/com/langchain/smith/example/CreateExamplesExample.java index 0cf31947..4194d82c 100644 --- a/langsmith-java-example/src/main/java/com/langchain/smith/example/CreateExamplesExample.java +++ b/langsmith-java-example/src/main/java/com/langchain/smith/example/CreateExamplesExample.java @@ -9,11 +9,6 @@ import com.langchain.smith.models.datasets.DatasetListParams; import com.langchain.smith.models.examples.Example; import com.langchain.smith.models.examples.ExampleCreateParams; -import java.io.IOException; -import java.net.URI; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Map; @@ -47,7 +42,7 @@ import java.util.Map; * } */ public class CreateExamplesExample { - public static void main(String[] args) throws IOException, InterruptedException { + public static void main(String[] args) { // Configure client from environment variables // Requires: LANGSMITH_API_KEY and LANGSMITH_BASE_URL LangsmithClient client = LangsmithOkHttpClient.fromEnv(); diff --git a/langsmith-java-example/src/main/java/com/langchain/smith/example/ListRunsExample.java b/langsmith-java-example/src/main/java/com/langchain/smith/example/ListRunsExample.java index 322770f0..fa469207 100644 --- a/langsmith-java-example/src/main/java/com/langchain/smith/example/ListRunsExample.java +++ b/langsmith-java-example/src/main/java/com/langchain/smith/example/ListRunsExample.java @@ -2,10 +2,8 @@ package com.langchain.smith.example; import com.langchain.smith.client.LangsmithClient; import com.langchain.smith.client.okhttp.LangsmithOkHttpClient; -import com.langchain.smith.models.runs.BodyParamsForRunSchema; import com.langchain.smith.models.runs.RunQueryParams; import com.langchain.smith.models.runs.RunQueryResponse; -import com.langchain.smith.models.runs.RunSchema; public class ListRunsExample { public static void main(String[] args) { @@ -26,19 +24,17 @@ public class ListRunsExample { // Create query parameters // The API requires at least one filter (session, id, parent_run, trace, or reference_example) // This example queries runs for a specific project/session - BodyParamsForRunSchema body = BodyParamsForRunSchema.builder() + RunQueryParams params = RunQueryParams.builder() .addSession(projectId) // Filter by project/session ID .limit(10L) // Limit to 10 runs .build(); - RunQueryParams params = - RunQueryParams.builder().bodyParamsForRunSchema(body).build(); // Query runs RunQueryResponse response = client.runs().query(params); // Print runs System.out.println("Found " + response.runs().size() + " runs:"); - for (RunSchema run : response.runs()) { + for (RunQueryResponse.Run run : response.runs()) { System.out.println("Run ID: " + run.id()); System.out.println("Run Name: " + run.name()); System.out.println("---");