Large Content Generation AI Model. This model is designed to generate large amounts of content based on the provided parameters. You can provide a pre-trained model to generate content on top of it. This is mostly used for use-cases where you want to run a model based on your pre-trained dataset. It can be used to generate content for a variety of use cases where the content is more creative or complex.

Read more at https://docs.worqhat.com/ai-models/text-generation-ai/aicon-v2-large-beta

ParameterTypeDescriptionDefault
questionstringThis parameter represents the question or prompt for which the content is to be generated. It should be provided as a string. If not provided, the default value is undefined.
datasetIdstringThis parameter represents the dataset ID to be used for generating the content. It should be provided as a string. If not provided, the default value is undefined.
conversation_historyArrayThis parameter accepts an array of objects. Each object represents a previous interaction in the conversation. This is useful for context-aware content generation. If not provided, the default value is undefined, meaning no conversation history is considered.
preserve_historybooleanThis is a flag that indicates whether the conversation history should be preserved for future interactions. If set to true, the conversation history is preserved. If set to false or not provided, the default behavior is not to preserve the conversation history.
instructionsstringThis parameter represents the training data to be used for generating the content. It should be provided as a string. If not provided, the default value is undefined.
randomnessnumberThis parameter controls the level of randomness in the generated content. It accepts a number between 0 and 1, where 0 means no randomness and 1 means maximum randomness. If not provided, the default value is 0.2.
streambooleanThis is a flag that indicates whether the response should be streamed or not. If set to true, the response is streamed. If set to false or not provided, the default behavior is not to stream the response.

Initialize AI Modules

const worqhat = require('worqhat');

var config = new worqhat.Configuration({
    apiKey: "your-api-key",
    debug: true,
    max_retries: 3,
});


worqhat.initializeApp(config);

let ai = worqhat.ai();

Handle Non Stream Request

ai.contentGeneration.large({
    "question": "What is your name?",
    "datasetId": "your-training-dataset-id",
    "preserve_history": true,
    "instructions": `You are Sagnik the Tour guide of the world.`,
    "conversation_history" : [
        {
            "Hi who are you?": "I am Sagnik the Tour guide of the world."
        },
        {
            "Can you tell me about Paris" : `Paris is the capital and most populous
			city of France, with an estimated population of 2,175,601 residents as
			of 2018, in an area of more than 105 square kilometres. Since the 17th
			century, Paris has been one of Europe's major centres of finance,
			diplomacy, commerce, fashion, science and arts.`
        }
    ],
    randomness: 0.2,
    stream : false
}).then(function(response) {
    console.log(response);
}).catch(function(error) {
    console.log(error);
});

Handle Stream Request

ai.contentGeneration.large({
    "question": "What is your name?",
    "datasetId": "your-training-dataset-id",
    "preserve_history": true,
    "instructions": `You are Sagnik the Tour guide of the world.`,
    "conversation_history" : [
        {
            "Hi who are you?": "I am Sagnik the Tour guide of the world."
        },
        {
            "Can you tell me about Paris" : `Paris is the capital and most populous
			city of France, with an estimated population of 2,175,601 residents as
			of 2018, in an area of more than 105 square kilometres. Since the 17th
			century, Paris has been one of Europe's major centres of finance,
			diplomacy, commerce, fashion, science and arts.`
        }
    ],
    randomness: 0.2,
    stream : true
})
.then(function(response) {
    response.on('data', function(data) {
        console.log(data);
    });
}).catch(function(error) {
    console.log(error);
});