<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Akshay Keerthi</title>
    <description>The latest articles on Forem by Akshay Keerthi (@akshay007).</description>
    <link>https://forem.com/akshay007</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1351448%2F05dacfd5-51d5-44dd-9a82-a4c2e20757f7.png</url>
      <title>Forem: Akshay Keerthi</title>
      <link>https://forem.com/akshay007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/akshay007"/>
    <language>en</language>
    <item>
      <title>Building a Natural Language to Java Generator using Lyzr Agent-Api</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Wed, 21 Aug 2024 17:56:21 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-natural-language-to-java-generator-using-lyzr-agent-api-1gad</link>
      <guid>https://forem.com/akshay007/building-a-natural-language-to-java-generator-using-lyzr-agent-api-1gad</guid>
      <description>&lt;p&gt;In today’s rapidly evolving tech landscape, developers are always on the lookout for tools that can simplify and speed up their coding process.&lt;/p&gt;

&lt;p&gt;The Java Generator is one such innovative application that leverages the power of natural language processing, combined with the &lt;strong&gt;Lyzr Agent-API&lt;/strong&gt;, to convert everyday language into Java code. Whether you’re a beginner or an expert, this tool makes coding more accessible than ever.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnyob1udce5ezc62qt5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnyob1udce5ezc62qt5a.png" alt="Image description" width="284" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Java Generator&lt;/strong&gt; is designed to take user input in plain English and output accurate Java code. This application is built using Streamlit for the user interface and Lyzr Agent-API for natural language processing and code generation. Let’s walk through how this application works and explore the key components that make it tick.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lets get started : Step-by-Step Explanation&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Setting Up the Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application starts by importing the necessary libraries and loading the API keys from environment variables. Here’s the relevant snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from lyzr_agent import LyzrAgent
import streamlit as st
from dotenv import load_dotenv

load_dotenv()
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
LYZR_API_KEY = os.getenv("LYZR_API_KEY")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup ensures that your &lt;strong&gt;API keys&lt;/strong&gt; are securely stored and easily accessible when needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initializing the LyzrAgent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The core functionality of the app lies in the &lt;strong&gt;LyzrAgent class&lt;/strong&gt;, which interacts with the Lyzr Agent-API. The agent is initialized with the API keys and then configured to create a new environment for generating Java code based on natural language input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Agent = LyzrAgent(
    api_key=LYZR_API_KEY,
    llm_api_key=OPENAI_API_KEY
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This initialization is crucial as it sets the stage for the interaction between user inputs and the &lt;strong&gt;Lyzr API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating the Agent and Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;create_agent&lt;/strong&gt; function is where the magic happens. This function sets up an environment with specific features and tools, such as perplexity_search, which is used to find and synthesize relevant Java code based on the user’s input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@st.cache_resource
def create_agent():
    env_id = Agent.create_environment(
        name="Post_java",
        features=[{
            "type": "TOOL_CALLING",
            "config": {"max_tries": 3},
            "priority": 0
        }],
        tools=["perplexity_search"]
    )

    agent_id = Agent.create_agent(
        env_id=env_id['env_id'],
        system_prompt=prompt,
        name="shell"
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function sets up the environment where the agent will operate, including the tools it will use to generate the &lt;strong&gt;Java code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Input and Code Generation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The user interface allows the user to input their desired functionality in plain English. When the “Generate!” button is clicked, the input is sent to the &lt;strong&gt;Lyzr agent&lt;/strong&gt;, which processes the input and returns the corresponding Java code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query = st.text_area("Give your input in natural language below.")

if st.button("Generate!"):
    agent = create_agent()
    chat = Agent.send_message(
        agent_id=agent['agent_id'],
        user_id="default_user",
        session_id="akshay@lyzr.ai",
        message=query
    )

    st.markdown(chat['response'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code handles the interaction between the user and the agent, ensuring that the natural language input is accurately converted into &lt;strong&gt;Java code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Java Generator application demonstrates the incredible potential of natural language processing when combined with powerful APIs like &lt;strong&gt;Lyzr Agent-API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By breaking down the barriers between &lt;strong&gt;natural language&lt;/strong&gt; and code, this tool makes coding more intuitive and accessible for developers of all skill levels. Whether you’re looking to quickly prototype an idea or generate production-ready code, the &lt;strong&gt;Java Generator&lt;/strong&gt; has you covered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://lyzr-java.streamlit.app/" rel="noopener noreferrer"&gt;https://lyzr-java.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/java" rel="noopener noreferrer"&gt;https://github.com/isakshay007/java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nlp</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Building a Home Décor Style Assistant using Lyzr Agent-API</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 20 Aug 2024 17:47:05 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-home-decor-style-assistant-using-lyzr-agent-api-16f2</link>
      <guid>https://forem.com/akshay007/building-a-home-decor-style-assistant-using-lyzr-agent-api-16f2</guid>
      <description>&lt;p&gt;Creating a personalized &lt;strong&gt;home décor style assistant&lt;/strong&gt; can help users find the perfect style, products, and budget-friendly solutions for their spaces. In this blog post, we’ll walk through building a Home Décor Style Assistant using the Lyzr and Streamlit. This application will allow users to input their style preferences, room types, budget, and other specifics to receive tailored décor suggestions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxt0v2jcpq9b986w6vowf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxt0v2jcpq9b986w6vowf.jpg" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving in, make sure you have the following:&lt;/p&gt;

&lt;p&gt;-Python 3.8 or higher installed.&lt;br&gt;
-Lyzr SDK installed.&lt;br&gt;
-Streamlit installed.&lt;br&gt;
-A .env file containing your OPENAI_API_KEY and LYZR_API_KEY.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;lyzr_agent.py: Interacting with the Lyzr API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The lyzr_agent.py file defines the LyzrAgent class, which serves as an interface to interact with the Lyzr API. This class provides methods to create environments, agents, and handle communication with the Lyzr platform.&lt;/p&gt;

&lt;p&gt;Here’s a breakdown of the key components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import json
class LyzrAgent:
    def __init__(self, api_key, llm_api_key):
        self.url = "https://agent.api.lyzr.app/v2/"
        self.headers = {
            "accept": "application/json",
            "x-api-key": api_key
        }
        self.llm_api_key = llm_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Initialization&lt;/strong&gt;&lt;strong&gt;:&lt;/strong&gt; The constructor (&lt;strong&gt;init&lt;/strong&gt;) initializes the API endpoint URL, the headers for API requests (including the Lyzr API key), and stores the OpenAI API key for later use.&lt;br&gt;
&lt;strong&gt;Creating an Environment&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def create_environment(self, name, features, tools):
    payload = json.dumps({
        "name": name,
        "features": features,
        "tools": tools,
        "llm_api_key": self.llm_api_key
    })
url = self.url + "environment"
    response = requests.post(url, headers=self.headers, data=payload)
    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code} - {response.text}")
        return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;create_environment&lt;/strong&gt;: This method creates a new environment within the Lyzr platform. It requires a name, a list of features, and tools. The environment is essential for setting up an agent that will handle specific tasks, like conducting searches or providing responses.&lt;br&gt;
&lt;strong&gt;Creating an Agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def create_agent(self, env_id, system_prompt, name):
    payload = json.dumps({
        "env_id": env_id,
        "system_prompt": system_prompt,
        "name": name,
        "agent_persona": "",
        "agent_instructions": "",
        "agent_description": ""
    })
url = self.url + "agent"
    response = requests.post(url, headers=self.headers, data=payload)
    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code} - {response.text}")
        return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;create_agent&lt;/strong&gt;: After creating an environment, we need an agent to perform tasks within that environment. This method sets up an agent with a specific prompt and name, which determines how it interacts with user inputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sending a Message to the Agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def send_message(self, agent_id, user_id, session_id, message):
    payload = json.dumps({
        "user_id": user_id,
        "agent_id": agent_id,
        "session_id": session_id,
        "message": message
    })
url = self.url + "chat/"
    response = requests.post(url, headers=self.headers, data=payload)
    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code} - {response.text}")
        return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;send_message&lt;/strong&gt;: This method allows us to send a message to the agent, which processes the user’s input and returns a response. The response will be used to generate the personalized décor suggestions.&lt;br&gt;
&lt;strong&gt;Creating a Task&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def create_task(self, agent_id, session_id, input_message):
    payload = json.dumps({
        "agent_id": agent_id,
        "session_id": session_id,
        "input": input_message
    })
url = self.url + "task"
    response = requests.post(url, headers=self.headers, data=payload)
    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code} - {response.text}")
        return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;create_task&lt;/strong&gt;: This method can be used to create specific tasks for the agent, such as conducting a detailed analysis or performing a complex operation based on user input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;app.py: Building the Streamlit Interface&lt;/strong&gt;&lt;br&gt;
