You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,13 @@ I also tried to make it as **generic** and **reusable** as possible to cover mos
85
85
- Contact Form (powered by SMTP via Sendgrid, Mailgun, AWS SES, etc.)
86
86
- File upload
87
87
-**API Examples**
88
-
- Facebook, Foursquare, Tumblr (OAuth 1.0a example), Github, Steam, Quickbooks, Paypal, Stripe, Twilio (text messaging), Lob (USPS Mail), HERE Maps, Google Maps, Google Drive, Google Sheets, Alpha Vantage (stocks and finance info) with ChartJS, Last.fm, New York Times, Web Scraping, Trakt.tv (movies/TV)
88
+
89
+
-**AI:** OpenAI Moderation, Together AI foundational model LLMs (aka Deepseek, Llama, Mistral, etc.)
-**Data, Media & Entertainment:** Alpha Vantage (stocks and finance info) with ChartJS, Github, Foursquare, Last.fm, New York Times, Trakt.tv (movies/TV), Twitch, Tumblr (OAuth 1.0a example), Web Scraping
92
+
-**Maps and Location:** Google Maps, HERE Maps
93
+
-**Productivity:** Google Drive, Google Sheets
94
+
89
95
- Flash notifications
90
96
- reCAPTCHA and rate limit protection
91
97
- CSRF protection
@@ -407,6 +413,16 @@ The OpenAI moderation API for checking harmful inputs is free to use as long as
- Click on **Create API Key** to generate a new key. You will also be able to access your API key under your account settings in the API Keys tab.
421
+
- Copy and paste the generated API key into your `.env` file as `TOGETHERAI_API_KEY` or set it as an environment variable.
422
+
- Go to Together AI's <ahref="https://api.together.ai/models"target="_blank"> Models</a> page and pick a model based on your usecase and budget and specify it the `TOGETHERAI_MODEL` in your `.env` file or as an environment variable (e.g. `togethercomputer/llama-3-70b-chat`).
error='TogetherAI API key is not set in environment variables.';
1522
+
}elseif(!togetherAiModel){
1523
+
error='TogetherAI model is not set in environment variables.';
1524
+
}elseif(!inputText.trim()){
1525
+
error='Please enter a message to classify.';
1526
+
}else{
1527
+
try{
1528
+
constsystemPrompt=`You are a customer service classifier for an e-commerce platform. Your role is to identify the primary issue described by the customer and return the result in JSON format. Carefully analyze the customer's message and select one of the following departments as the classification result:
1529
+
1530
+
Order Tracking and Status
1531
+
Returns and Refunds
1532
+
Payments and Billing Issues
1533
+
Account Management
1534
+
Product Inquiries
1535
+
Technical Support
1536
+
Shipping and Delivery Issues
1537
+
Promotions and Discounts
1538
+
Marketplace Seller Support
1539
+
Feedback and Complaints
1540
+
1541
+
Provide the output in this JSON structure:
1542
+
1543
+
{
1544
+
"department": "<selected_department>"
1545
+
}
1546
+
Replace <selected_department> with the name of the most relevant department from the list above. If the inquiry spans multiple categories, choose the department that is most likely to address the customer's issue promptly and effectively.`;
| This example demonstrates the use of Together.AI's LLM API to build an AI Agent that classifies customer messages for department routing. TogetherAI provides serverless access to various foundational models, including Llama, Deepseek, Mistral, and more. The hackathon starter live demo leverages the Llama-3.3-70B-Instruct-Turbo-Free model. TogetherAI's REST API is fully compatible with OpenAI's API as well as locally hosted Ollama REST API, offering the flexibility to run a locally hosted LLM instead of relying on remote API calls. Furthermore, the output is requested in JSON format, enabling us to extend the code as an AI Agent to take additional actions for the user, such as querying a tracking number from a database based on the classification.
0 commit comments