Skip to content

Commit

Permalink
Add admin examples + dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 5, 2024
1 parent c9b5a12 commit 52478cc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,25 @@ runsClient.createRunAndStream(thread.id(), createRunRequest, new AssistantStream
});
// "createThreadAndRunAndStream" and "submitToolOutputsAndStream" methods are also available
```
- List all the users in an organization.
```java
OpenAI openAI = OpenAI.newBuilder()
.adminKey(System.getenv("OPENAI_ADMIN_KEY"))
.build();

UsersClient usersClient = openAI.usersClient();
List<User> users = usersClient.listUsers(Optional.empty(), Optional.empty()).data();
```
- List user actions and configuration changes within an organization
```java
OpenAI openAI = OpenAI.newBuilder()
.adminKey(System.getenv("OPENAI_ADMIN_KEY"))
.build();

AuditLogsClient auditLogsClient = openAI.auditLogsClient();
ListAuditLogsQueryParameters queryParameters = ListAuditLogsQueryParameters.newBuilder()
.eventTypes(List.of("invite.sent", "invite.deleted"))
.build();
List<AuditLog> auditLogs = auditLogsClient.listAuditLogs(queryParameters).data();
```

6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "com.diffplug.spotless" version "6.25.0"
id "me.qoomon.git-versioning" version "6.4.3"
id "me.qoomon.git-versioning" version "6.4.4"
id "com.github.ben-manes.versions" version "0.51.0"
}

Expand Down Expand Up @@ -34,7 +34,7 @@ java {
}

def jacksonVersion = "2.17.2"
def junitVersion = "5.10.3"
def junitVersion = "5.11.0"

dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
Expand All @@ -45,7 +45,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("org.mock-server:mockserver-netty-no-dependencies:5.15.0")
testImplementation("com.atlassian.oai:swagger-request-validator-core:2.41.0")
testImplementation("com.atlassian.oai:swagger-request-validator-core:2.42.0")
testImplementation("org.skyscreamer:jsonassert:1.5.3")
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 52478cc

Please sign in to comment.