Skip to main content

Smart, code-aware functions.

Project description

SMARF: Smart, Code-Aware Functions

SMARF (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 SMARF, use pip:

pip install smarf

Or if you're using Poetry:

poetry add smarf

Usage

from smarf.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

smarf-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

smarf-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file smarf-0.1.0.tar.gz.

File metadata

  • Download URL: smarf-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 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 smarf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dcfc445279c3b23604d99364c687ff3db73c94a110ab4d9a118523bdc56fbc18
MD5 f84d12ac6fe60bedbe3ab5a1662982e4
BLAKE2b-256 06383ea6d9c35e75f21b01a7599d1a3155ee7983f514dd84532b6924a4a5279f

See more details on using hashes here.

File details

Details for the file smarf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: smarf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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 smarf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efaa3269d506b91cf53dcf2a37dac683a03aef353123e3bf31076c92c6b472ad
MD5 17ce456ba9b9278f7d6830362fc11460
BLAKE2b-256 a4c0a40fcc7468bb21f2bd0ded995dae09c1d6e801a65e5bb3fe98d1ec90ab72

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