<?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>DEV Community: Chetan Singh</title>
    <description>The latest articles on DEV Community by Chetan Singh (@chetansingh63).</description>
    <link>https://dev.to/chetansingh63</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%2F678382%2F856158ce-d464-454e-987c-1ed1fb1679a9.png</url>
      <title>DEV Community: Chetan Singh</title>
      <link>https://dev.to/chetansingh63</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chetansingh63"/>
    <language>en</language>
    <item>
      <title>The CAP Theorem: A Guide for Developers Who Build Real-World Systems</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Wed, 06 Aug 2025 07:06:28 +0000</pubDate>
      <link>https://dev.to/chetansingh63/the-cap-theorem-a-guide-for-developers-who-build-real-world-systems-2d74</link>
      <guid>https://dev.to/chetansingh63/the-cap-theorem-a-guide-for-developers-who-build-real-world-systems-2d74</guid>
      <description>&lt;p&gt;As software engineers, architects, and data professionals, we build systems that live on networks. And networks, by their very nature, are unreliable. Understanding how to design resilient systems in the face of this unreliability is arguably one of the most critical skills in modern software engineering.&lt;/p&gt;

&lt;p&gt;This guide is a deep dive into the &lt;strong&gt;CAP Theorem&lt;/strong&gt;, the fundamental law that governs distributed systems. We won't just define it; we'll build it up from first principles, explore its profound implications, and see how it dictates the architecture of the databases and services you use every day.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 1: The Genesis of the Problem - Why Distribute?
&lt;/h2&gt;

&lt;p&gt;Before we can understand the solution, we must deeply understand the problem. Let's start with a single server running your application and its database.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Single-Node Utopia (and its Limits)
&lt;/h4&gt;

&lt;p&gt;Imagine a lone, brilliant baker who runs a single, highly efficient bakery. This is our &lt;strong&gt;single-node system&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity:&lt;/strong&gt; Everything is in one place. The baker knows the exact state of his inventory at all times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inherent Consistency:&lt;/strong&gt; It's impossible to sell the same cake twice. There is one source of truth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But success brings problems. The line of customers grows, and the baker can't keep up. He has two options to scale:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vertical Scaling ("Get a Bigger Oven"):&lt;/strong&gt; He could buy a much larger, faster oven. In computing, this is like upgrading to a server with a faster CPU, more RAM, or faster SSDs. This works, but only up to a point. You eventually hit a hard ceiling imposed by physics and cost. There's no infinitely large oven you can buy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Horizontal Scaling ("Open More Branches"):&lt;/strong&gt; He could hire more bakers and open new, identical branches of his bakery across the city. In computing, this means adding more servers (nodes) to a cluster to share the load.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This second option, horizontal scaling, is the birth of a &lt;strong&gt;distributed system&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Definition: Distributed System&lt;/strong&gt;&lt;br&gt;
A collection of independent computers (nodes) that work together and appear to its users as a single, coherent system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This approach also solves another critical problem: &lt;strong&gt;fault tolerance&lt;/strong&gt;. If our original baker gets sick (i.e., the server crashes), the business closes. In our distributed bakery, if one baker gets sick, the other branches can still serve customers. The system is resilient to failure.&lt;/p&gt;

&lt;p&gt;However, by distributing our system, we've traded a simple set of problems (physical limits) for a new, far more complex set of challenges related to communication and agreement.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 2: The Three Sacred Promises
&lt;/h2&gt;

