Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Welcome to Cells AI! This guide will walk you through the basic steps to configure and use the Cells AI library.
Before using Cells AI, ensure you have the following:
To start using Cells AI, you need to set up an AI model. You can either create a new model or use one of the predefined models.
Config.Model = new Model("gpt-4-32k");
Config.Model = Model.Gpt4OMini;
You need to initialize an instance of CellsAI by providing the API root URL and your API key. Alternatively, you can provide the full API URL if needed.
String APIKey = "sk-xxxxx";
String APIRootUrl = "https://api.openai.com/";
CellsAI cellsAI = new CellsAI(APIRootUrl, APIKey);
String APIKey = "sk-xxxxx";
String FullAPIRootUrl = "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions";
CellsAI cellsAI = new CellsAI(FullAPIRootUrl, true, APIKey);
Once you have configured the AI model and created an AI instance, you can use the AI’s capabilities to process spreadsheets files.
// Get summary of the spreadsheet
string summary = cellsAI.SpreadsheetSummarize("c:/student.xlsx");
// Use TextWriter way, Output summary to a TextWriter (Console)
TextWriter writer = Console.Out;
await cellsAI.SpreadsheetSummarize("c:/student.xlsx", writer);
// Ask a question about the spreadsheet
await cellsAI.SpreadsheetQuestion("c:/student.xlsx", "Who is the best student?", writer);
You can create a new spreadsheet based on a specific request. For example, generating a weekly meal plan:
await cellsAI.BuildSpreadsheet("Provide weekly daily three-meal recipes, including nutritional value, preparation methods, ingredients, and cost, one day per row, and add total cost at last row.", null, "c:/foodsweekly.xlsx");
You can also forecast sales based on historical data:
await cellsAI.BuildSpreadsheet("Based on the sales history data from row 3 to row 10, predict the sales situation for the next year. Add it in row 11.", "c:/Sales Report Year.xlsx", "c:/Sales Report Forcast.xlsx");
Or, update student scores with a ranking:
await cellsAI.BuildSpreadsheet("Add a new column named \"Ranking\" and fill in the content of this column based on the students' total scores ranking", "c:\\student_score.xlsx", "c:\\student_score_with_rank.xlsx");
Using AI Model with Localized Requests:
You can use Alibaba’s Qianwen AI model or other localized AI models. Here’s how you can specify a locale:
// Set to use QwenPlus AI model
Config.Model = Model.QwenPlus;
// Set locale info (e.g., Chinese)
Config.Locale = "zh";
// User request in Chinese
string userRequest = "增加新的一列,列名称是\"排名\" 并根据学生的总分大小排名填入这一列的内容";
string outfile = "D:\\学生排行.xlsx";
string inputfile = "D:\\student_score_zh.xlsx";
await cellsAI.BuildSpreadsheet(userRequest, inputfile, outfile);
// Get formula from the spreadsheet
string formula = cellsAI.GetExcelFormula("c:/student.xlsx", "get the total score for Xiaomin");
If you are working behind a proxy, you can configure proxy settings to allow Cells AI to connect to the server.
// Set up proxy for Cells AI
string proxyAddress = "http://127.0.0.1:58591";
WebProxy proxy = new WebProxy(proxyAddress)
{
BypassProxyOnLocal = false,
UseDefaultCredentials = false,
};
// Apply the proxy setting
cellsAI.Proxy = proxy;
Cells AI allows various customizations, such as adjusting the AI model, setting locales, and modifying data outputs. Make sure to explore the API and experiment with different configurations for your specific use case.
Cells AI empowers you to process spreadsheets, automate tasks, and leverage AI for your Excel-based applications.
For further details, refer to the api documentation or the support forum.
Happy coding!
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.