← Open Source
Torantulino

AI-Functions

AI-Powered Function Magic: Never code again with GPT models.

AI EngineeringPrompt & ScaffoldPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
936
Stars
102
Forks
+1
This week
5
Contributors
Created 2023-04-01 · Updated 2026-10-13 · #12528 today
Top developers

Torantulino/AI-Functions is ranked 12,528 with 936 stars.

Same-category comparison

Torantulino/AI-Functions is ranked 12,528 among these 8 peers; GAIR-NLP/factool is ranked 12,534.

Same-category comparison
NameRankMetrics
Anarkh-Lee/universal-db-mcp12,502
Language:
TypeScript
Stars:
940
Forks:
92
AndersonBY/vector-vein12,503
Language:
Vue
Stars:
940
Forks:
140
Description:
No-code AI workflow. Drag and drop workflow nodes and use your workflow with your AI agents.
Soulter/hugging-chat-api12,511
Language:
Python
Stars:
938
Forks:
134
Description:
HuggingChat Python API🤗.
fluffypony/dothething12,514
Language:
Shell
Stars:
938
Forks:
169
Description:
an autonomous AI agent: you describe the thing, it does the thing.
GAIR-NLP/factool12,534
Language:
Python
Stars:
935
Forks:
67
Description:
FacTool: Factuality Detection in Generative AI.
Thytu/Agentarium12,537
Language:
Python
Stars:
935
Forks:
75
Description:
open-source framework for creating and managing simulations populated with AI-powered agents. It provides an intuitive platform for designing complex, interactive environments where agents can act, learn, and evolve.
skapadia3214/groq-moa12,539
Language:
Python
Stars:
935
Forks:
167
Description:
Mixture of Agents using Groq.
kx-Huang/ChatGPT-on-WeChat12,547
Language:
TypeScript
Stars:
933
Forks:
370
Description:
🤖️ Deploy GPT-4o ChatGPT on your WeChat within 2 steps.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryAI Engineering
SubcategoryPrompt & Scaffold
KeywordsStructured outputs
Stars936
Forks102
Contributors5
Created date2023-04-01
Updated date2026-10-13
Stars in 1 day0
Stars in 7 days1
Rank12,528
Previous rank12,451
Rank change-77
7-day stars rank10,410
Previous 7-day stars rank10,463
7-day stars rank change53
Total stars rank11,717
Previous total stars rank11,700
Total stars rank change-17
CountryUK
README summary

AI Functions 🤖👩‍💻 Example: An easy-to-use implementation of AI functions using OpenAI's GPT-4 (or any other model version) to perform various tasks. This project is heavily inspired by Ask Marvin. Obtain an OpenAI API key and store it in a file in the same directory as the scripts or set it as an environment variable. py contains the following function: The takes the following parameters: : A string describing the function signature. : A string describing the purpose of the

function. : (Optional) A string specifying the GPT model to use. Example usage: Limitations The table below shows the success rate of the AI functions with different GPT models: | Description | GPT-4 Result | GPT-3. As observed in the case of calculating the area of a triangle and finding the nth prime number, GPT models can struggle with providing accurate results. The limitations of GPT models in such cases are mainly due to their inherent inability to perform precise arithmetic and

the ambiguity in understanding user inputs. In conclusion, while AI Functions can be helpful in various scenarios, they may not be the optimal choice for tasks requiring mathematical accuracy or specific domain knowledge. For such use-cases, utilizing traditional algorithms and libraries would yield better results. To run the tests, execute the script with Python: The test script will output the results of each test case and provide a success rate. If you would like to add more test cases

or improve the existing code, please feel free to submit a pull request.

Frequently asked questions

How many stars and forks are recorded?

Torantulino/AI-Functions has 936 stars and 102 forks.

What is the repository rank?

Torantulino/AI-Functions is ranked 12,528.

What language and category are recorded?

Torantulino/AI-Functions has 936 stars, uses Python and belongs to AI Engineering.

Which repository is closest in rank?

Torantulino/AI-Functions is compared with GAIR-NLP/factool, ranked 12,534 with 935 stars.

README

AI Functions 🤖👩‍💻

Example:

function_string = "def fake_people(n: int) -> list[dict]:"
args = ["4"]
description_string = """Generates n examples of fake data representing people, each with a name and an age."""

result = ai_functions.ai_function(function_string, args, description_string, model)

""" Output: [
  {"name": "John Doe", "age": 35},
  {"name": "Jane Smith", "age": 28},
  {"name": "Alice Johnson", "age": 42},
  {"name": "Bob Brown", "age": 23}
]"""

An easy-to-use implementation of AI functions using OpenAI's GPT-4 (or any other model version) to perform various tasks. This project is heavily inspired by Ask Marvin.

Installation

  1. Clone the repository:
git clone https://github.com/YourUsername/SuperSimpleAIFunctions.git
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Obtain an OpenAI API key and store it in a keys.py file in the same directory as the scripts or set it as an environment variable.

Usage

ai_functions.py

ai_functions.py contains the following function:

def ai_function(function, args, description, model="gpt-4"):

The ai_function takes the following parameters:

  • function: A string describing the function signature.
  • args: A list of arguments for the function.
  • description: A string describing the purpose of the function.
  • model: (Optional) A string specifying the GPT model to use. Default is 'gpt-4'.

Example usage:

import ai_functions

function = "def add(a: int, b: int) -> int:"
args = ["5", "7"]
description = "Adds two integers."

result = ai_functions.ai_function(function, args, description)
print(result)  # Output: 12

Limitations

The table below shows the success rate of the AI functions with different GPT models:

Description GPT-4 Result GPT-3.5-turbo Result Reason
Generate fake people PASSED FAILED Incorrect response format
Generate Random Password PASSED PASSED N/A
Calculate area of triangle FAILED FAILED Incorrect float value (GPT-4), Incorrect response format (GPT-3.5-turbo)
Calculate the nth prime number PASSED PASSED N/A
Encrypt text PASSED PASSED N/A
Find missing numbers PASSED PASSED N/A

It's important to note that AI Functions are not suited for certain tasks, particularly those involving mathematical calculations and precision. As observed in the case of calculating the area of a triangle and finding the nth prime number, GPT models can struggle with providing accurate results. The limitations of GPT models in such cases are mainly due to their inherent inability to perform precise arithmetic and the ambiguity in understanding user inputs.

In conclusion, while AI Functions can be helpful in various scenarios, they may not be the optimal choice for tasks requiring mathematical accuracy or specific domain knowledge. For such use-cases, utilizing traditional algorithms and libraries would yield better results.

test_ai_functions.py

test_ai_functions.py contains test cases for the ai_function. To run the tests, execute the script with Python:

python test_ai_functions.py

The test script will output the results of each test case and provide a success rate.

Contributing

Contributions are welcome! If you would like to add more test cases or improve the existing code, please feel free to submit a pull request.

Nearby in the ranking
Similar items