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.1.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.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: action_collective-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 38ef4a9de7c620f6eae17e8f63ade052a8a8fab0f133ff28d42238df7cda14f8
MD5 02e64148b3711c6e1a5666980441ec73
BLAKE2b-256 ef497f5400619e9cd0e455589b57cc1141c2734cb6bc7e8e188265389b154fd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: action_collective-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aaaa024383c9ce40e5d78ad744a3757ecdbc2db12b7a59443070158bb4eb1917
MD5 88f24e705d98b0fa13a28f328a2c6593
BLAKE2b-256 0a825d16bf8a81bfcb9b0c5a21d989207ccec2268492730410a982a82fe6e8f9

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