&lt;p&gt;When we create a distributed system, we ideally want to provide three guarantees to our users.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Consistency (C)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intuitive Analogy:&lt;/strong&gt; Every bakery branch has the &lt;em&gt;exact same&lt;/em&gt; inventory count at the &lt;em&gt;exact same time&lt;/em&gt;. If a cake is sold at Branch A, Branch B knows about it &lt;em&gt;instantly&lt;/em&gt; before it talks to its next customer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical Definition:&lt;/strong&gt; This refers to &lt;strong&gt;strong consistency&lt;/strong&gt; or &lt;strong&gt;linearizability&lt;/strong&gt;. It guarantees that every read operation receives the most recent write's value. Once a write completes, all subsequent reads (no matter which node they hit) will see that value. To the outside world, the system appears to behave as if it were a single, non-distributed machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Availability (A)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intuitive Analogy:&lt;/strong&gt; The bakery is always open for business. A customer can always walk into any branch, place an order, and get a response. The shop never just puts up a "Closed for Internal Issues" sign.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical Definition:&lt;/strong&gt; Every request sent to a non-failing node in the system receives a non-error response. This doesn't guarantee the response contains the most up-to-date information, only that the system is operational and will respond.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Partition Tolerance (P)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intuitive Analogy:&lt;/strong&gt; A storm knocks out the phone lines between bakery branches. The branches are "partitioned" from each other and cannot communicate. The system must be designed to continue operating in some capacity despite this communication breakdown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical Definition:&lt;/strong&gt; The system continues to function even when an arbitrary number of messages are dropped or delayed by the network between nodes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Crucial Realization: 'P' is a Fact of Life
&lt;/h3&gt;

&lt;p&gt;In any system that communicates over a network (i.e., any distributed system), &lt;strong&gt;partitions are inevitable&lt;/strong&gt;. Routers fail, switches crash, network cables are unplugged, and network latency can spike so high that nodes time out and consider each other "down."&lt;/p&gt;

&lt;p&gt;Because network partitions &lt;em&gt;will&lt;/em&gt; happen, &lt;strong&gt;Partition Tolerance (P) is not a choice. It is a requirement&lt;/strong&gt; for any real-world distributed system.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 3: The CAP Theorem - The Inevitable Trade-off
&lt;/h2&gt;

&lt;p&gt;This brings us to the theorem itself, first formulated by Dr. Eric Brewer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The CAP Theorem&lt;/strong&gt;&lt;br&gt;
A distributed data store can only simultaneously provide &lt;strong&gt;two&lt;/strong&gt; of the following three guarantees: Consistency (C), Availability (A), and Partition Tolerance (P).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since we've established that we &lt;em&gt;must&lt;/em&gt; tolerate partitions (&lt;code&gt;P&lt;/code&gt;), the theorem forces a monumental choice upon us:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When a network partition occurs, you must choose between Consistency and Availability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's illustrate this with our bakery during the "storm."&lt;/p&gt;

&lt;h3&gt;
  
  
  Scenario 1: Choosing Consistency over Availability (CP)
&lt;/h3&gt;

&lt;p&gt;A partition occurs. Branch A and Branch B cannot communicate. A customer walks into Branch B and asks for the last Red Velvet cake. The baker in Branch B has no way of knowing if that cake was just sold in Branch A.&lt;/p&gt;

&lt;p&gt;To guarantee &lt;strong&gt;Consistency&lt;/strong&gt;, the baker &lt;em&gt;must&lt;/em&gt; prevent a situation where he sells a non-existent cake. He tries to contact the central database but fails. His only option is to refuse the sale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; The baker tells the customer, "I'm sorry, our inventory system is currently unreachable. I cannot complete your order at this time."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; &lt;strong&gt;Consistency is maintained&lt;/strong&gt; (no data corruption), but &lt;strong&gt;Availability is sacrificed&lt;/strong&gt; (a legitimate request was denied).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CP Systems are for when correctness is an absolute, non-negotiable requirement.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Cases:&lt;/strong&gt; Financial ledgers, payment processing, user authentication, master databases for e-commerce inventory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology Examples:&lt;/strong&gt; &lt;code&gt;etcd&lt;/code&gt;, &lt;code&gt;Zookeeper&lt;/code&gt;, &lt;code&gt;Consul&lt;/code&gt;. Relational databases like &lt;code&gt;PostgreSQL&lt;/code&gt; in a default single-master configuration behave as CP systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scenario 2: Choosing Availability over Consistency (AP)
&lt;/h3&gt;

