Skip to content

electro199/simple-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-agents

A simple package for function calling package. Easy to use and straight forward.

Installation

pip install git+https://github.com/electro199/simple-agents.git

Usage

Adding tools

from function_caller import tool_func

@tool_func
def print_to_console(msg: str) -> None:
    "print the given msg(str) to console"

    print(msg)

Retriving Tools

you can you get relevant tools

Tools=get_relevant_tools("Can you print in console ?")

With ollama and tools usage :

import ollama
from simple_agents.tools_generator import get_relevant_tools, tools, tool_func, call_tools

@tool_func
def print_to_console(msg: str) -> str:
    "print the given msg(str) to console"

    print(msg)
    return "print_to_console" + msg 

client = ollama.Client()
chat = "Can you print in console ?"
response = client.chat(
        model="llama3.1",
        messages=messages,
        tools=get_relevant_tools(chat),
        options=ollama.Options(temperature=0.5),
    )
if response["message"].get("tool_calls"):
    print(call_tools(response["message"]["tool_calls"]))

About

LLM function calling library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages