This project demonstrates a simplified approach to enable Large Language Models (LLMs) like ChatGPT or Llama to perform function calls effectively without relying on complex frameworks. The repository provides examples and tools to execute function calls with clear and predictable outcomes. In detail, refer to the below reference.
- Effective and simplified LLM function call for AI agent development
- Gemma3-based Funcation Call Implement for AI Agent
- Minimal dependencies
- Simplified prompt design with function prototypes
- Python runtime execution using
exec - Easy-to-understand mechanism
- Simple ReAct implementation for AI Agent
- Gemma3 based function call web app example
-
Clone the repository:
git clone https://github.com/mac999/AI_agent_simple_function_call.git cd AI_agent_simple_function_call -
Install the required dependencies:
pip install langchain-core langchain-openai gradio ollama requests python-dotenv pydantic
Additionally, ensure you have the following standard libraries (most are included by default with Python):
- Define your function prototypes in Python.
- Customize the prompts as needed.
- Run the examples provided to understand the workflow.
python llm_func_call_for_ai_agent.pyRefer to the included examples in the repository to learn how to:
- Set up LLMs for function calls
- Use function prototypes for better results
- Execute generated Python code
The react_agent.py script demonstrates a simple ReAct agent using the OpenAI API. Install the openai package and set the OPENAI_API_KEY environment variable before running.
python react_agent.py "What is 2+2?"python react_agent.py -iType exit to quit the chat.
This source code implements the essential function call method for developing AI agents. It's contents of the Function Call practice using Ollama based on Gemma3 LLM (Large Language Model).
python ai_agent_func_call_gemma3.pyContributions are welcome! Please fork the repository and submit a pull request with your improvements.
This project is licensed under the MIT License.
- Taewook Kang
Email: laputa99999@gmail.com