&lt;p&gt;Faced with the same partition, the baker in Branch B decides that serving the customer is the top priority. He checks his local records, which &lt;em&gt;think&lt;/em&gt; there is one cake left, and sells it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; The baker sells the cake and the customer leaves happy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; &lt;strong&gt;Availability is maintained&lt;/strong&gt; (the system remained operational for the user). But &lt;strong&gt;Consistency is sacrificed&lt;/strong&gt;. If the cake was also sold at Branch A, the bakery's data is now inconsistent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This inconsistency must be resolved later when the partition heals. This leads to the concept of &lt;strong&gt;eventual consistency&lt;/strong&gt;, where the system guarantees that &lt;em&gt;eventually&lt;/em&gt;, if no new updates are made, all replicas will converge to the same value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AP Systems are for when downtime is unacceptable and some data staleness is tolerable.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Cases:&lt;/strong&gt; Social media feeds (seeing a 'like' a few seconds late is okay), view counters, real-time analytics, shopping carts (where an item might be found to be out of stock only at the final checkout step).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology Examples:&lt;/strong&gt; &lt;code&gt;Amazon DynamoDB&lt;/code&gt;, &lt;code&gt;Apache Cassandra&lt;/code&gt;, &lt;code&gt;Riak&lt;/code&gt;, &lt;code&gt;CouchDB&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Chapter 4: What About CA? The Mythical Beast
&lt;/h2&gt;

&lt;p&gt;If the choice is between CP and AP, what happened to CA (Consistent and Available)?&lt;/p&gt;

&lt;p&gt;A CA system is a system that chooses to forgo Partition Tolerance. The only way to do this is to run all your components on a single machine or within a single, hyper-reliable hardware rack where a network partition is considered impossible.&lt;/p&gt;

&lt;p&gt;A traditional, single-instance RDBMS (like &lt;code&gt;MySQL&lt;/code&gt; running on one server) is a CA system. It is consistent and available... right up until that single server fails. It has no tolerance for partitions because it has nothing to be partitioned from. The moment you add a replica over a network, you are in the world of &lt;code&gt;P&lt;/code&gt;, and the CAP trade-off becomes mandatory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 5: Evolving the Conversation with PACELC
&lt;/h2&gt;

&lt;p&gt;The CAP theorem is powerful, but it has a limitation: it only describes the system's behavior &lt;em&gt;during a network partition&lt;/em&gt;. What about when the system is running normally? This is where the &lt;strong&gt;PACELC theorem&lt;/strong&gt; provides a more complete picture.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The PACELC Theorem&lt;/strong&gt;&lt;br&gt;
If there is a &lt;strong&gt;P&lt;/strong&gt;artition, a system must choose between &lt;strong&gt;A&lt;/strong&gt;vailability and &lt;strong&gt;C&lt;/strong&gt;onsistency.&lt;br&gt;
&lt;strong&gt;E&lt;/strong&gt;lse (when operating normally), a system must choose between &lt;strong&gt;L&lt;/strong&gt;atency and &lt;strong&gt;C&lt;/strong&gt;onsistency.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The "Else" part is the crucial extension. During normal operation, you face a new trade-off:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Latency (L):&lt;/strong&gt; How quickly does the system respond to a user request? To achieve very low latency, a system might read from the nearest (but possibly not fully up-to-date) replica.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency (C):&lt;/strong&gt; Does every read see the absolute latest write? To guarantee this, a read might have to check with a quorum of replicas or travel to a master node, which takes more time (increasing latency).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives us a more nuanced way to classify systems:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Partition (P) Choice&lt;/th&gt;
&lt;th&gt;Normal (E) Choice&lt;/th&gt;
&lt;th&gt;Classification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DynamoDB, Cassandra&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;A&lt;/code&gt;vailability&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;L&lt;/code&gt;atency&lt;/td&gt;
&lt;td&gt;PA/EL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MongoDB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;A&lt;/code&gt;vailability&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C&lt;/code&gt;onsistency&lt;/td&gt;
&lt;td&gt;PA/EC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VoltDB, BigTable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C&lt;/code&gt;onsistency&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C&lt;/code&gt;onsistency&lt;/td&gt;
&lt;td&gt;PC/EC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PostgreSQL (default)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C&lt;/code&gt;onsistency&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C&lt;/code&gt;onsistency&lt;/td&gt;
&lt;td&gt;PC/EC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Chapter 6: Practical Takeaways for the Modern Developer
&lt;/h2&gt;

