From 460fc39a56fe631f33905eb2b905955f74ca303f Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Wed, 4 Mar 2026 16:35:23 -0500 Subject: [PATCH 1/3] Update README for v9 OAuth 2.0 migration Update all code examples to reflect v9 breaking changes: - Client/PhenoML -> PhenomlClient - Username/password auth -> OAuth 2.0 client credentials (clientId/clientSecret) - Fix PhenomlApiApiException typo -> PhenomlClientApiException - Update example URLs to https://yourinstance.app.pheno.ml Co-Authored-By: Claude Opus 4.6 --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6bf8cb6..141ca08 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,18 @@ Instantiate and use the client with the following: ```java package com.example.usage; -import com.phenoml.api.Client; +import com.phenoml.api.PhenomlClient; import com.phenoml.api.resources.agent.requests.AgentCreateRequest; import java.util.ArrayList; import java.util.Arrays; public class Example { public static void main(String[] args) { - // Use client with automatic authentication - Client client = Client.withCredentials("your-username", "your-password", "https://api.example.com"); - - // Or use with existing token - // Client client = Client.withToken("your-token", "https://api.example.com"); + PhenomlClient client = PhenomlClient.builder() + .clientId("YOUR_CLIENT_ID") + .clientSecret("YOUR_CLIENT_SECRET") + .url("https://yourinstance.app.pheno.ml") + .build(); client.agent().create( AgentCreateRequest @@ -45,10 +45,10 @@ public class Example { This SDK allows you to configure different environments for API requests. ```java -import com.phenoml.api.PhenoML; +import com.phenoml.api.PhenomlClient; import com.phenoml.api.core.Environment; -PhenoML client = PhenoML +PhenomlClient client = PhenomlClient .builder() .environment(Environment.Default) .build(); @@ -59,11 +59,11 @@ PhenoML client = PhenoML You can set a custom base URL when constructing the client. ```java -import com.phenoml.api.PhenoML; +import com.phenoml.api.PhenomlClient; -PhenoML client = PhenoML +PhenomlClient client = PhenomlClient .builder() - .url("https://example.com") + .url("https://yourinstance.app.pheno.ml") .build(); ``` @@ -72,11 +72,11 @@ PhenoML client = PhenoML When the API returns a non-success status code (4xx or 5xx response), an API exception will be thrown. ```java -import com.phenoml.api.core.PhenomlApiApiException; +import com.phenoml.api.core.PhenomlClientApiException; try { client.agent().create(...); -} catch (PhenomlApiApiException e) { +} catch (PhenomlClientApiException e) { // Do something with the API exception... } ``` @@ -89,12 +89,12 @@ This SDK is built to work with any instance of `OkHttpClient`. By default, if no However, you can pass your own client like so: ```java -import com.phenoml.api.PhenoML; +import com.phenoml.api.PhenomlClient; import okhttp3.OkHttpClient; OkHttpClient customClient = ...; -PhenoML client = PhenoML +PhenomlClient client = PhenomlClient .builder() .httpClient(customClient) .build(); @@ -115,9 +115,9 @@ A request is deemed retryable when any of the following HTTP status codes is ret Use the `maxRetries` client option to configure this behavior. ```java -import com.phenoml.api.PhenoML; +import com.phenoml.api.PhenomlClient; -PhenoML client = PhenoML +PhenomlClient client = PhenomlClient .builder() .maxRetries(1) .build(); @@ -128,11 +128,11 @@ PhenoML client = PhenoML The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. ```java -import com.phenoml.api.PhenoML; +import com.phenoml.api.PhenomlClient; import com.phenoml.api.core.RequestOptions; // Client level -PhenoML client = PhenoML +PhenomlClient client = PhenomlClient .builder() .timeout(10) .build(); From cd6fc853f630f1fea9ca9162c45b0a814b72f986 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Wed, 4 Mar 2026 16:41:00 -0500 Subject: [PATCH 2/3] chore: bump version to 9.0.1 for README update Co-Authored-By: Claude Opus 4.6 --- build.gradle | 4 ++-- src/main/java/com/phenoml/api/core/ClientOptions.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index b37d0b1..321ab61 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.phenoml.maven' -version = '9.0.0' +version = '9.0.1' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.phenoml.maven' artifactId = 'phenoml-java-sdk' - version = '9.0.0' + version = '9.0.1' from components.java pom { name = 'phenoml' diff --git a/src/main/java/com/phenoml/api/core/ClientOptions.java b/src/main/java/com/phenoml/api/core/ClientOptions.java index d290518..bb970cf 100644 --- a/src/main/java/com/phenoml/api/core/ClientOptions.java +++ b/src/main/java/com/phenoml/api/core/ClientOptions.java @@ -32,10 +32,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.phenoml.maven:phenoml-java-sdk/9.0.0"); + put("User-Agent", "com.phenoml.maven:phenoml-java-sdk/9.0.1"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.phenoml.fern:api-sdk"); - put("X-Fern-SDK-Version", "9.0.0"); + put("X-Fern-SDK-Version", "9.0.1"); } }); this.headerSuppliers = headerSuppliers; From c4316adaac2590dfffca87f73f6055c93f6e3eec Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Wed, 4 Mar 2026 16:51:14 -0500 Subject: [PATCH 3/3] fix: correct agent.create() example in README - Fix import path from agent.requests to agent.types - Add required .provider() call after .name() (staged builder pattern) - Remove non-existent .isActive(true) method Co-Authored-By: Claude Opus 4.6 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 141ca08..9e5a7d2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Instantiate and use the client with the following: package com.example.usage; import com.phenoml.api.PhenomlClient; -import com.phenoml.api.resources.agent.requests.AgentCreateRequest; +import com.phenoml.api.resources.agent.types.AgentCreateRequest; import java.util.ArrayList; import java.util.Arrays; @@ -28,12 +28,12 @@ public class Example { AgentCreateRequest .builder() .name("name") + .provider(AgentCreateRequest.Provider.of("provider_id")) .prompts( new ArrayList( Arrays.asList("prompt_123", "prompt_456") ) ) - .isActive(true) .build() ); }