AI-Functions  by Torantulino

AI function calling with GPT models

Created 2 years ago
937 stars

Top 39.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a Python library for leveraging large language models (LLMs) like GPT-4 to execute code based on natural language descriptions. It's designed for developers and researchers seeking to automate code generation and execution tasks, offering a simplified interface to LLM-driven function calls.

How It Works

The core ai_function utility takes a function signature string, a list of arguments, and a natural language description of the function's purpose. It then prompts an LLM (defaulting to GPT-4) to generate the function's body and execute it with the provided arguments. This approach allows for dynamic code generation and execution based on high-level instructions, abstracting away the complexities of LLM interaction for specific tasks.

Quick Start & Requirements

  • Install via pip: pip install -r requirements.txt
  • Requires an OpenAI API key, configured via keys.py or environment variables.
  • Tested with Python 3.x.

Highlighted Details

  • Supports GPT-4 and GPT-3.5-turbo, with varying success rates for different tasks.
  • Includes a test_ai_functions.py script for evaluating function performance.
  • Demonstrates capabilities in data generation, password creation, and text encryption.

Maintenance & Community

  • Contributions are welcome via pull requests.
  • Inspired by the "Ask Marvin" project.

Licensing & Compatibility

  • The repository does not explicitly state a license.

Limitations & Caveats

The project explicitly notes that AI Functions are not suited for tasks requiring mathematical precision, as demonstrated by failures in calculating triangle areas and prime numbers. LLMs may struggle with accurate arithmetic and precise interpretation of numerical inputs.

Health Check
Last Commit

10 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.