&lt;p&gt;These theorems are not just academic. They are practical frameworks for making critical design decisions. When choosing a database or designing a service, ask yourself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;What is the business cost of being wrong?&lt;/strong&gt; If your system processes payments, inconsistency is catastrophic. You need a &lt;strong&gt;CP&lt;/strong&gt; system. If you're counting video views, a slight undercount for a few minutes is acceptable.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;What is the business cost of being unavailable?&lt;/strong&gt; If your system is the front page of an e-commerce site, being unavailable means losing sales directly. You need an &lt;strong&gt;AP&lt;/strong&gt; system. If it's a batch-processing analytics job, being delayed by a few minutes is fine.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;During normal operation, what do my users value more: speed or perfect accuracy?&lt;/strong&gt; Do they need an instant response (favoring &lt;strong&gt;Latency&lt;/strong&gt;), or can they wait a few hundred milliseconds for a guaranteed-correct answer (favoring &lt;strong&gt;Consistency&lt;/strong&gt;)?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Understanding this spectrum—from CP to AP, and from Latency to Consistency—is the hallmark of a senior engineer. It allows you to move beyond "what's the hot new database?" and instead ask, "What are the fundamental trade-offs this system makes, and do they align with the needs of my application?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Took help of Gemini to write this article. I usually write so that I can come and revise later LOL. Glad if it helps someone!!&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Manage Background Services with systemctl and systemd (with Celery Example)</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Wed, 30 Jul 2025 08:49:17 +0000</pubDate>
      <link>https://dev.to/chetansingh63/how-to-manage-background-services-with-systemctl-and-systemd-with-celery-example-320f</link>
      <guid>https://dev.to/chetansingh63/how-to-manage-background-services-with-systemctl-and-systemd-with-celery-example-320f</guid>
      <description>&lt;p&gt;When deploying services like Celery, Gunicorn, Redis, etc., on a Linux server — you don’t want to manually start them every time your server reboots. That’s where systemd and systemctl come in.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll explain how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand what systemctl is&lt;/li&gt;
&lt;li&gt;Create a systemd service for something like Celery&lt;/li&gt;
&lt;li&gt;Use essential commands to manage any service&lt;/li&gt;
&lt;li&gt;Troubleshoot and view logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What is systemd and systemctl?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;systemd is the init system and service manager used by most modern Linux distributions.&lt;/li&gt;
&lt;li&gt;systemctl is the command-line tool to interact with systemd.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's used to start, stop, restart, enable (auto-start on boot), and debug services.&lt;/p&gt;

&lt;p&gt;When Do You Need a systemd Service?&lt;br&gt;
If you're running long-lived processes like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Celery worker&lt;/li&gt;
&lt;li&gt;Gunicorn for a Django/Flask app&lt;/li&gt;
&lt;li&gt;Background scripts&lt;/li&gt;
&lt;li&gt;Queues / job runners&lt;/li&gt;
&lt;li&gt;Redis / PostgreSQL / any server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And you're not using Docker or Kubernetes, it’s best to define a systemd unit file for each of them.&lt;/p&gt;

&lt;p&gt;Where Are These Service Files Stored?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Location                  | Purpose                               |
| ------------------------- | ------------------------------------- |
| `/etc/systemd/system/`    | 🔧 Your custom services (recommended) |
| `/lib/systemd/system/`    | 📦 Package-installed services         |
| `~/.config/systemd/user/` | 👤 Per-user services (less common)    |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use /etc/systemd/system/ for your custom services like Celery.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧰 Example: Create a Celery Systemd Service
&lt;/h2&gt;

&lt;p&gt;Assume:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your app is in /home/ubuntu/yourproject&lt;/li&gt;
&lt;li&gt;You’re using a virtual environment at /home/ubuntu/venv&lt;/li&gt;
&lt;li&gt;Your Celery app is named yourproject
Create the service file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/systemd/system/celery.service

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Paste this:
[Unit]
Description=Celery Worker Service
After=network.target

