https://github.com/wenyuzhao/agentia
Simple ChatGPT API wrapper with function calls
https://github.com/wenyuzhao/agentia
ai chatgpt chatgpt-api chatgpt-plugins gpt python
Last synced: about 1 year ago
JSON representation
Simple ChatGPT API wrapper with function calls
- Host: GitHub
- URL: https://github.com/wenyuzhao/agentia
- Owner: wenyuzhao
- License: mit
- Created: 2023-06-14T18:10:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T07:44:00.000Z (about 1 year ago)
- Last Synced: 2025-03-28T07:46:45.886Z (about 1 year ago)
- Topics: ai, chatgpt, chatgpt-api, chatgpt-plugins, gpt, python
- Language: Python
- Homepage:
- Size: 1.01 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Agentia: Ergonomic LLM Agent Augmented with Tools
## Getting Started
```python
from agentia import Agent
from typing import Annotated
# Define a tool as a python function
def get_weather(location: Annotated[str, "The city name"]):
"""Get the current weather in a given location"""
return { "temperature": 72 }
# Create an agent
agent = Agent(tools=[get_weather])
# Run the agent with the tool
response = await agent.chat_completion("What is the weather like in boston?")
print(response)
# Output: The current temperature in Boston is 72°F.
```
## Create an Agent from a Config File
1. Create a config file at `./alice.yml`
```yaml
name: Alice
icon: 👩
instructions: You are a helpful assistant
tools:
clock:
calculator:
# ... other tools
```
2. In your python code:
```python
agent = Agent.load_from_config("./alice.yml")
```
3. Alternatively, start a REPL:
```bash
pipx install agentia
agentia repl alice
```