Alibaba Cloud has a launched generative AI models which is generally a great step towards advancement of generative AI development. But this is going to face hard competition in the market due to the existence of ChatGPT and Gemini. No matter who wins the race in AI but the aim is common among them to advance generative AI to the extent where AI can take over the tasks making the human life easier.
In this article, I will be testing different scenarios by calling available official API. It supports Python and Java SDKs. However, I will be using Insomnia which is a good tool to test APIs. As per references available on different official resources, it is mentioned that these models are able to generate and process textual creativities. For example, if someone would like to generate a formal email or improve an existing email, these models are able to do that. This is just one small example but there are endless possibilities of creative writing, formal writing, improving or summarizing content.
It is also claimed that these models can help in writing source codes and optimize them. In the market, there is a tool named “Github Copilot” which is not less than a pair programmer. I have personally used Github Copilot and it really helps by auto completing some snippets while you are coding. Now Alibaba also claims that its generative AI models are able to write source code and optimize the existing code. In this article, I will call the API to generate source code for small tools.
These models can also translate the content in various languages. Although tools like Google Translator are already in the market but I have personally found Google Translator useless in various situations. If you are in a formal meeting, maybe you can get the right translation but of course while talking to a street guy, the whole meaning of talk can go in different direction. In such scenario, AI models which are able to translate can really help. If an application is developed which simply gets input from the microphone and gives output on speaker after translation, it can be a great innovation. Don’t get confused with the word innovation, at the time of writing this article, there is no such tool which can really give a real-time predictive and generative translation. But if we achieve this in future, it’s really going to be a great achievement using AI where not just a textual translation, but a real-time communication gap will be covered.
If you have a film story and you need to generate dialogs based on the role in the play, generative AI can help you. You can simply give your story as input , guide the model about different roles and ask it to generate dialogs. The output may not be completely suitable or practical but it will at least generate 50-60% suitable output that can be improved using human involvement. Now let’s proceed towards calling the API using Insomnia.
To call the API, we will need API keys. I will generate keys from my account and you can from your account. As I am using Insomnia, I will have to use request headers to set Content-Type and API key in Authorization.
![My First Experience with Alibaba Cloud Model Studio Artificial Intelligence Models 2 generating keys for Alibaba Cloud Model Studio API Artificial Intelligence Generative AI](https://learncybers.com/wp-content/uploads/2024/07/Screenshot-2024-07-13-at-3.49.48 PM.png)
![My First Experience with Alibaba Cloud Model Studio Artificial Intelligence Models 2 generating keys for Alibaba Cloud Model Studio API Artificial Intelligence Generative AI](https://learncybers.com/wp-content/uploads/2024/07/Screenshot-2024-07-13-at-3.49.48 PM.png)
In the tests, I will be using Qwen Max model. There are also other models like Qwen Turbo, Qwen Plus and other open source models, you can use either based on your choice.
After generating keys, I will have to set DASHSCOPE_API_KEY
in base environment as shown below:
Replace “YOUR_DASHSCOPE_API_KEY” with your Alibaba Cloud Model Studio keys.
Table of Contents
Case 1: Generate Project Management Plan for Ecommerce Website
I have sent prompt using JSON body in the HTTP POST request.
{ "model": "qwen-max", "input": {"prompt": "I have to develop an ecommerce store to sell mobile accessories. I am a freelancer, generate a project managment plan for me to give cost and timeframe estimates."}, "messages": [ {"role": "system", "content": "You are a project manager"}, {"role": "user", "content": "Who are you"} ], "seed": 1234 }
I have used Qwen Max LLM model. The following screenshot shows the sample prompt along with output generated by Qwen Max LLM model.
To create a comprehensive project management plan for developing an e-commerce store to sell mobile accessories, we'll break down the project into key phases. This will help you estimate costs and timeframes more accurately. Please note that these estimates can vary based on your location, team's expertise, and specific project requirements.
1. Project Definition & Planning
Tasks:
-
- Define project scope, goals, and deliverables.
-
- Identify target audience and competitor analysis.
-
- Create a feature list for the website (e.g., product catalog, shopping cart, payment gateway integration, customer accounts, etc.).
-
- Develop a sitemap and wireframes.
-
- Select technology stack (e.g., CMS like Shopify, WooCommerce, or custom development with React/Node.js).
Timeframe: 1-2 weeks Cost Estimate: $500 – $1,500 (depending on research depth and consultations)
2. Design
Tasks:
-
- Visual design creation based on brand guidelines.
-
- Design of homepage, product pages, cart, checkout, and other key pages.
-
- Mobile-responsive design.
Timeframe: 3-4 weeks Cost Estimate: $2,000 – $6,000 (based on designer rates and revisions)
3. Development
Tasks:
-
- Front-end development (HTML/CSS/JavaScript).
-
- Back-end development (if not using a pre-built CMS).
-
- Integration with a payment gateway (e.g., PayPal, Stripe).
-
- Implementation of product catalog, search functionality, and user account features.
-
- Setup of shipping and tax configurations.
-
- Basic SEO setup.
Timeframe: 8-12 weeks Cost Estimate: $8,000 – $24,000 (dependent on complexity and technology used)
4. Content Population & Product Upload
Tasks:
-
- Write and upload product descriptions, images, and specifications.
-
- Populate static pages (About Us, Contact, FAQs, etc.).
-
- Ensure all content is SEO-friendly.
Timeframe: 2-4 weeks Cost Estimate: $1,500 – $4,000 (content writing and data entry)
5. Testing & Quality Assurance
Tasks:
-
- Cross-browser and device testing.
-
- Performance optimization.
-
- Security checks and vulnerability assessments.
-
- Usability testing.
Timeframe: 2-3 weeks Cost Estimate: $2,000 – $5,000 (QA engineers and tools)
6. Deployment & Launch
Tasks:
-
- Server setup and hosting configuration.
-
- Migration to live server.
-
- Final testing in the production environment.
-
- Launch preparation (announcements, email notifications, etc.).
Timeframe: 1-2 weeks Cost Estimate: $500 – $2,000 (hosting, domain, SSL certificate, and launch activities)
7. Post-Launch & Maintenance
Tasks:
-
- Monitor site performance and fix any issues.
-
- Ongoing SEO and marketing strategies.
-
- Software updates and security patches.
-
- Regular backups.
Timeframe: Ongoing Cost Estimate: $500 – $2,000/month (depending on support needs and marketing efforts)
Total Estimated Cost: $15,000 – $50,000+
Total Estimated Timeframe: 4-6 months
Remember, these are rough estimates and actual costs and timelines could vary significantly based on specifics of the project, additional functionalities, and any unforeseen complexities. It’s crucial to have a detailed discussion with your client to set realistic expectations and adjust the plan accordingly.
Case 2: A Function which takes Movie name as input and fetches data from IMDb
I have sent the following prompt in request body to Qwen Max LLM.
{ "model": "qwen-max", "input": {"prompt": "Generate a function in PHP which takes movie name as input parameter and fetches data from imdb"}, "seed": 1234 }
Output:
The output of the prompt is as given below:
To fetch movie data from IMDb using PHP, you can use the IMDb API. One popular API is “OMDb API” (http://www.omdbapi.com/), which is free for non-commercial use. You will need to register for an API key.
Here’s a sample PHP function that fetches movie data using the OMDb API:
function fetchMovieData($movieName, $apiKey) { // Construct the API URL with the movie name and your API key $url = "http://www.omdbapi.com/?t=" . urlencode($movieName) . "&apikey=" . $apiKey; // Initialize cURL session $ch = curl_init(); // Set cURL options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'); // Execute the cURL request $response = curl_exec($ch); // Close cURL session curl_close($ch); // Check if the request was successful and parse the JSON response if ($response !== false) { $data = json_decode($response, true); if ($data['Response'] == 'True') { return $data; } else { return false; } } else { return false; } } // Usage example $apiKey = 'YOUR_API_KEY_HERE'; // Replace with your actual API key $movieName = 'The Shawshank Redemption'; $movieData = fetchMovieData($movieName, $apiKey); if ($movieData) { echo "Title: " . $movieData['Title'] . "\n"; echo "Year: " . $movieData['Year'] . "\n"; echo "IMDb Rating: " . $movieData['imdbRating'] . "\n"; } else { echo "Failed to fetch movie data.\n"; }
Remember to replace 'YOUR_API_KEY_HERE'
with your actual OMDb API key. This function sends a request to the OMDb API with the movie name and API key, retrieves the JSON response, and decodes it into a PHP associative array. If the request is successful, it returns the movie data; otherwise, it returns false
.
Conclusion:
There are endless possibilities of the prompts that can be sent to any LLM model, the results may vary based on the model selection, but you can achieve much in shorter time with the help of these AI models. Overall, Qwen Max is able to give a tough competition to its competitors. The future developments will advance the application of AI resulting in more possibilities and applications.
The APIs of these models are helpful in deploying your own AI based application. If you can design prompts and implement few filters to customize, you can achieve the results more than your expectations.