Query2Excel simplifies this entire workflow by harnessing the power of theLyzr SDK. At its core, Query2Excel is aStreamlit application that enables users to inputnatural language queries and receive formattedExcel outputs — all with the click of a button. Leveraging Lyzr SDK’sFormulaGen capabilities, Query2Excel translates user queries into Excel formulas, automating the process ofdata extraction and organization.
How Query2Excel Works?
The user interface of Query2Excel is intuitive and user-friendly. Once the query is submitted, Query2Excel’s backend, powered byLyzr SDK, swings into action. The entered query is processed, parsed, and transformed intoExcel formulas using Lyzr’s **FormulaGen **module. The resulting Excel output is then presented to the user, ready for download or further analysis.
Why use Lyzr SDK’s?
WithLyzr SDKs, crafting your ownGenAI application is a breeze, requiring only a few lines of code to get up and running swiftly.
Lets get Started!
Create a new fileapp.py and use that
import osimport lyzrimport streamlit as stfrom lyzr import FormulaGen
In this script, we’re importing necessary modules to build a Streamlit application integrated withLyzr SDK.Streamlit **provides the framework for the web application, while Lyzr SDK offers capabilities for **natural language processing and data manipulation. TheFormulaGen module from Lyzr likely facilitates formula generation based on user inputs, enabling streamlineddata analysis and interaction.
Next Set UpOpenAI API Key and using Streamlit’s secrets management, set up the OpenAI API key within your Streamlit application. Replace "OPENAI_API_KEY" with the actual key name defined in your Streamlit secrets where your OpenAI API key is stored.
openai.api_key = st.secrets["OPENAI_API_KEY"]
This step secures theAPI key within your application, ensuring its confidentiality and proper usage.
generate = FormulaGen()# Define the Streamlit appdef main(): # Input field for natural language query query = st.text_input("Enter your natural language query :") # Generate formulas button if st.button("Generate"): if query: # Generate formulas based on the query result = generate.spreadsheets(query) st.write("Results:") st.write(result) else: st.write("Please enter a query.")
The application initializes aFormulaGen object fromLyzr SDK, enabling the generation offormulas. Within the Streamlit app's main function, users are prompted to input anatural language query via a text input field. Upon clicking the 'Generate' button, the application checks if a query has been provided.
If so, it calls thespreadsheets method of the FormulaGen object to retrieve formulas based on the query. The resulting formulas are then displayed as output. If no query is entered, the application prompts the user to provide one before proceeding with the generation process.
By leveragingLyzr SDK’s capabilities, the application abstracts away the complexity of formula generation, allowing users to focus on theirdata analysis tasks without getting bogged down in technical details. This user-friendly design fosters accessibility and empowers users of all skill levels to harness the power of natural language processing for their data management needs.
Try out the Application:Query2Excel
Youtube Link:https://youtu.be/tVltzm2Gmas
References
Lyzr Website:Lyzr
Book a Demo:Demo
Lyzr Community Channels:Discord
Slack :Slack
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse