Pluggable skills for AI agents
Project description
SkillPacks
Pluggable skillsets for AI agents
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Skillpacks provide a means of fine tuning agents on tools, and the ability to hotswap learned skills at inference time.
Teach a model how to use a website | code base | API | database | application | ... then swap in that learned layer the moment you need it.
Install
pip install skillpacks
Quick Start
Create an episode to record agent events
from skillpacks import Episode
episode = Episode(remote="https://foo.bar")
Take an action
from mllm import Router, RoleThread
from skillpacks import V1Action
from agentdesk import Desktop
router = Router.from_env()
desktop = Desktop.local()
thread = RoleThread()
msg = f"""
I need to open Google to search, your available action are {desktop.json_schema()}
please return your selection as {V1Action.model_json_schema()}
"""
thread.post(role="user", msg=msg)
response = router.chat(thread, expect=V1Action)
v1action = response.parsed
action = desktop.find_action(name=v1action.name)
result = desktop.use(action, **v1action.parameters)
Record the action in the episode
event = episode.record(
prompt=response.prompt_id,
action=v1action,
tool=desktop.ref(),
result=result,
)
Mark actions as approved
# approve one
episode.approve_one(event.id)
# approve the event and all actions prior to it
episode.approve_prior(event.id)
# approve all
episode.approve_all()
Get all approved actions in an episode
episode = Episode.find(id="123")[0]
actions = episode.approved_actions()
Get all approved actions in a namespace
from skillpacks import ActionEvent
actions = ActionEvent.find(namespace="foo", approved=True)
Get all approved actions for a tool
actions = ActionEvent.find(tool=desktop.ref(), approved=True)
Tune a model on the actions (In progress)
from skillpacks.model import InternVLChat
from skillpacks.runtime import KubernetesRuntime
runtime = KubernetesRuntime()
model = InternVLChat(runtime=runtime)
result = model.train(actions=actions, follow=True, publish=True)
Backends
Thread and prompt storage can be backed by:
- Sqlite
- Postgresql
Sqlite will be used by default. To use postgres simply configure the env vars:
DB_TYPE=postgres
DB_NAME=skills
DB_HOST=localhost
DB_USER=postgres
DB_PASS=abc123
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file skillpacks-0.1.6.tar.gz
.
File metadata
- Download URL: skillpacks-0.1.6.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9c7ce2dd606a2f9a5252cf86a7f8ab2286155ed2713a0141ce0333c2a8aa78c |
|
MD5 | 5bec260db32bf2ee5d05ab2e13153a4c |
|
BLAKE2b-256 | e5ec53b9cec13fbcaebeeac4191733405088eb6779f265fd2a756eed1102ae57 |
File details
Details for the file skillpacks-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: skillpacks-0.1.6-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c631ce524c08011ff9ee571ebcc78ed359112f7d3972bf2a1d5ce37f98976e |
|
MD5 | 8ba18654c1edb2a09a18389101a30b37 |
|
BLAKE2b-256 | 1f7039cc1a8bd551d281ae18ef6d6bc6f57c241b09c66bbe6363637986867d74 |