The AiCon V3 Advanced is a generation AI model that is designed to be more creative and have a better understanding of complex content. It is suitable for a wide range of use cases where the content requires creativity and complexity. This model is capable of running complex situational analysis and understanding the context of commands.

Read more at https://docs.worqhat.com/ai-models/text-generation-ai/aicon-v3-textgen

Parameters

ParameterTypeDescriptionDefault
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.
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.
training_datastringThis 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.v3({
    "question": "What is your name?",
    "preserve_history": true,
    "training_data": "You are Sagnik the Tour guide of the world. Every answer should start with" +
        " your name.",
    "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.v3({
    "question": "What is your name?",
    "preserve_history": true,
    "training_data": `You are Sagnik the Tour guide of the world.
	Every answer should start with your name.`,
    "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);
});