[ad_1]
Part 1:
- Basic introduction of ChatSonic API integration using Python.
- Advance usage of ChatSonic API. (Learning About Memory Functionality)
Part 2:
- Generating images using PhotoSonic API
- Introduction to WriteSonic API and basic features
Part 3:
- Getting into more depth.
Covering all the features may not be possible but the series will cover the most useful tools for automation.
Part 4:
Integrating Medium API with WriteSonic API using Python.
- Authenticating User.
- Generating API Token
- Fetching data about the user
- Creating a post
- Creating a post under publication
Part 5: Integrating Rephrase In The Automation. (This will only be integrated as per the comments on the article)
Writesonic is an AI-powered writing assistant designed to help individuals and businesses generate high-quality content quickly and easily. With its advanced natural language processing technology, Writesonic can help with various writing tasks such as creating catchy headlines, outlining blog posts, and generating product descriptions. It also offers SEO optimization, performance tracking, and integrations with popular marketing platforms. Writesonic is suitable for all levels of content creators looking to improve their writing game.
Click here to try “WriteSonic” for free.
Chatsonic — AI-powered assistant enables text and image creation. It is a ChatGPT-like conversational AI chatbot but with real-time data, images & voice search. It is built on a powerful connection with Google search that helps to come up with hyper-relevant, factual & latest content to generate unique copy and digital artwork using AI. [ChatSonic Intro is copied from WriteSonic Documentation.]
Features of this API [From WriteSonic Doc]
- enable/disable real-time Google search
- enable/disable memory functionality
- talk to ChatSonic in 24 languages
Integrating ChatSonic API Using Python
Step 1: Installing Requests module in Python
pip install requests
Step 2: Asking Question From ChatSonic
import requestsAPI_KEY = "Your API KEY"
url = "https://api.writesonic.com/v2/business/content/chatsonic?engine=premium"
payload = {
"enable_google_results": True, #If enabled, ChatSonic will use Google search results to answer the question.
"enable_memory": False, #if enabled, ChatSonic will remember the previous conversation.
"history_data": [
{
"is_sent": bool,
"message":"Value"
}
], #Used when memory functionality is set to
"input_text": [Question You Want To Ask] #should be string
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"X-API-KEY": API_KEY
}
response = requests.post(url, json=payload, headers=headers)
print(response. Text)
Step 3: Asking Question From ChatSonic By Enabling The Memory Functionality.
import requestsAPI_KEY = "Your API KEY"
url = "https://api.writesonic.com/v2/business/content/chatsonic?engine=premium"
payload = {
"enable_google_results": True, #If enabled, ChatSonic will use Google search results to answer the question.
"enable_memory": True, #if enabled, ChatSonic will remember the previous conversation.
"history_data": [
{
"is_sent": True, #the value of is_sent will be True for the User_Prompt and False for the ChatSonic.
"message":"Question asked by user."
},
{
"is_sent": False, #the value of is_sent will be False for the ChatSonic response.
"message":"Response from the ChatSonic."
}
], #Used when memory functionality is set to
"input_text": [Question You Want To Ask] #should be string
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"X-API-KEY": API_KEY
}
response = requests.post(url, json=payload, headers=headers)
print(response. Text)
To conclude, WriteSonic chatbot ChatSonic does have immense power, and integrating the chatbot for automation brings you one step closer to making a passive source of income.
Stay tuned for the rest of the series.
And feel free to use WriteSonic to follow along with the series.
Follow us on Instagram
[ad_2]
Source link