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(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.2.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.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: conditions_ai-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 345b49ea785114533c19f8d58bcfce972dfd93e98a736582341e67ee85ea8b75
MD5 fc9492d3bdea4f742cec4ed7007e6bc0
BLAKE2b-256 eecebee62bb0df81d0b21cbdf6db7caa4732ed666886c2bc53b91a5edf908b15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for conditions_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf7092fc2f81c27c33a8ccf8d14699cdc46057a39b3d7cb25403cbb92d01ce4b
MD5 4e8a19bc4884a002300705569c51e942
BLAKE2b-256 83c8ceb77410772c4398dc27b65e4b2f0da7b4230f72e6d95eafe91a4d91678b

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