Generate Test Data

Generate similar test data using our AI-powered service, Data Amplifier. You can provide sample data in your request and specify the desired number of rows to be generated, available through both SDKs and APIs.

Usage 🚀

Refer to Setup Guide for installing dependecies for both Java and Python.

JAVA

There are 2 clients available with the Java SDK: SyncClient and AsyncClient

chevron-rightJava Client Codehashtag
# for async client 
import org.qyrus.ai_sdk.Clients.AsyncClient;
AsyncClient client = new AsyncClient(<API_TOKEN>, null);

# for sync client
import org.qyrus.ai_sdk.Clients.SyncClient;
SyncClient client = new SyncClient(<API_TOKEN>, null);

Using SyncClient

Here's an example of utilizing Data Amplifier with SyncClient.

chevron-rightJava SyncClient Codehashtag
private static void testDataAmplification() {

        Dotenv dotenv = Dotenv.load();
        String QYRUS_AI_SDK_API_TOKEN = dotenv.get("QYRUS_AI_SDK_API_TOKEN");

        // Assuming SyncClient is similar to the provided NovaJira code and has a 'data_amplifier' field and an 'amplify' method
        SyncClient client = new SyncClient(QYRUS_AI_SDK_API_TOKEN, null);

        
        List<Map<String, Object>> example_data = List.of(
            Map.of(
                "column_name", "name",
                "column_description", "name",
                "column_restriction", "no restrictions",
                "column_values", List.of("Sameer Seikh", "Sunil Dutt")
            ),
            Map.of(
                "column_name", "email",
                "column_description", "email",
                "column_restriction", "no restrictions",
                "column_values", List.of("[email protected]","[email protected]")
            )
            
        );

        int data_count = 10;

        long startTime = System.currentTimeMillis();
        int numberOfRequests = 2;

        for (int i = 0; i < numberOfRequests; i++) {

            try {
                // Accessing the data_amplifier's amplify method the same way as it's described in the input
                DataAmplifier.DataAmplifierResponse response = client.data_amplifier.amplify(example_data, data_count);
                System.out.println("Amplification Status: " + response.isStatus());
                System.out.println("Amplification Message: " + response.getMessage());

                // Assuming DataAmplifierResponse contains a 'getData' method to access generated data
                Map<String, List<String>> amplifiedData = response.getData();
                
                // Iterate over the map to display generated data
                for (Map.Entry<String, List<String>> entry : amplifiedData.entrySet()) {
                    System.out.println("Column: " + entry.getKey());
                    System.out.println("Values: " + entry.getValue());
                }
                
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        long endTime = System.currentTimeMillis();
        System.out.println("Total time for Data Amplification request: " + (endTime - startTime) + " ms");
    }

Using AsyncClient

Here's an example of utilizing Data Amplifier with AsyncClient.

chevron-rightJava AsyncClient Codehashtag

PYTHON

There are two clients available with the Python SDK: SyncQyrusAI and AsyncQyrusAI.

chevron-rightPython Client Codehashtag

Using SyncQyrusAI

Here's an example of utilizing Data Amplifier with SyncQyrusAI.

chevron-rightPython SyncQyrusAI Codehashtag

Using AsyncQyrusAI

Here's an example of utilizing Data Amplifier with AsyncQyrusAI.

chevron-rightPython AsyncQyrusAI Codehashtag

Rest APIs

  • Endpoint: POST {{GATEWAY_URL}}/synthetic-data-generator-sdk/v1/api/datagen

  • Headers:

    • Authorization: [Your Authorization Token]

    • Custom: [Your Custom Header Value]

  • Request Body:

  • Response:

Last updated