[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/yourproject
ExecStart=/home/ubuntu/venv/bin/celery -A yourproject worker --loglevel=info
Restart=always

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable and start the service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Reload systemd to recognize the new service
sudo systemctl daemon-reload

# Enable to start on boot
sudo systemctl enable celery

# Start it now
sudo systemctl start celery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧾 Handy systemctl Commands
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl start celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl stop celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stop service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl restart celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restart it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl status celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl enable celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start on boot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl disable celery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove from startup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl daemon-reload&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reload configs (after editing .service)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  📑 View Logs with journalctl
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# View logs for celery service
sudo journalctl -u celery

# Follow logs in real-time (like tail -f)
sudo journalctl -u celery -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧹 Bonus: Reload After Edits
&lt;/h2&gt;

&lt;p&gt;Any time you edit a .service file, run:&lt;br&gt;
&lt;code&gt;sudo systemctl daemon-reload&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💭 Conclusion
&lt;/h2&gt;

&lt;p&gt;Using systemd with systemctl helps you make your production deployments clean, auto-recovering, and reboot-friendly.&lt;/p&gt;

&lt;p&gt;Instead of manually managing your services, just define them once and let Linux take care of the rest.&lt;/p&gt;

&lt;p&gt;_Written using Chatgpt for quick one stop basic guide. _&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Just started learning Linux. Thought to share whatever I learned so far. Check it out !!</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Sat, 14 Jun 2025 07:17:59 +0000</pubDate>
      <link>https://dev.to/chetansingh63/just-started-learning-linux-thought-to-share-whatever-i-learned-so-far-check-it-out--22h6</link>
      <guid>https://dev.to/chetansingh63/just-started-learning-linux-thought-to-share-whatever-i-learned-so-far-check-it-out--22h6</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo" class="crayons-story__hidden-navigation-link"&gt;Linux Fundamentals: What I Wish Someone Had Told Me When I Started&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/chetansingh63" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F678382%2F856158ce-d464-454e-987c-1ed1fb1679a9.png" alt="chetansingh63 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/chetansingh63" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Chetan Singh
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Chetan Singh
                
              
              &lt;div id="story-author-preview-content-2591669" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/chetansingh63" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F678382%2F856158ce-d464-454e-987c-1ed1fb1679a9.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Chetan Singh&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 14 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo" id="article-link-2591669"&gt;
          Linux Fundamentals: What I Wish Someone Had Told Me When I Started
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;6&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              2&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>linux</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>Linux Fundamentals: What I Wish Someone Had Told Me When I Started</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Sat, 14 Jun 2025 06:42:15 +0000</pubDate>
      <link>https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo</link>
      <guid>https://dev.to/chetansingh63/linux-fundamentals-what-i-wish-someone-had-told-me-when-i-started-2ebo</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Day I Decided to Befriend the Terminal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Last week, I made a decision that both excited and terrified me: I decided to learn Linux. Not just the surface-level "copy-paste commands from Stack Overflow" approach I'd been using, but really understand what's happening under the hood.&lt;br&gt;
Why? Because every time I deployed code to a server, configured a CI/CD pipeline, or troubleshot a production issue, I felt like I was speaking a foreign language with a thick accent. Sure, I could get things done, but I knew I was missing something fundamental.&lt;br&gt;
So here I am, documenting my journey from the very beginning. If you're in the same boat—comfortable with development but intimidated by Linux—this one's for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux is Actually Logical&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first thing that clicked for me was understanding that Linux isn't just a random collection of cryptic commands. It's built on a philosophy so elegant it's almost beautiful: do one thing, and do it well.&lt;br&gt;
Think about it like this: instead of having one massive Swiss Army knife that's mediocre at everything, Linux gives you a precision toolbox where each tool excels at its specific job. The magic happens when you start combining these tools—that's where the real power lives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The City Metaphor of Linux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hardware is like the city's infrastructure—the roads, power lines, and water systems. It's there, it's essential, but most people don't think about it day-to-day.&lt;br&gt;
The Linux Kernel is like city government. It makes all the important decisions about resource allocation, manages traffic between different parts of the system, and keeps everything running smoothly. When your web browser needs memory, it doesn't directly grab RAM—it politely asks the kernel, which decides whether to grant the request.&lt;br&gt;
System Libraries are like public services—the post office, utilities, and municipal services that programs use to get things done. Your applications don't need to understand the complexities of hardware; they just use these well-defined services.&lt;br&gt;
User Applications are like businesses and residents. They rely on all the layers below but don't need to understand the complex details of city infrastructure.&lt;br&gt;
This mental model transformed how I think about troubleshooting. When something goes wrong, I now think: "Is this a hardware issue (infrastructure), a kernel issue (government), a library issue (public services), or an application issue (business)?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Shell&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The terminal intimidated me for years. All those black screens with white text looked like something from a 1980s hacker movie. But here's what I learned: the shell is just a conversation interface with your computer.&lt;br&gt;
When you open a terminal, you're essentially starting a chat session with Linux. That prompt—username@hostname:~$—isn't cryptic code. It's Linux politely saying: "Hi [username], you're on [hostname], currently in your home directory (~), and I'm ready to listen ($)."&lt;br&gt;
Every command you type is like asking Linux a question or giving it a task:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;whoami → "Who am I?"&lt;/li&gt;
&lt;li&gt;pwd → "Where am I right now?"&lt;/li&gt;
&lt;li&gt;ls → "What's here?"&lt;/li&gt;
&lt;li&gt;cd Documents → "Take me to my Documents folder"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The shell remembers your conversation history, can complete your sentences (tab completion), and even lets you recall and modify previous "statements" using the up arrow. It's like having a very patient, very literal assistant who never forgets anything you've said.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The File System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Coming from Windows, Linux's file system felt alien at first. No C: drive? No D: drive? Just a single forward slash (/) at the root of everything?&lt;br&gt;
But here's the beautiful part: Linux treats everything as a file, organized in one massive, logical tree. Imagine the world's most organized library, where every book, every piece of information, has exactly one correct place, and there's a logical system for finding anything.&lt;br&gt;
The root directory (/) branches out into standard subdirectories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/home - The residential area where users live&lt;/li&gt;
&lt;li&gt;/etc - The rulebook (configuration files)&lt;/li&gt;
&lt;li&gt;/usr - The commercial district (user programs)&lt;/li&gt;
&lt;li&gt;/var - The dynamic area (logs, temporary files, changing data)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What blew my mind was realizing that this organization isn't arbitrary. When you install a program, it doesn't just dump files randomly. Executables go in /usr/bin, configs go in /etc, documentation goes in /usr/share/doc. This predictability makes the entire system maintainable and troubleshoot-able.&lt;br&gt;
Your current location in this vast library is called your "working directory." You can reference files relative to where you are, or use absolute paths that start from the root. It's like giving someone directions by saying either "go to the kitchen" (relative) or "from the front door, go straight, turn right at the living room, then enter the kitchen" (absolute).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every program running on Linux is a process—think of them as the living inhabitants of our Linux city. Each gets a unique Process ID (PID), like a social security number.&lt;br&gt;
What fascinated me was learning that processes have family relationships. When you start a program from the shell, the shell becomes the parent, and your program becomes the child. This family tree affects how processes communicate and share resources.&lt;br&gt;
Processes can be in different states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running: Actively using the CPU&lt;/li&gt;
&lt;li&gt;Sleeping: Waiting for something (user input, network data, file operations)&lt;/li&gt;
&lt;li&gt;Stopped: Paused by a signal&lt;/li&gt;
&lt;li&gt;Zombie: Finished but not yet acknowledged by the parent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding this helped me debug a hanging Node.js application last week. Instead of just restarting everything, I could identify the specific process, understand its state, and figure out what it was waiting for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Commands That Changed My Daily Workflow&lt;/strong&gt;&lt;br&gt;
Navigation that feels natural:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pwd          # Where am I?
ls -la       # What's here? (detailed view)
cd ~/project # Take me to my project folder
cd ..        # Go up one level
cd -         # Go back to where I was before
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finding things without clicking through folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find . -name "*.js"           # Find all JavaScript files
grep -r "TODO" .              # Find all TODO comments
locate filename               # Find files by name (super fast)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding what's running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ps aux                        # Show all processes
top                          # Real-time process monitor
htop                         # Even better process monitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What I'm Learning Next&lt;/strong&gt;&lt;br&gt;
This is just the beginning. Next week, I'm diving into:&lt;/p&gt;

&lt;p&gt;Text processing with pipes and filters&lt;br&gt;
File permissions and security&lt;br&gt;
Environment variables and shell customization&lt;br&gt;
Package management and system maintenance&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Surprising Benefits I Didn't Expect&lt;/strong&gt;&lt;br&gt;
Learning Linux fundamentals has already improved my development workflow in unexpected ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debugging is faster: I can quickly investigate system resources, process states, and file permissions when things go wrong.&lt;/li&gt;
&lt;li&gt;Server management makes sense: Instead of blindly following deployment tutorials, I understand what each command actually does.&lt;/li&gt;
&lt;li&gt;Docker and containerization clicked: Understanding processes and file systems made container concepts much clearer.&lt;/li&gt;
&lt;li&gt;CI/CD scripts aren't mysterious anymore: I can read and write bash scripts that actually make sense.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article is part of my "Learning in Public" series where I document my journey toward technical mastery. Follow along for honest insights, practical tips, and the occasional face-palm moment.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>Building a Natural Language Task Scheduler with FastAPI, Notion, and LLM</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Wed, 22 Jan 2025 12:02:25 +0000</pubDate>
      <link>https://dev.to/chetansingh63/building-a-natural-language-task-scheduler-with-fastapi-notion-and-llm-29m1</link>
      <guid>https://dev.to/chetansingh63/building-a-natural-language-task-scheduler-with-fastapi-notion-and-llm-29m1</guid>
      <description>&lt;p&gt;Are you tired of manually creating and managing tasks in Notion? What if you could just say "Schedule a meeting with John tomorrow at 3pm" and have it automatically create a task? In this tutorial, we'll build exactly that - a natural language task scheduler that integrates with Notion!&lt;/p&gt;

&lt;h2&gt;
  
  
  What We're Building
&lt;/h2&gt;

&lt;p&gt;We'll create a system that can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create tasks using natural language&lt;/li&gt;
&lt;li&gt;Delete tasks when you ask&lt;/li&gt;
&lt;li&gt;Reschedule tasks using simple commands&lt;/li&gt;
&lt;li&gt;Integrate with your Notion workspace&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, you can say:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Schedule team meeting with John tomorrow at 3pm"
"Delete my meeting with Sarah"
"Reschedule project review to next Monday at 2pm"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we start, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.8+ installed&lt;/li&gt;
&lt;li&gt;A Notion account and API key&lt;/li&gt;
&lt;li&gt;A Groq API key (for LLM integration)&lt;/li&gt;
&lt;li&gt;Basic understanding of Python and APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Setup
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;First, create your project structure:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;notion-ai-scheduler/
├── app/
│   ├── services/
│   │   ├── notion_service.py
│   │   ├── task_processor.py
│   │   └── scheduler_service.py
│   ├── main.py
├── .env
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install required packages:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;fastapi uvicorn notion-client groq python-dotenv pytz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Set up your environment variables (.env):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NOTION_API_KEY=your_notion_api_key
NOTION_DATABASE_ID=your_database_id
GROQ_API_KEY=your_groq_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1: Setting Up Notion
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Notion database with these columns:&lt;/li&gt;
&lt;li&gt;Task (Title)&lt;/li&gt;
&lt;li&gt;Status (Select: Not Started, In Progress, Done)&lt;/li&gt;
&lt;li&gt;Due Date (Date)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Priority (Select: High, Medium, Low)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Notion integration:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;a href="https://www.notion.so/my-integrations" rel="noopener noreferrer"&gt;https://www.notion.so/my-integrations&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new integration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy your API key&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share your database with the integration&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2: Creating the Notion Service
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;notion_service.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;notion_client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Client&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NotionService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;NOTION_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NOTION_DATABASE_ID&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;due_date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;priority&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Medium&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;properties&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}}]},&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not started&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Priority&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;priority&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;due_date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Due Date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;start&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;due_date&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;

            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;database_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database_id&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="n"&gt;properties&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;properties&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error creating task: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;delete_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;page_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;archived&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error deleting task: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Creating the LLM Processor
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;task_processor.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;groq&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Groq&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pytz&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TaskProcessor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Groq&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pytz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Asia/Kolkata&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;current_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ist&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;You are a task management assistant.
        Current time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;current_time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;%Y-%m-%d %H&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

        Convert the task request into a JSON with:
        - title: task description
        - due_date: YYYY-MM-DD HH:MM format or null
        - priority: High/Medium/Low
        - needs_clarification: true if time is vague
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;completion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;system&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mixtral-8x7b-32768&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;response_format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;json_object&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;

            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;completion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Creating the Scheduler Service
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;scheduler_service.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SchedulerService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;NotionService&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TaskProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_task_from_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;llm_result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;processor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;process_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failed to process text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;needs_clarification&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;needs_clarification&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;clarification_question&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;notion_task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="n"&gt;due_date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;due_date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="n"&gt;priority&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;llm_result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;priority&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;success&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;notion_task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Task created successfully&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failed to create task in Notion: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Setting Up FastAPI
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;main.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HTTPException&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;scheduler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SchedulerService&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TextInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/process-text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_text_to_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TextInput&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_task_from_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running the Project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Start the server:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uvicorn app.main:app &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Test creating a task:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"http://localhost:8000/process-text"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"text": "Schedule team meeting tomorrow at 3pm"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Features and How They Work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Natural Language Processing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The LLM (Groq) processes natural language input&lt;/li&gt;
&lt;li&gt;Extracts key information like dates, times, and priorities&lt;/li&gt;
&lt;li&gt;Handles various date formats ("tomorrow", "next Monday", etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Notion Integration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Creates tasks in your Notion database&lt;/li&gt;
&lt;li&gt;Manages task status and priority&lt;/li&gt;
&lt;li&gt;Handles date and time conversions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Error Handling
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Validates input&lt;/li&gt;
&lt;li&gt;Handles API errors gracefully&lt;/li&gt;
&lt;li&gt;Asks for clarification when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Task Deletion
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/process-deletion&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_deletion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TextInput&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;task_deletion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Task Rescheduling
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/reschedule-task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;reschedule_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TextInput&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reschedule_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;p&gt;You could extend this project by:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding a frontend interface&lt;/li&gt;
&lt;li&gt;Implementing user authentication&lt;/li&gt;
&lt;li&gt;Adding support for recurring tasks&lt;/li&gt;
&lt;li&gt;Creating task templates&lt;/li&gt;
&lt;li&gt;Adding email notifications&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We've built a powerful task management system that combines the simplicity of natural language with the organization of Notion. This project demonstrates how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate multiple APIs&lt;/li&gt;
&lt;li&gt;Process natural language&lt;/li&gt;
&lt;li&gt;Handle complex date/time operations&lt;/li&gt;
&lt;li&gt;Build a practical tool for daily use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The complete code is available on &lt;a href="https://github.com/chetansingh-2/notion-ai-project" rel="noopener noreferrer"&gt;https://github.com/chetansingh-2/notion-ai-project&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.notion.com/" rel="noopener noreferrer"&gt;Notion API Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.groq.com/" rel="noopener noreferrer"&gt;Groq Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to make HTML content editable?</title>
      <dc:creator>Chetan Singh</dc:creator>
      <pubDate>Mon, 17 Jan 2022 16:48:48 +0000</pubDate>
      <link>https://dev.to/chetansingh63/how-to-make-html-content-editable-4kab</link>
      <guid>https://dev.to/chetansingh63/how-to-make-html-content-editable-4kab</guid>
      <description>&lt;p&gt;Ever wondered? Can we make HTML content editable when it runs on a browser? The answer is &lt;strong&gt;YES&lt;/strong&gt;. &lt;br&gt;
By using &lt;code&gt;contenteditable&lt;/code&gt; attribute we can specify whether the content of an element will be editable or not.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;code&gt;&amp;lt;element contenteditable="true or false"&amp;gt;&lt;/code&gt; &lt;br&gt;
We can give any of two values 'true' or 'false'.&lt;br&gt;
'True' tells that element is editable while 'false' specifies that element is not editable.&lt;/p&gt;

&lt;p&gt;Let's see: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Po51Hqp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovroqdffjwbukrmwjtan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Po51Hqp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovroqdffjwbukrmwjtan.png" alt="Image description" width="863" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is my first post. I would document my learning journey on this platform and I hope it will prove helpful for beginners as I, too, am a beginner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HEART IT&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
