Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 11
# Must match maven.compiler.target in the root pom (17), and the CI workflow.
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: central
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Java client library for the [Gradient Labs API](https://api-docs.gradient-labs.a
- Type-safe models and enums
- Webhook signature verification
- Comprehensive error handling
- Java 11+ compatible
- Java 17+ compatible
- Zero runtime dependencies (except Jackson)

## Spring Boot Integration
Expand All @@ -23,14 +23,14 @@ For Spring Boot applications, use the starter dependency for zero-configuration
<dependency>
<groupId>ai.gradientlabs</groupId>
<artifactId>gradient-labs-spring-boot-starter</artifactId>
<version>1.0.0</version>
<version>1.0.2</version>
</dependency>
```

### Gradle

```gradle
implementation 'ai.gradientlabs:gradient-labs-spring-boot-starter:1.0.0'
implementation 'ai.gradientlabs:gradient-labs-spring-boot-starter:1.0.2'
```

### Configuration
Expand Down Expand Up @@ -95,14 +95,14 @@ For non-Spring applications, use the core client library:
<dependency>
<groupId>ai.gradientlabs</groupId>
<artifactId>gradient-labs-client</artifactId>
<version>1.0.0</version>
<version>1.0.2</version>
</dependency>
```

### Gradle

```gradle
implementation 'ai.gradientlabs:gradient-labs-client:1.0.0'
implementation 'ai.gradientlabs:gradient-labs-client:1.0.2'
```

## Error Handling
Expand Down Expand Up @@ -167,7 +167,7 @@ GradientLabsClient client = GradientLabsClient.builder()

## Requirements

- Java 11 or higher
- Java 17 or higher
- Jackson 2.18+ for JSON serialization

## Documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This example demonstrates how to use the Gradient Labs Spring Boot Starter for z

### Prerequisites

- Java 11 or higher
- Java 17 or higher
- Maven
- Gradient Labs API key

Expand Down
2 changes: 1 addition & 1 deletion gradient-labs-client/examples/spring-boot-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>ai.gradientlabs</groupId>
<artifactId>gradient-labs-spring-boot-starter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.2</version>
</dependency>

<!-- Spring Boot Web -->
Expand Down
16 changes: 15 additions & 1 deletion gradient-labs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ai.gradientlabs</groupId>
<artifactId>gradient-labs-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2</version>
</parent>

<artifactId>gradient-labs-client</artifactId>
Expand Down Expand Up @@ -72,6 +72,20 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- Implementation-Version in the manifest is what the User-Agent reports;
without it the client identifies itself as "dev". -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ai.gradientlabs.client.internal.HttpClientWrapper;
import ai.gradientlabs.client.model.*;
import ai.gradientlabs.client.request.*;
import ai.gradientlabs.client.response.StartOutboundConversationResponse;
import ai.gradientlabs.client.webhook.Webhook;
import ai.gradientlabs.client.webhook.WebhookVerifier;

Expand Down Expand Up @@ -80,24 +81,68 @@ public Conversation startConversation(StartConversationRequest request) {
}

/**
* Starts an outbound conversation.
* Starts an outbound live chat conversation.
* <p>
* Creates and starts a new outbound conversation where the AI agent proactively
* initiates contact with a customer. The conversation follows the instructions
* defined in the specified outbound procedure.
* Creates and starts a new outbound live chat conversation in which the AI agent
* proactively initiates contact with a customer, following the instructions defined in
* the specified outbound procedure.
* <p>
* If support_platform is not provided, the system will automatically select the
* highest priority platform that has integration settings configured for your company.
* If a body is provided, that message will be sent as the opening message. Otherwise,
* the AI agent will generate one based on the procedure.
* <p>
* If body and subject are provided, that message will be sent as the initial message.
* Otherwise, the AI agent will generate an appropriate initial message based on the procedure.
* The customer is created, or matched to an existing record, from the customer ID and
* any customer support platform identifiers you supply. The platform the chat is
* delivered on needs an identifier for that customer.
*
* @param request the outbound conversation parameters
* @param request the outbound chat conversation parameters
* @return the response containing the conversation ID
* @throws GradientLabsException if the request fails
*/
public ai.gradientlabs.client.response.StartOutboundConversationResponse startOutboundConversation(StartOutboundConversationRequest request) {
return httpClient.post("/outbound/conversations", request, ai.gradientlabs.client.response.StartOutboundConversationResponse.class);
public StartOutboundConversationResponse startOutboundChatConversation(StartOutboundChatConversationRequest request) {
return httpClient.post("/outbound/conversations/chat", request, StartOutboundConversationResponse.class);
}

/**
* Starts an outbound email conversation.
* <p>
* Creates and starts a new outbound email conversation in which the AI agent
* proactively initiates contact with a customer, following the instructions defined in
* the specified outbound procedure.
* <p>
* If a subject and body are provided, that email will be sent as the opening message.
* Otherwise, the AI agent will write one based on the procedure.
* <p>
* The customer is created, or matched to an existing record, from the customer ID and
* any customer support platform identifiers you supply. The platform the email is sent
* from needs an identifier for that customer, so sending from Zendesk needs a Zendesk
* identifier, and so on.
*
* @param request the outbound email conversation parameters
* @return the response containing the conversation ID
* @throws GradientLabsException if the request fails
*/
public StartOutboundConversationResponse startOutboundEmailConversation(StartOutboundEmailConversationRequest request) {
return httpClient.post("/outbound/conversations/email", request, StartOutboundConversationResponse.class);
}

/**
* Places an outbound phone call.
* <p>
* Places an outbound phone call in which the AI agent proactively contacts a customer,
* following the instructions defined in the specified outbound procedure.
* <p>
* The number the call is placed from must already be provisioned for your company.
* <p>
* The customer is created, or matched to an existing record, from the customer ID and
* any customer support platform identifiers you supply. The dialled number is recorded
* against that same customer.
*
* @param request the outbound phone conversation parameters
* @return the response containing the conversation ID
* @throws GradientLabsException if the request fails
*/
public StartOutboundConversationResponse startOutboundPhoneConversation(StartOutboundPhoneConversationRequest request) {
return httpClient.post("/outbound/conversations/phone", request, StartOutboundConversationResponse.class);
}

/**
Expand Down
Loading
Loading