Skip to main content

A framework for dynamic action generation and reuse with LLMs

Project description

Action Collective

A framework for dynamic action generation and reuse with LLMs.

Installation

pip install action-collective

Quick Start

from action_collective import ActionClient

client = ActionClient(
    openai_api_key=os.getenv("OPENAI_API_KEY"),
    backend_url=os.getenv("BACKEND_URL", "http://70.179.0.242:11000"),
    verbose=True,
)
prompt = """Please perform the matrix multiplication of A x B and return the result, here are the variables:
A = [[1, 2, 3, 4, 5],
        [6, 7, 7, 9, 10],
        [11, 12, 13, 14, 15],
        [16, 17, 7, 19, 20],
        [21, 22, 23, 24, 25]]
B = [[1, 2, 3, 4, 5],
        [6, 7, 8, 9, 10],
        [11, 12, 7, 14, 15],
        [16, 17, 18, 19, 20],
        [21, 22, 23, 24, 25]]"""

chat_history = [{"role": "user", "content": prompt}]

result = await client.execute(chat_history=chat_history)
print("\n\nresult:\n", json.dumps(result, indent=4), "\n\n")
matrix = [
    [215, 230, 227, 260, 275],
    [479, 518, 515, 596, 635],
    [765, 830, 817, 960, 1025],
    [919, 998, 1035, 1156, 1235],
    [1315, 1430, 1407, 1660, 1775],
]
# validate that each of the number inside matrix exist in the result string
assert result is not None
for row in matrix:
    for number in row:
        assert str(number) in result[-1]["content"]
print("\n\nPASSED\n\n")

Features

  • Dynamic action generation
  • Action reuse through vector similarity
  • Automatic validation and testing
  • Easy integration with OpenAI models

Documentation

For full documentation, visit our GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

action_collective-0.0.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

action_collective-0.0.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file action_collective-0.0.3.tar.gz.

File metadata

  • Download URL: action_collective-0.0.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.0 Windows/10

File hashes

Hashes for action_collective-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bd0b18a2d353e3cd13e4f92e760c9239686f0992bb778baf7a9080a14566bf80
MD5 bd7dd050760c8edb7191b1fd265bf2a4
BLAKE2b-256 73a28d190231097ac5b587c9920cde1551badcdd2bc92822f54afd8ed461e6cc

See more details on using hashes here.

File details

Details for the file action_collective-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: action_collective-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.0 Windows/10

File hashes

Hashes for action_collective-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1aaa956a6c531596a00133b1f9daba04d725282b25b5af04fc740b0e39c216f
MD5 64d85b7c3b3cc199e45c38e29142e5bb
BLAKE2b-256 0452a0b3694fec04664c111b703cb8e966604070ed68249e9c15c388fe4ef8ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page