Skip to content

Commit

Permalink
Updating sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tse-developer committed Dec 20, 2024
1 parent 6ab4d82 commit 4836804
Show file tree
Hide file tree
Showing 493 changed files with 28,251 additions and 5,570 deletions.
60 changes: 43 additions & 17 deletions sdks/java/README.md

Large diffs are not rendered by default.

1,731 changes: 1,449 additions & 282 deletions sdks/java/api/openapi.yaml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions sdks/java/docs/AccessToken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


# AccessToken


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**id** | **String** | GUID of the auth token. | [optional] |
|**token** | **String** | Bearer auth token. | |
|**org** | [**OrgInfo**](OrgInfo.md) | | |
|**user** | [**UserInfo**](UserInfo.md) | | |
|**creationTimeInMillis** | **Float** | Token creation time in milliseconds. | |
|**expirationTimeInMillis** | **Float** | Token expiration time in milliseconds. | |



223 changes: 223 additions & 0 deletions sdks/java/docs/AiApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
# AiApi

All URIs are relative to *https://localhost:443*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createConversation**](AiApi.md#createConversation) | **POST** /api/rest/2.0/ai/conversation/create | |
| [**sendMessage**](AiApi.md#sendMessage) | **POST** /api/rest/2.0/ai/conversation/{conversation_identifier}/converse | |
| [**singleAnswer**](AiApi.md#singleAnswer) | **POST** /api/rest/2.0/ai/answer/create | |


<a id="createConversation"></a>
# **createConversation**
> Conversation createConversation(createConversationRequest)


Version: 10.4.0.cl or later Creates a Conversation object to start an AI-driven conversation based on a specific data model. Requires at least view access to the metadata object specified in the request. #### Usage guidelines This API requires the &#x60;metadata_identifier&#x60; parameter to define the context for the conversation. You can also specify the tokens to initiate the conversation as shown in this example: &#x60;\&quot;tokens\&quot;: \&quot;[tea],[sales],[type]\&quot;&#x60; If the API request is successful, ThoughtSpot returns the ID of the conversation. &gt; ###### Note: &gt; * This endpoint is currently in Beta. Breaking changes may be introduced before the endpoint is made Generally Available. &gt; * This endpoint requires Spotter - please contact ThoughtSpot support to enable Spotter on your cluster.

### Example
```java
// Import classes:
import org.thoughtspot.client.ApiClient;
import org.thoughtspot.client.ApiException;
import org.thoughtspot.client.Configuration;
import org.thoughtspot.client.auth.*;
import org.thoughtspot.client.models.*;
import org.thoughtspot.client.api.AiApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://localhost:443");

// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");

AiApi apiInstance = new AiApi(defaultClient);
CreateConversationRequest createConversationRequest = new CreateConversationRequest(); // CreateConversationRequest |
try {
Conversation result = apiInstance.createConversation(createConversationRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AiApi#createConversation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **createConversationRequest** | [**CreateConversationRequest**](CreateConversationRequest.md)| | |

### Return type

[**Conversation**](Conversation.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Common successful response | - |
| **201** | Common error response | - |
| **400** | Operation failed | - |
| **500** | Operation failed | - |

<a id="sendMessage"></a>
# **sendMessage**
> List&lt;ResponseMessage&gt; sendMessage(conversationIdentifier, sendMessageRequest)


Version: 10.4.0.cl or later Allows sending a follow-up message to an ongoing conversation within the context of the metadata model. Requires at least view access to the metadata object specified in the request. #### Usage guidelines The API requires you to specify the &#x60;conversation_identifier&#x60; in the request path, and a &#x60;metadata_identifier&#x60; and &#x60;message&#x60; string in the request body. If the API request is successful, ThoughtSpot returns the session ID, tokens used in the conversation, and visualization type. &gt; ###### Note: &gt; * This endpoint is currently in Beta. Breaking changes may be introduced before the endpoint is made Generally Available. &gt; * This endpoint requires Spotter - please contact ThoughtSpot support to enable Spotter on your cluster.

### Example
```java
// Import classes:
import org.thoughtspot.client.ApiClient;
import org.thoughtspot.client.ApiException;
import org.thoughtspot.client.Configuration;
import org.thoughtspot.client.auth.*;
import org.thoughtspot.client.models.*;
import org.thoughtspot.client.api.AiApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://localhost:443");

// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");

AiApi apiInstance = new AiApi(defaultClient);
String conversationIdentifier = "conversationIdentifier_example"; // String | Unique identifier of the conversation.
SendMessageRequest sendMessageRequest = new SendMessageRequest(); // SendMessageRequest |
try {
List<ResponseMessage> result = apiInstance.sendMessage(conversationIdentifier, sendMessageRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AiApi#sendMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **conversationIdentifier** | **String**| Unique identifier of the conversation. | |
| **sendMessageRequest** | [**SendMessageRequest**](SendMessageRequest.md)| | |

### Return type

[**List&lt;ResponseMessage&gt;**](ResponseMessage.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Common successful response | - |
| **201** | Common error response | - |
| **400** | Operation failed | - |
| **500** | Operation failed | - |

<a id="singleAnswer"></a>
# **singleAnswer**
> ResponseMessage singleAnswer(singleAnswerRequest)


Version: 10.4.0.cl or later Processes a natural language query and returns an AI-generated response based on a specified data model. Requires at least view access to the metadata object specified in the request. &gt; ###### Note: &gt; * This endpoint is currently in Beta. Breaking changes may be introduced before the endpoint is made Generally Available. &gt; * This endpoint requires Spotter - please contact ThoughtSpot support to enable Spotter on your cluster.

### Example
```java
// Import classes:
import org.thoughtspot.client.ApiClient;
import org.thoughtspot.client.ApiException;
import org.thoughtspot.client.Configuration;
import org.thoughtspot.client.auth.*;
import org.thoughtspot.client.models.*;
import org.thoughtspot.client.api.AiApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://localhost:443");

// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");

AiApi apiInstance = new AiApi(defaultClient);
SingleAnswerRequest singleAnswerRequest = new SingleAnswerRequest(); // SingleAnswerRequest |
try {
ResponseMessage result = apiInstance.singleAnswer(singleAnswerRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AiApi#singleAnswer");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **singleAnswerRequest** | [**SingleAnswerRequest**](SingleAnswerRequest.md)| | |

### Return type

[**ResponseMessage**](ResponseMessage.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Common successful response | - |
| **201** | Common error response | - |
| **400** | Operation failed | - |
| **500** | Operation failed | - |

Loading

0 comments on commit 4836804

Please sign in to comment.