Skip to main content

Harness the true power of 🚀GenAI🚀

Project description

conditions-ai

Ever had that moment when your boss waltzes into your office, coffee in hand, and drops the bomb: “We need to include AI in our SaaS product”? Suddenly, you’re left staring at your screen like a deer in headlights, thinking, “What even is AI?” You’re a Developer, not a Machine Learning Engineer! Your superpower is writing code and shipping features—not diving deep into the mysterious world of artificial intelligence.

Fear not, fellow coder! Enter conditions-ai—the trusty sidekick you didn’t know you needed. This gem lets you harness the magic of AI without the headache of spending weeks in a dark cave of tutorials. With just a sprinkle of modern technology and a dash of simplicity, you can transform those mundane lines of code (you know, the ones that check if a number is even or compare two values) into something truly extraordinary!

Why conditions-ai? 🤔

  • No More Overwhelm: Say goodbye to the chaos of figuring out AI on your own. conditions-ai is here to save your sanity!
  • Modern Tech Stack: Built using the latest and greatest technologies, so you can feel like a coding superhero.
  • Easy AI/GenAI Implementation: Quickly integrate AI features into your product without the steep learning curve. Seriously, it’s easier than making a cup of coffee!
  • Build using uv: conditions-ai is built using uv, so you can easily add it to your project with a single command. No fuss, no muss!

So, if you’re ready to level up your SaaS product and impress your boss without pulling your hair out, give conditions-ai a whirl! Let’s turn that confusion into confidence and ship some AI-powered features together. 🚀

For all those who want to sprinkle a little AI magic into their product without the sorcery of complicated machine learning—this is for you!

Inspired by 'is-even-ai' for JS/TS and this tweet.

Installation 🛠️

The package is available on PyPI.

You can install it using pip:

pip install conditions-ai

or you can install it using uv:

uv add conditions-ai

Usage 👨‍💻

# Import the ConditionsAI class - currently only OpenAI is supported
from conditions_ai.models.conditions_openai import ConditionsAIOpenAI

if __name__ == "__main__":
    # Set the OS environment variable OPENAI_API_KEY if you don't want to pass the API key as an argument and change the model_id to the model you want to use
    conditions_ai_openai = ConditionsAIOpenAI(openai_api_key="YOUR_OPENAI_API_KEY", openai_model_id="gpt-4o-mini")
    
    print(conditions_ai_openai.is_even(2)) # True
    print(conditions_ai_openai.is_odd(2)) # False
    print(conditions_ai_openai.is_positive(2)) # True
    print(conditions_ai_openai.is_negative(5)) # False
    print(conditions_ai_openai.is_zero(2)) # False
    print(conditions_ai_openai.equal_to(6, 6)) # True
    print(conditions_ai_openai.not_equal_to(6, 6)) # False
    print(conditions_ai_openai.greater_than(6, 5)) # True
    print(conditions_ai_openai.less_than(6, 5)) # False

Supported AI providers 💪

Feel free to make a PR to add more AI platforms.

Repo Structure 📂

.
├── .github
│   └── workflows
│       ├── build_n_release.yml
│       └── tests.yml
├── conditions_ai
│   ├── constants
│   │   ├── __init__.py
│   │   └── prompts.py
│   ├── models
│   │   ├── __init__.py
│   │   └── conditions_openai.py
│   ├── utils
│   │   ├── __init__.py
│   │   └── bool_converter.py
│   └── __init__.py
├── tests
│   ├── __init__.py
│   └── test_openai.py
├── .gitignore
├── .python-version
├── LICENSE
├── pyproject.toml
├── README.md
└── uv.lock

Contributing 🤝

If you want to contribute to this project and make it better, your help is very welcome. Create a pull request with your changes and I will review it. If you have any questions, open an issue.

License 📝

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conditions_ai-0.1.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

conditions_ai-0.1.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file conditions_ai-0.1.3.tar.gz.

File metadata

  • Download URL: conditions_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.27

File hashes

Hashes for conditions_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 02954f8dd26a0421cb37be741e5bbda04fe4aa38116379db71172879464fef6a
MD5 ee74a47661df5ff9788f7521f95f0722
BLAKE2b-256 531762af6884cba69f50074a3c2bb6d0e276fe76376d7a5c7fdc965f8d902056

See more details on using hashes here.

File details

Details for the file conditions_ai-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for conditions_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3774ff2ac9fafecc82a2be497be8a9700c84bb01e014c98307215db4ad4a14c5
MD5 d41f425fcd6672523a165ed1c13ca784
BLAKE2b-256 e0aa6e274320ba248405cb6085929a58dbd01fd57715bac6fdfd19ddb7c18747

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page