Catalog PyPI
PACKAGE EXPLORERView in registry

agentscript

PyPI

A programming language for AI agents

Versions collected1
Direct dependencies5From release 0.1.3
Last observed20 Oct, 23:18 UTC

README

Version 0.1.3 documentation

Agentscript

A programming language for AI agents
Explore the docs »

View Demo · Report Bug · Request Feature


Agentscript is an isomorphic programming language for AI agents, it includes both a server-side interpreter and browser-based renderer.

▶ On the server, agenscript directly interprets LMM outputs and executes actions in a streaming manner.

▶ In the browser, agentscript renders LLM outputs in a rich manner and provides live updates.

Server-side Interpreter

The server-side interpreter is capable of executing actions in a streaming manner, and supplying updates on their results to the UI.

Install

pip install agentscript

Usage

Execute the translator tool from Python

from agentscript import Interpreter, Use
from toolfuse import Tool, action

# Create a fake translator tool
class Translator(Tool):
    """A fake translator tool"""

    @action
    def translate(self, text: str) -> str:
        return "Hola"


# Add the tool to the Use command
cmd = Use(tools=[Translator()])

# Create the interpreter supplying our Use command
interpreter = Interpreter(commands=[cmd])

# Parse the script, find the tool, and execute it
interpreter.execute("""
We need to do translation <{"type": "use", "tool": "Translator", "action": "translate", "parameters": {"text": "Hello", "options": {"from": "en", "to": "es"}}}>
""")

# Show the past invocations with the results
print(interpreter.invocations())

Browser-based Renderer

Install

npm i @agentsea/agentscript

Usage

import Agentscript from "@agentsea/agentscript";

(
  <Agentscript text="I created this image for you <Image url='https://any.url' />" url="...">
)

Components

Boolean

(
  <Agentscript text="Does this work for you? <Boolean />" >
)

Image

(
  <Agentscript text="I created this image for you <Image src='https://any.url' />"">
)

Invoke

(
  <Agentscript text='Lets check the weather <Invoke tool="Weather" action="get" parameters={"location": "Madrid"} />'>
)

Dialects

The above components are known as the common dialect, but you can create your own dialects as well

Roadmap

Programable LLMs

Give agentscript the ability to program an LLM. Here we load a LoRA into a PEFT compatible LLM

interpreter.execute("I need to load the weather LoRA <Load lora='weather' />")

Browser components

  • Select One
  • Select Any
  • Video
  • Plan
  • References
  • Image with bounding box
  • Task
  • Markdown
  • Code blocks

Develop

To test

make test

To publish

make publish

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.329 Mar 20245

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:18 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d3d637bd00cd84763758d6cfbbe903a2d81fae8cd6d27fe30d38654ebde5d096