AI-Functions  by Torantulino

AI function calling with GPT models

created 2 years ago
938 stars

Top 39.9% 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

8 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Travis Fischer Travis Fischer(Founder of Agentic), and
3 more.

AlphaCodium by Codium-ai

0.2%
4k
Code generation research paper implementation
created 1 year ago
updated 8 months ago
Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake), and
21 more.

guidance by guidance-ai

0.1%
21k
Guidance is a programming paradigm for steering LLMs
created 2 years ago
updated 1 day ago
Feedback? Help us improve.