Skip to content

ChatSonic

Basic example showing how to use the ChatSonic conversational AI chatbot.

This example assumes using Writesonic; is in scope and apiKey contains your Writesonic API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
using var client = new WritesonicClient(apiKey);

// Send a question to ChatSonic with Google search integration:
var response = await client.ChatSonicAsync(
    engine: ChatSonicEngine.Premium,
    language: ChatSonicLanguage.En,
    numCopies: 1,
    request: new ChatSonicRequest
    {
        InputText = "What is Writesonic?",
        EnableGoogleResults = true,
        EnableMemory = false,
    });