Skip to content

cacosandon/smarf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Smart, code-aware functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages