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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smaf-0.1.3.tar.gz.
File metadata
- Download URL: smaf-0.1.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.9 Darwin/23.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f06f3dd23cda77afead20c5dd0c2f4e4a88c5beb1ab3e02994c09f2226357b50
|
|
| MD5 |
e9ec6aceaa8a80262d3495dc0f9818b5
|
|
| BLAKE2b-256 |
400952837fd50b619a5f28a7728bf577b06b3a75c8188f423b7e9e6f3aa8a25d
|
File details
Details for the file smaf-0.1.3-py3-none-any.whl.
File metadata
- Download URL: smaf-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fbd7fea552ca214f40a65fb1c726e0ee24f58565371f542f81f6181972b75ec
|
|
| MD5 |
f2bdc84ff55151937218853c6de539b5
|
|
| BLAKE2b-256 |
f9685f9d2afa83e2b4155a28cc22c0a712348508bc71c72a81382e4d029c6e02
|