Skip to content

Commit

Permalink
docs: switch to .list() without arguments in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Feb 26, 2025
1 parent 06231c2 commit d1480f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.openai.client.OpenAIClientAsync;
import com.openai.client.okhttp.OpenAIOkHttpClientAsync;
import com.openai.models.ModelListPageAsync;
import com.openai.models.ModelListParams;
import java.util.concurrent.CompletableFuture;

public final class ModelListAsyncExample {
Expand All @@ -15,9 +14,7 @@ public static void main(String[] args) {
// - The `AZURE_OPENAI_ENDPOINT` and `AZURE_OPENAI_KEY` environment variables
OpenAIClientAsync client = OpenAIOkHttpClientAsync.fromEnv();

CompletableFuture<ModelListPageAsync> pageFuture =
// TODO: Update this example once we support `.list()` without arguments.
client.models().list(ModelListParams.builder().build());
CompletableFuture<ModelListPageAsync> pageFuture = client.models().list();
pageFuture
.thenComposeAsync(page -> page.autoPager()
.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ public static void main(String[] args) {
// - The `AZURE_OPENAI_ENDPOINT` and `AZURE_OPENAI_KEY` environment variables
OpenAIClient client = OpenAIOkHttpClient.fromEnv();

client.models()
// TODO: Update this example once we support `.list()` without arguments.
.list(ModelListParams.builder().build())
.autoPager()
.forEach(model -> System.out.println(model.id()));
client.models().list().autoPager().forEach(model -> System.out.println(model.id()));
}
}

0 comments on commit d1480f1

Please sign in to comment.