The app.py file is where the magic happens. Here, we create a user interface with Streamlit, capture user inputs, and interact with the LyzrAgent to generate and display personalized home décor suggestions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Streamlit Page&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from lyzr_agent import LyzrAgent
import streamlit as st
from dotenv import load_dotenv

load_dotenv()
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
LYZR_API_KEY = os.getenv("LYZR_API_KEY")
st.set_page_config(
    page_title="Lyzr Home Décor Style",
    layout="centered",  # or "wide"
    initial_sidebar_state="auto",
    page_icon="lyzr-logo-cut.png",
)
st.title("Home Décor Style Assistant🏠")
st.markdown("### Welcome to the Home Décor Style Assistant!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Streamlit Setup&lt;/strong&gt;: We start by importing necessary libraries, loading environment variables, and configuring the Streamlit page with a title, layout, and icon. This sets the stage for our user-friendly interface.&lt;br&gt;
&lt;strong&gt;Initializing the LyzrAgent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent = LyzrAgent(
    api_key=LYZR_API_KEY,
    llm_api_key=OPENAI_API_KEY
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;LyzrAgent Initialization&lt;/strong&gt;: We create an instance of the LyzrAgent class, passing in our API keys. This agent will handle all backend interactions with the Lyzr platform.&lt;br&gt;
&lt;strong&gt;Creating the Agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@st.cache_resource
def create_agent():
    env_id = Agent.create_environment(
        name="Post_home",
        features=[{
            "type": "TOOL_CALLING",
            "config": {"max_tries": 3},
            "priority": 0
        }],
        tools=["perplexity_search"]
    )
    print(env_id)
prompt = """
[prompts here]
    """
    agent_id = Agent.create_agent(
        env_id=env_id['env_id'],
        system_prompt=prompt,
        name="home"
    )
    print(agent_id)
    return agent_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;create_agent Function&lt;/strong&gt;: This function sets up the environment and agent with specific instructions on how to handle user inputs. The system_prompt guides the agent in its interactions, ensuring it delivers relevant and accurate home décor suggestions.&lt;br&gt;
&lt;strong&gt;Handling User Input&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query = st.text_area("Give your style preference, room type, budget, space dimensions, and other specifics like brand preference etc.")
if st.button("Assist!"):
    agent = create_agent()
    print(agent)
    chat = Agent.send_message(
        agent_id=agent['agent_id'],
        user_id="default_user",
        session_id="akshay@lyzr.ai",
        message=query
    )
    st.markdown(chat['response'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;User Interaction&lt;/strong&gt;: We use Streamlit’s text_area to capture the user's décor preferences and specifics. When the "Assist!" button is clicked, the input is processed by the agent, and the resulting advice is displayed on the page.&lt;/p&gt;

&lt;p&gt;By combining the power of Lyzr and Streamlit, we’ve created a responsive and intelligent &lt;strong&gt;Home Décor Style Assistant&lt;/strong&gt;. This tool not only simplifies the process of home styling but also provides personalized, data-driven suggestions that cater to individual preferences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://homestyle-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://homestyle-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/home_style" rel="noopener noreferrer"&gt;https://github.com/isakshay007/home_style&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>api</category>
      <category>github</category>
    </item>
    <item>
      <title>Building a LinkedIn Post Generator using Lyzr Agent-API</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 20 Aug 2024 17:35:58 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-linkedin-post-generator-using-lyzr-agent-api-1bfj</link>
      <guid>https://forem.com/akshay007/building-a-linkedin-post-generator-using-lyzr-agent-api-1bfj</guid>
      <description>&lt;p&gt;In this Blog, we’ll walk through building a &lt;strong&gt;LinkedIn Post Generator&lt;/strong&gt; using the Lyzr SDK, Streamlit for the front-end interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9hb8on6v6hq0vqe8pry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9hb8on6v6hq0vqe8pry.png" alt="Image description" width="396" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This application will allow users to create and publish LinkedIn posts seamlessly by entering their &lt;strong&gt;text content&lt;/strong&gt; and &lt;strong&gt;image URL&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;We’ll utilize LyzrAgent to interact with &lt;strong&gt;Lyzr’s API&lt;/strong&gt; and harness the power of AI for automating content generation and posting on LinkedIn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into the code, ensure you have the following:&lt;/p&gt;

&lt;p&gt;-Python 3.8 or higher installed.&lt;br&gt;
-Lyzr SDK installed.&lt;br&gt;
-Streamlit installed.&lt;br&gt;
-An OpenAI API key and Lyzr API key.&lt;br&gt;
-A .env file containing your API keys (OPENAI_API_KEY and LYZR_API_KEY).&lt;/p&gt;

&lt;p&gt;Setting Up the &lt;strong&gt;Environment&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;First, let’s set up our environment by loading the necessary libraries and &lt;strong&gt;API keys&lt;/strong&gt;. We’ll create a .env file to securely store our API keys and use the &lt;strong&gt;dotenv library&lt;/strong&gt; to load them into our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from lyzr_agent import LyzrAgent
import streamlit as st
from dotenv import load_dotenv
load_dotenv()
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
LYZR_API_KEY = os.getenv("LYZR_API_KEY")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating the &lt;strong&gt;LyzrAgent&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;The core of our application is the &lt;strong&gt;LyzrAgent&lt;/strong&gt;, which will be responsible for creating environments, agents, and handling user inputs to generate and post content on LinkedIn.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent = LyzrAgent(
        api_key=LYZR_API_KEY,
        llm_api_key=OPENAI_API_KEY
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Building the &lt;strong&gt;Agent Environment&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;We define a function create_agent() to set up the agent's environment. This environment is configured to use the &lt;strong&gt;TOOL_CALLING&lt;/strong&gt; feature and will be equipped with a specific tool for posting images and text to &lt;strong&gt;LinkedIn&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@st.cache_resource
def create_agent():
    env_id = Agent.create_environment(
        name="Post_linkedin",
        features=[{
            "type": "TOOL_CALLING",
            "config": {"max_tries": 3},
            "priority": 0
        }],
        tools=["post_image_and_text_linkedin"]
    )
    print(env_id)
prompt = """
    You are an Expert Linkedin Post Creator. Your task is to compose and publish a LinkedIn post using the user provided Title, Image Url , and Text Content. You must follow these guidelines meticulously:
[prompts here]
    agent_id = Agent.create_agent(
        env_id=env_id['env_id'],
        system_prompt=prompt,
        name="Linkedin"
    )
    print(agent_id)
    return agent_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Handling &lt;strong&gt;User Input&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;We then use Streamlit’s text_area function to capture the user's input, including the post content and image URL. Upon clicking the "Generate" button, the app calls &lt;strong&gt;create_agent()&lt;/strong&gt; to create an agent and uses the send_message function to generate the LinkedIn post.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query = st.text_area("Give the textual context of the post and the relevant image url.")
if st.button("Generate"):
    agent = create_agent()
    print(agent)
    chat = Agent.send_message(
        agent_id=agent['agent_id'],
        user_id="default_user",
        session_id="akshay@lyzr.ai",
        message=query
    )
    st.markdown(chat['response'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Defining the &lt;strong&gt;LyzrAgent Class&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Finally, we define the LyzrAgent class in &lt;strong&gt;lyzr_agent.py&lt;/strong&gt;. This class handles all interactions with the Lyzr API, including creating environments, agents, and sending messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import json
class LyzrAgent:
    def __init__(self, api_key, llm_api_key):
        self.url = "https://agent.api.lyzr.app/v2/"
        self.headers = {
            "accept": "application/json",
            "x-api-key": api_key
        }
        self.llm_api_key = llm_api_key
    def create_environment(self, name, features, tools):
        payload = json.dumps({
            "name": name,
            "features": features,
            "tools": tools,
            "llm_api_key": self.llm_api_key
        })
        url = self.url + "environment"
        response = requests.post(url, headers=self.headers, data=payload)
        if response.status_code == 200:
            return response.json()
        else:
            print(f"Error: {response.status_code} - {response.text}")
            return None
    def create_agent(self, env_id, system_prompt, name):
        payload = json.dumps({
            "env_id": env_id,
            "system_prompt": system_prompt,
            "name": name,
            "agent_persona": "",
            "agent_instructions": "",
            "agent_description": ""
        })
        url = self.url + "agent"
        response = requests.post(url, headers=self.headers, data=payload)
        if response.status_code == 200:
            return response.json()
        else:
            print(f"Error: {response.status_code} - {response.text}")
            return None
    def send_message(self, agent_id, user_id, session_id, message):
        payload = json.dumps({
            "user_id": user_id,
            "agent_id": agent_id,
            "session_id": session_id,
            "message": message
        })
        url = self.url + "chat/"
        response = requests.post(url, headers=self.headers, data=payload)
        if response.status_code == 200:
            return response.json()
        else:
            print(f"Error: {response.status_code} - {response.text}")
            return None
    def create_task(self, agent_id, session_id, input_message):
        payload = json.dumps({
            "agent_id": agent_id,
            "session_id": session_id,
            "input": input_message
        })
        url = self.url + "task"
        response = requests.post(url, headers=self.headers, data=payload)
        if response.status_code == 200:
            return response.json()
        else:
            print(f"Error: {response.status_code} - {response.text}")
            return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this setup, you’ve built a simple yet powerful LinkedIn Post Generator using &lt;strong&gt;Lyzr&lt;/strong&gt; and &lt;strong&gt;Streamlit&lt;/strong&gt;. The application takes user input, leverages the power of GPT-4 Turbo, and automates the process of creating and publishing LinkedIn posts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://linkedinpost-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://linkedinpost-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/Linkedin_Post" rel="noopener noreferrer"&gt;https://github.com/isakshay007/Linkedin_Post&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a Financial Literacy Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 20 Aug 2024 17:30:43 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-financial-literacy-assistant-using-lyzr-sdk-2dhg</link>
      <guid>https://forem.com/akshay007/building-a-financial-literacy-assistant-using-lyzr-sdk-2dhg</guid>
      <description>&lt;p&gt;In today’s digital world, &lt;strong&gt;financial literacy&lt;/strong&gt; is more important than ever. Whether you’re managing your own budget or helping others navigate their finances, having the right tools to simplify complex financial concepts can make all the difference. That’s where our Financial Literacy Assistant comes in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkr3i38w2bzlg05wyk3r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkr3i38w2bzlg05wyk3r.jpg" alt="Image description" width="281" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This blog post will guide you through building a simple yet powerful Financial Literacy Assistant using &lt;strong&gt;Streamlit&lt;/strong&gt; and &lt;strong&gt;Lyzr Automata&lt;/strong&gt;. By the end of this tutorial, you’ll have a fully functional app that leverages the power of AI to help users understand personal finance better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into the code, ensure you have the following:&lt;/p&gt;

&lt;p&gt;-Python installed on your machine.&lt;br&gt;
-An OpenAI API key.&lt;br&gt;
-Basic knowledge of Python and Streamlit.&lt;br&gt;
-An understanding of how Lyzr Automata works (if not, check out their documentation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, let’s start by importing the necessary libraries and setting up the environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we import Streamlit for creating the app's interface, OpenAIModel from Lyzr &lt;strong&gt;Automata&lt;/strong&gt; to interact with GPT, and other essential modules for building the task pipeline.&lt;/p&gt;

&lt;p&gt;Next, set up your &lt;strong&gt;OpenAI API key&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Set the OpenAI API key
os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
This ensures that your API key is securely stored and accessible when making API requests.

Implementing the AI Model

Next, we configure the OpenAI model, which will generate responses based on user input:

open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We create a function called &lt;strong&gt;generation()&lt;/strong&gt; that utilizes Lyzr Automata to generate responses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert FINANCIAL ADVISOR",
        prompt_persona=f"Your task is to EXPLAIN and EDUCATE users on PERSONAL FINANCE topics or questions. You MUST make the response as UNDERSTANDABLE and INFORMATIVE as possible, directly addressing the questions the user asks.")

    prompt = f"""
    You are an Expert FINANCIAL ADVISOR. Your task is to EXPLAIN and EDUCATE users on PERSONAL FINANCE topics or questions. You MUST make the response as UNDERSTANDABLE and INFORMATIVE as possible, directly addressing the questions the user asks.
    [prompts here]
    """
generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function sets up an &lt;strong&gt;agent&lt;/strong&gt; with a specific role (Expert Financial Advisor) and instructions on how to generate the response.&lt;/p&gt;

&lt;p&gt;Finally, we add a button that triggers the AI to generate a response when clicked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With just a few lines of code, we’ve created a Financial Literacy Assistant that can help users better understand and manage their finances. By leveraging the power of AI through &lt;strong&gt;Lyzr Automata&lt;/strong&gt; and Streamlit, we’ve built an accessible and user-friendly tool that can make financial literacy more attainable for everyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://financeassistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://financeassistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/financial_advisor" rel="noopener noreferrer"&gt;https://github.com/isakshay007/financial_advisor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Building a Public speaking Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 18:23:01 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-public-speaking-assistant-using-lyzr-sdk-4aeb</link>
      <guid>https://forem.com/akshay007/building-a-public-speaking-assistant-using-lyzr-sdk-4aeb</guid>
      <description>&lt;p&gt;Public speaking can be daunting, but with the right preparation and practice, anyone can become a confident and engaging speaker. Our Public Speaking Assistant app, developed using Lyzr Automata SDK and OpenAI’s GPT-4 Turbo, provides &lt;strong&gt;personalized exercises&lt;/strong&gt; tailored to your audience and speech type. This blog post will walk you through how we built this app to help you shine on stage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgw6georzvlqtzee2oo6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgw6georzvlqtzee2oo6y.png" alt="Image description" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use Lyzr SDK’s?&lt;/strong&gt;&lt;br&gt;
With &lt;strong&gt;Lyzr SDKs&lt;/strong&gt;, crafting your own GenAI application is a breeze, requiring only a few lines of code to get up and running swiftly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lets get Started!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To begin, we import the necessary libraries and set up our environment, including configuring the OpenAI API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set the OpenAI API key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating the App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We then set the app’s title and provide a brief introduction to guide users on the information they need to input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App title and introduction&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Public Speaking Assistant")
st.markdown("Welcome to Tailored Public Speaking Exercises! Just tell us about your audience and the type of speech you're preparing for, and we'll give you custom drills to help you shine.")
st.markdown("1) Mention your audience type.")
st.markdown("2) Mention the type of speech you're preparing for.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Initializing the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters for text completion. This model will generate personalized public speaking exercises.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The generation function uses the OpenAI model to generate personalized public speaking exercises based on user input. It defines the agent's role and prompt for the task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert PUBLIC SPEAKING ASSISTANT",
        prompt_persona="Your task is to ANALYZE the user's AUDIENCE and the TYPE of speech they are preparing for, and provide them with PERSONALIZED public speaking drills.")
    prompt = """
[Prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Adding the Assist Button&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of personalized exercises when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Public Speaking Assistant&lt;/strong&gt; app helps users enhance their public speaking skills by providing personalized exercises based on their audience and speech type. Leveraging the power of Lyzr Automata SDK and OpenAI’s GPT-4 Turbo, this app offers a practical solution for anyone looking to improve their public speaking abilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://speakingassistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://speakingassistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/speaking_assistant" rel="noopener noreferrer"&gt;https://github.com/isakshay007/speaking_assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try building your own version of the &lt;strong&gt;Public Speaking Assistant&lt;/strong&gt; app and experience the benefits of AI-driven personalized exercises! If you have any questions or need further assistance, feel free to contact Lyzr.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a To-Do List Generator using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 18:10:23 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-to-do-list-generator-using-lyzr-sdk-nge</link>
      <guid>https://forem.com/akshay007/building-a-to-do-list-generator-using-lyzr-sdk-nge</guid>
      <description>&lt;p&gt;Organizing your tasks effectively can significantly boost productivity and reduce stress. To help users achieve this, I created a &lt;strong&gt;To-Do List Generator&lt;/strong&gt; app using Lyzr Automata SDK and OpenAI’s GPT-4 Turbo. This app takes your project name, subtasks, and any additional notes to generate a clear and actionable to-do list. Here’s a step-by-step guide to building this helpful app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tryd7i6gjo3ev4viz7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tryd7i6gjo3ev4viz7l.png" alt="Image description" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, we need to import the required libraries and set up the environment, including the OpenAI API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set the OpenAI API key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating the App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We then set the title and provide a brief introduction to guide users on what information they need to input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("To-Do List Generator📝")
st.markdown("Welcome! Effortlessly organize your tasks with our intuitive to-do list generator. Simply provide the main project name and a few subtasks, and we'll create a clear and actionable list for you.")
st.markdown("1) Mention your Task Name.")
st.markdown("2) Mention your Subtasks.")
st.markdown("3) Mention any additional notes or comments.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Initializing the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters for text completion. This model will generate the to-do list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The generation function uses the OpenAI model to generate a comprehensive to-do list based on user input. The function defines the agent's role and prompt for the task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert TO-DO LIST ORGANIZER",
        prompt_persona="Your task is to CREATE a COMPREHENSIVE to-do list based on the DETAILS provided by the user, including TASK NAME, SUBTASKS, and any additional NOTES.")
    prompt = """
[Prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Adding the Generate Button&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of the to-do list when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Generate!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The To-Do List Generator app helps users create organized and actionable to-do lists by analyzing their task names, subtasks, and additional notes. Leveraging the power of Lyzr Automata SDK and OpenAI’s GPT-4 Turbo, this app provides a practical solution for efficient task management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://to-dogenerator-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://to-dogenerator-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/To-do_Generator" rel="noopener noreferrer"&gt;https://github.com/isakshay007/To-do_Generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try building your own version of the To-Do List Generator app and experience the benefits of AI-driven task organization! If you have any questions or need further assistance, feel free to contact Lyzr.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building a Cybersecurity Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 18:06:59 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-cybersecurity-assistant-using-lyzr-sdk-47f9</link>
      <guid>https://forem.com/akshay007/building-a-cybersecurity-assistant-using-lyzr-sdk-47f9</guid>
      <description>&lt;p&gt;In today’s digital age, &lt;strong&gt;cybersecurity&lt;/strong&gt; is paramount. To help individuals safeguard their online activities and devices, I developed a Cybersecurity Assistant app using Lyzr Automata SDK and OpenAI’s GPT-4 Turbo. This blog post walks you through the creation of this app, which provides personalized cybersecurity tips and a custom security checklist based on user input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnse96oipo6roi6lt272.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnse96oipo6roi6lt272.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use Lyzr SDK’s?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Lyzr SDKs&lt;/strong&gt;, crafting your own GenAI application is a breeze, requiring only a few lines of code to get up and running swiftly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lets get Started!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To start, we need to import the necessary libraries and set up the environment, including the OpenAI API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set the OpenAI API key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating the App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We then set the title and provide a brief introduction to guide the users on what information they need to input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Cybersecurity Assistant")
st.markdown("Welcome to Cybersecurity Assistant, your personalized cybersecurity advisor. Simply input your online activities and your device specification, and receive tailored tips to keep your digital life secure and protected.")
st.markdown("1) Mention your online activities (websites visited, download habits, device and network usage etc).")
st.markdown("2) Mention your device specifications.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Initializing the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters for text completion. This model will generate the personalized cybersecurity advice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The generation function uses the OpenAI model to generate personalized cybersecurity tips and a custom security checklist based on user input. The function defines the agent's role and prompt for the task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert CYBERSECURITY CONSULTANT",
        prompt_persona="Your task is to DEVELOP Personalized Security Tips and CREATE a Custom Security Checklist tailored to an individual's online activities and device specifications.")
    prompt = """
[Prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Adding the Assist Button&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Cybersecurity Assistant&lt;/strong&gt; app helps users receive personalized cybersecurity advice by analyzing their online activities and device specifications. By leveraging the power of Lyzr Automata SDK and OpenAI’s GPT-4 Turbo, this app provides practical and actionable security tips to keep users’ digital lives secure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://cybersecurityassistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://cybersecurityassistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/cybersecurity_assistant" rel="noopener noreferrer"&gt;https://github.com/isakshay007/cybersecurity_assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to try building your own version of the Cybersecurity Assistant app and explore the potential of AI-driven cybersecurity solutions! If you have any questions or need further assistance, don’t hesitate to contact Lyzr.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>programming</category>
      <category>security</category>
    </item>
    <item>
      <title>Building a Personalized Freelance Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 18:03:27 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-personalized-freelance-assistant-using-lyzr-sdk-4cnc</link>
      <guid>https://forem.com/akshay007/building-a-personalized-freelance-assistant-using-lyzr-sdk-4cnc</guid>
      <description>&lt;p&gt;Freelancing offers a world of opportunities and flexibility, but it also comes with its own set of challenges. The &lt;strong&gt;Personalized Freelance Assistant&lt;/strong&gt; app aims to provide tailored tips and strategies to help freelancers succeed in their careers. Leveraging the Lyzr Automata SDK and OpenAI’s GPT-4 Turbo, this app creates customized plans based on user input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jzs1p59ods4u5ilgr3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jzs1p59ods4u5ilgr3n.png" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, we need to import the necessary libraries and set up our environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting the OpenAI API Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to set the OpenAI API key to access the GPT-4 Turbo model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, we set the title of our app and provide a brief introduction to guide users on how to use the Personalized Freelance Assistant.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Freelance Assistant")
st.markdown("Welcome to Freelance Assistant, your personalized freelancing guide. Enter your career details and goals for customized tips and strategies to enhance your freelance journey.")
st.markdown("1) Mention your field of expertise.")
st.markdown("2) Mention your experience level.")
st.markdown("3) Mention your income goals.")
st.markdown("4) Mention your preferred work-life balance.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting Up the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters to generate personalized freelancing advice based on user input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function uses the Lyzr Automata SDK to create an agent that provides personalized freelancing advice based on the user’s input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert FREELANCING CONSULTANT",
        prompt_persona=f"Your task is to OFFER personalized freelancing tips and strategic advice that aligns with the user's specific details.")
    prompt = f"""
[prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Button to Generate Freelancing Advice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of personalized freelancing tips and strategies when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Freelance Assistant&lt;/strong&gt; app is designed to provide personalized tips and strategies to help freelancers enhance their careers. By leveraging the power of Lyzr Automata and OpenAI’s GPT-4 Turbo, users can receive expert advice tailored to their specific career details and goals. Explore the Freelance Assistant today and take your freelancing journey to the next level!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://freelanceassistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://freelanceassistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/freelance_assistant" rel="noopener noreferrer"&gt;https://github.com/isakshay007/freelance_assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>python</category>
      <category>programming</category>
      <category>coding</category>
    </item>
    <item>
      <title>Building a Personalized Gift Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 17:57:51 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-personalized-gift-assistant-using-lyzr-sdk-88e</link>
      <guid>https://forem.com/akshay007/building-a-personalized-gift-assistant-using-lyzr-sdk-88e</guid>
      <description>&lt;p&gt;Finding the &lt;strong&gt;perfect gift&lt;/strong&gt; can be challenging, especially when considering the recipient’s unique interests, the occasion, and your budget. The &lt;strong&gt;Personalized Gift Assistant&lt;/strong&gt; app is here to make this process easier and more enjoyable. Leveraging the power of Lyzr Automata and OpenAI’s GPT-4 Turbo, this app helps you curate personalized gift recommendations that are sure to delight any recipient.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofzql7magbnciiacgg9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofzql7magbnciiacgg9w.png" alt="Image description" width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, let’s import the necessary libraries and set up our environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting the OpenAI API Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to set the OpenAI API key to access the GPT-4 Turbo model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We set the title of our app and provide a brief introduction to guide users on how to use the Personalized Gift Assistant.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Personalized Gift Assistant")
st.markdown("Welcome to Personalized Gift Assistant! Let us help you find the perfect gift for any occasion, tailored to your recipient's unique interests and your budget.")
st.markdown("1) Mention your receiver's age.")
st.markdown("2) Mention your receiver's interest.")
st.markdown("3) Mention the occasion.")
st.markdown("4) Mention your budget.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting Up the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters to generate personalized gift recommendations based on user input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function uses the Lyzr Automata SDK to create an agent that provides personalized gift recommendations based on the user’s input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert GIFT CONSULTANT",
        prompt_persona="Your task is to CURATE a personalized list of 5-7 GIFTS for the user and provide EXPLANATIONS for each choice, taking into account the RECEIVER'S AGE, RECEIVER'S INTERESTS, the OCCASION, and the BUDGET.")
    prompt = """
[Prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Button to Generate Gift Recommendations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of personalized gift recommendations when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Personalized Gift Assistant&lt;/strong&gt; is designed to help you find the perfect gift for any occasion. By leveraging the power of Lyzr Automata and OpenAI’s GPT-4 Turbo, you can receive expert recommendations tailored to the recipient’s age, interests, occasion, and your budget. Explore the Personalized Gift Assistant today and make gift-giving a delightful experience!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://giftassistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://giftassistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/gift_assistant" rel="noopener noreferrer"&gt;https://github.com/isakshay007/gift_assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For any inquiries or support, feel free to contact &lt;strong&gt;Lyzr&lt;/strong&gt;. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>ai</category>
      <category>programming</category>
      <category>python</category>
    </item>
    <item>
      <title>Building a Productivity Assistant using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 17:51:29 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-productivity-assistant-using-lyzr-sdk-995</link>
      <guid>https://forem.com/akshay007/building-a-productivity-assistant-using-lyzr-sdk-995</guid>
      <description>&lt;p&gt;In our fast-paced world, staying productive can often be challenging. With numerous tasks to juggle and goals to achieve, finding the right balance can be overwhelming. Enter the Productivity Assistant, an innovative app designed to provide personalized tips and actionable advice tailored to your specific needs. Powered by &lt;strong&gt;Lyzr Automata&lt;/strong&gt; and OpenAI’s GPT-4 Turbo, this app is here to help you overcome productivity challenges and achieve your goals efficiently. Let’s delve into how this app works and how you can make the most of it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n96djuizhzwfy50z855.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n96djuizhzwfy50z855.png" alt="Image description" width="800" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use the Productivity Assistant?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Productivity Assistant&lt;/strong&gt; is designed to analyze your daily routine, identify productivity challenges, and provide customized recommendations to help you achieve your short-term and long-term goals. Whether you’re struggling with time management, motivation, or prioritization, this app offers practical advice that you can implement immediately to enhance your productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get started, we set up our environment using Streamlit and the &lt;strong&gt;Lyzr Automata SDK&lt;/strong&gt;. Streamlit is a powerful framework for creating interactive web applications in Python, while Lyzr Automata provides tools for leveraging advanced AI models.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting the OpenAI API Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To access the GPT-4 Turbo model, we need to set the &lt;strong&gt;OpenAI API key&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We begin by setting the title of our app and providing a brief introduction to guide users on how to use the &lt;strong&gt;Productivity Assistant&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Productivity Assistant👨‍💻")
st.markdown("Welcome to Productivity Assistant! We provide personalized tips and actionable advice to help you overcome challenges and achieve your specific goals efficiently.")
st.markdown("1) Mention your daily routine.")
st.markdown("2) Mention the productivity challenges you face.")
st.markdown("3) Mention your goals (Short Term or Long Term) or any other milestones you want to achieve if any.")
input = st.text_input("Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting Up the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the OpenAI model with specific parameters to generate personalized productivity advice based on user input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function uses the &lt;strong&gt;Lyzr Automata SDK&lt;/strong&gt; to create an agent that provides personalized productivity tips based on the user’s daily routine, productivity challenges, and goals.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert PRODUCTIVITY ASSISTANT",
        prompt_persona="Your task is to offer PERSONALIZED PRODUCTIVITY TIPS and ACTIONABLE RECOMMENDATIONS tailored to an individual's DAILY ROUTINE, the PRODUCTIVITY CHALLENGES they encounter, and their GOALS—whether SHORT-TERM or LONG-TERM—or any other MILESTONES they aim to achieve.")
    prompt = """
[prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Button to Generate Productivity Advice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of personalized productivity advice when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Assist!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Productivity Assistant&lt;/strong&gt; is designed to provide you with practical, feasible, and personalized productivity tips and recommendations. By leveraging the power of Lyzr Automata and OpenAI’s GPT-4 Turbo, you can receive expert advice tailored to your unique circumstances, helping you overcome challenges and achieve your goals efficiently. Whether you’re looking to improve your time management, increase your motivation, or prioritize your tasks better, the Productivity Assistant is here to support you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://assistant-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://assistant-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/productivity_assistant" rel="noopener noreferrer"&gt;https://github.com/isakshay007/productivity_assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Productivity Assistant app&lt;/strong&gt; is powered by the Lyzr Automata Agent, utilizing the capabilities of OpenAI’s GPT-4 Turbo. For any inquiries or issues, please contact Lyzr. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>coding</category>
      <category>python</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Building NL2PHP using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Tue, 06 Aug 2024 17:43:02 +0000</pubDate>
      <link>https://forem.com/akshay007/building-nl2php-using-lyzr-sdk-32d0</link>
      <guid>https://forem.com/akshay007/building-nl2php-using-lyzr-sdk-32d0</guid>
      <description>&lt;p&gt;In the world of software development, translating ideas from natural language into functional code can often be a challenging and time-consuming process. But what if you could streamline this process with the help of advanced &lt;strong&gt;AI tools&lt;/strong&gt;? Welcome to &lt;strong&gt;NL2PHP&lt;/strong&gt;, an innovative app designed to transform your natural language instructions into accurate PHP code effortlessly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz49uimpfwrz4ewn55a3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz49uimpfwrz4ewn55a3z.png" alt="Image description" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leveraging the capabilities of &lt;strong&gt;Lyzr Automata&lt;/strong&gt; and OpenAI’s GPT-4 Turbo, NL2PHP is here to make coding more accessible for everyone, from beginners to experienced developers. Let’s explore how this app works and how you can use it to convert your ideas into ready-to-use PHP code in seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use NL2PHP?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NL2PHP&lt;/strong&gt; simplifies the coding process by allowing you to describe what you want in natural language. The app then translates your instructions into precise &lt;strong&gt;PHP code&lt;/strong&gt;. This approach is particularly useful for those who might find writing code from scratch daunting or time-consuming.&lt;/p&gt;

&lt;p&gt;By using &lt;strong&gt;NL2PHP&lt;/strong&gt;, you can focus on what you want to achieve without worrying about the intricate details of PHP syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into how NL2PHP works, let’s set up our environment using Streamlit and the &lt;strong&gt;Lyzr Automata SDK&lt;/strong&gt;. Streamlit is a powerful framework for creating interactive web applications in Python, while Lyzr Automata provides tools for leveraging advanced AI models.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting the OpenAI API Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To access the GPT-4 Turbo model, we need to set the &lt;strong&gt;OpenAI API key&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We begin by setting the title of our app and providing a brief introduction to guide users on how to use &lt;strong&gt;NL2PHP&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("NL2PHP🧑🏻‍💻")
st.markdown("Welcome to NL2PHP! This app effortlessly transforms your natural language instructions into functional PHP code. Whether you're a beginner or an experienced developer, convert your ideas into ready-to-use code in seconds.")
input = st.text_input("Please enter in natural language:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting Up the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the &lt;strong&gt;OpenAI model&lt;/strong&gt; with specific parameters to generate the PHP code based on user input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function uses the Lyzr Automata SDK to create an agent that translates natural language input into PHP code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert PHP DEVELOPER",
        prompt_persona="Your task is to TRANSLATE the natural language input from the user into ACCURATE PHP CODE.")
    prompt = """
[prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Button to Generate the PHP Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of the PHP code when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Convert!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NL2PHP&lt;/strong&gt; represents a significant step forward in making coding more accessible and efficient. By leveraging the power of Lyzr Automata and OpenAI’s GPT-4 Turbo, you can transform your natural language instructions into functional PHP code quickly and accurately. This tool is perfect for both beginners who are learning to code and experienced developers looking to speed up their workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://nl2php-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://nl2php-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/NL2PHP" rel="noopener noreferrer"&gt;https://github.com/isakshay007/NL2PHP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The NL2PHP app is powered by the &lt;strong&gt;Lyzr Automata Agent&lt;/strong&gt;, utilizing the capabilities of OpenAI’s GPT-4 Turbo. For any inquiries or issues, please contact Lyzr. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;Website: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
Book a Demo: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
Discord: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
Slack: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>ai</category>
      <category>python</category>
    </item>
    <item>
      <title>Building a Custom PC Guide using Lyzr SDK</title>
      <dc:creator>Akshay Keerthi</dc:creator>
      <pubDate>Mon, 05 Aug 2024 12:27:57 +0000</pubDate>
      <link>https://forem.com/akshay007/building-a-custom-pc-guide-using-lyzr-sdk-1p3b</link>
      <guid>https://forem.com/akshay007/building-a-custom-pc-guide-using-lyzr-sdk-1p3b</guid>
      <description>&lt;p&gt;In today’s tech-savvy world, having a &lt;strong&gt;custom-built PC&lt;/strong&gt; tailored to your specific needs and budget can make all the difference. Whether you’re a gamer, a professional, or someone who simply wants a powerful machine, building a PC can be both a rewarding and cost-effective endeavor. With advancements in AI and natural language processing, tools like &lt;strong&gt;Lyzr Automata&lt;/strong&gt; and OpenAI’s &lt;strong&gt;GPT-4 Turbo&lt;/strong&gt; make this process even more accessible. Let’s dive into how you can build your custom PC using these powerful tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use Lyzr SDK’s?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Lyzr&lt;/strong&gt; SDKs, crafting your own &lt;strong&gt;GenAI&lt;/strong&gt; application is a breeze, requiring only a few lines of code to get up and running swiftly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.lyzr.ai/introduction" rel="noopener noreferrer"&gt;Checkout the Lyzr SDK’s&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lets get Started!&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, we set up our environment using Streamlit and the &lt;strong&gt;Lyzr Automata SDK&lt;/strong&gt;. Streamlit is a framework for creating interactive web applications in Python, and Lyzr Automata provides tools for leveraging AI models.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
from lyzr_automata.tasks.task_literals import InputType, OutputType
import os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting the OpenAI API Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to set the &lt;strong&gt;OpenAI API key&lt;/strong&gt; to authenticate and access the GPT-4 Turbo model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;App Title and Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We set the title and provide a brief introduction to guide users on how to use the app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;st.title("Custom PC Build Guide")
st.markdown("Welcome to the Custom PC Build Guide! Tell us your budget and what you need, and we'll help you build the perfect PC, tailored just for you.")
st.markdown("            1) Determine Your Budget.")
st.markdown("            2) Mention your needs (Primary Use,Preferred Brands if any and etc).")
st.markdown("            3) Provide additional information if any like Such as RGB lighting, quiet operation, overclocking capabilities, etc.")
input = st.text_input(" Please enter the above details:", placeholder="Type here")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Setting Up the OpenAI Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We initialize the &lt;strong&gt;OpenAI model&lt;/strong&gt; with specific parameters for generating the PC build guide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Generation Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function uses the Lyzr Automata SDK to create an agent that guides users through the PC building process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generation(input):
    generator_agent = Agent(
        role="Expert PC BUILDER and CUSTOMIZATION CONSULTANT",
        prompt_persona="Your task is to GUIDE users through the process of building their own CUSTOMIZED PC, tailored to their budget and specific needs, including primary use, preferred brands, and additional requirements such as RGB lighting, quiet operation, overclocking capabilities, etc.")
    prompt = """
[Prompts here]
"""
    generator_agent_task = Task(
        name="Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Button to Generate the Guide&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We add a button that triggers the generation of the PC build guide when clicked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if st.button("Guide!"):
    solution = generation(input)
    st.markdown(solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Building a &lt;strong&gt;custom PC&lt;/strong&gt; can seem daunting at first, but with the right guidance and tools, it becomes a manageable and even enjoyable task. By leveraging the capabilities of Lyzr Automata and OpenAI’s GPT-4 Turbo, you can receive &lt;strong&gt;expert advice&lt;/strong&gt; tailored to your specific needs and budget. This app not only helps you choose the right components but also provides clear, step-by-step instructions to assemble your PC.&lt;/p&gt;

&lt;p&gt;With the power of AI, you can ensure that your custom PC build meets your performance requirements, aesthetic preferences, and budget constraints. Whether you’re a gamer, a professional, or simply a tech enthusiast, this guide aims to simplify the process and make your custom PC building experience as smooth as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App link&lt;/strong&gt;: &lt;a href="https://custompc-lyzr.streamlit.app/" rel="noopener noreferrer"&gt;https://custompc-lyzr.streamlit.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: &lt;a href="https://github.com/isakshay007/Custom_PC" rel="noopener noreferrer"&gt;https://github.com/isakshay007/Custom_PC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Custom PC Guide&lt;/strong&gt; is powered by the Lyzr Automata Agent, utilizing the capabilities of OpenAI’s GPT-4 Turbo. For any inquiries or issues, please contact Lyzr. You can learn more about Lyzr and their offerings through the following links:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/" rel="noopener noreferrer"&gt;Lyzr.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Book a Demo&lt;/strong&gt;: &lt;a href="https://www.lyzr.ai/book-demo/" rel="noopener noreferrer"&gt;Book a Demo&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Discord&lt;/strong&gt;: &lt;a href="https://discord.com/invite/nm7zSyEFA2" rel="noopener noreferrer"&gt;Join our Discord community&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Slack&lt;/strong&gt;: &lt;a href="https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email" rel="noopener noreferrer"&gt;Join our Slack channel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to explore the app, provide your details, and start building the PC of your dreams. Happy building!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
  </channel>
</rss>
