Skip to main content

Smart, code-aware functions.

Project description

SMAF: Smart, Code-Aware Functions

SMAF (Smart, Code-Aware Functions) is a Python library that provides intelligent, context-aware function calls using LLMs. It analyzes the context in which it's called and performs appropriate operations based on the available variables and inferred intent.

For now, it only works with OpenAI models (gpt-4o-mini). So set your OPENAI_API_KEY environment variable.

Installation

To install SMAF, use pip:

pip install smaf

Or if you're using Poetry:

poetry add smaf

Usage

from smaf.smart_call import smart_call

def get_country_data(city: str):
    country_data = smart_call()

    return {
        "country_name": country_data["name"],
        "country_code": country_data["code"],
        "country_flag": country_data["emoji"],
    }

License

This project is licensed under the MIT License.

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

smaf-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

smaf-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smaf-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Darwin/23.2.0

File hashes

Hashes for smaf-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a73b2ac1fcee7dbddb5b4cee94d2133cdf69a41d2f79d8343a9cfc87e7c06f80
MD5 682457965572fb6b28fd7ff28b3df333
BLAKE2b-256 bada0f038124e39d1a032a4dbfaffadb144dab4bdb21f8c513149cb2be3975c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smaf-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Darwin/23.2.0

File hashes

Hashes for smaf-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be1f0e927aca45bc9369be1840ce1c21bc6e6b590572755e8c88973751d99813
MD5 7177156167bbb7f0d17ada904de19ccf
BLAKE2b-256 dc965c3bdccbcb26195e6fcfe5bb2f1fcfa2ccccf42fb0c8adea928c533d96c0

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