Operations (sample payloads)

Main operations
Copy

Classify Text
Copy

Classify some text based on a number of available categories

Sample Input

1
{
2
"text": "The new iPhone 14 Pro features a 48MP camera and Dynamic Island.",
3
"categories": [
4
"Technology",
5
"Fashion",
6
"Sports",
7
"Politics"
8
],
9
"examples": [
10
{
11
"category": "Technology",
12
"text": "The latest MacBook Air comes with the M2 chip for improved performance."
13
},
14
{
15
"category": "Fashion",
16
"text": "Gucci's new collection showcases bold colors and vintage-inspired designs."
17
},
18
{
19
"category": "Sports",
20
"text": "The Golden State Warriors won the NBA championship for the fourth time in eight years."
21
},
22
{
23
"category": "Politics",
24
"text": "The upcoming election will focus on economic policies and healthcare reform."
25
}
26
]
27
}

Sample Output

1
{
2
"category": "Technology"
3
}

Generate Text
Copy

Generate some text from instructions using AI.

Sample Input

1
{
2
"instructions": "Write a short paragraph about the benefits of cloud computing for small businesses.",
3
"temperature": 0.7,
4
"max_tokens": 150
5
}

Sample Output

1
{
2
"response": "Cloud computing offers numerous advantages for small businesses. It provides cost-effective access to advanced technologies and infrastructure without the need for significant upfront investments. Small businesses can scale their resources up or down based on demand, ensuring optimal performance and cost efficiency. Cloud solutions also enable remote work and collaboration, increasing productivity and flexibility. Additionally, cloud providers typically offer robust security measures and automatic backups, helping small businesses protect their data and ensure business continuity."
3
}

Sentiment Analysis
Copy

Perform sentiment analysis on text data.

Sample Input

1
{
2
"text": "I absolutely love this product! It's amazing and has improved my life significantly. However, the customer service could be better.",
3
"language": "en"
4
}

Sample Output

1
{
2
"sentiment": "MIXED",
3
"score": {
4
"positive": 0.75,
5
"negative": 0.15,
6
"neutral": 0.05,
7
"mixed": 0.05
8
}
9
}

Summarize Text
Copy

Summarize some text using AI.

Sample Input

1
{
2
"text": "In today's meeting, we discussed the upcoming product launch for our new software application. The marketing team presented their promotional strategy, which includes social media campaigns, influencer partnerships, and a series of webinars. The development team provided an update on the final testing phase, reporting that all major bugs have been resolved. The sales team shared their projections for the first quarter after launch, estimating a 20% increase in revenue. We also addressed concerns about potential server load during the initial release and decided to implement a phased rollout to mitigate risks. The meeting concluded with setting a firm launch date for next month and assigning final tasks to each department.",
3
"format": "bulleted-recap",
4
"temperature": 0.7,
5
"max_tokens": 150
6
}

Sample Output

1
{
2
"summary": "• Product launch discussed for new software application\n• Marketing strategy: social media, influencers, webinars\n• Development team: final testing complete, major bugs resolved\n• Sales projections: 20% revenue increase in Q1 post-launch\n• Decision made for phased rollout to manage server load\n• Launch date set for next month\n• Final tasks assigned to each department"
3
}