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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file action_collective-0.0.2.tar.gz.
File metadata
- Download URL: action_collective-0.0.2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70f06bb8b68700bf1325021b7c1a49a1b12eea2c87c5a0caf36451e0c67015e2
|
|
| MD5 |
754005a4a5ae46280c0fbda116caae79
|
|
| BLAKE2b-256 |
3dcede9ba8c25e8d627dde7210b308fa25ffa60b60a7a6669bfc5a580719704d
|
File details
Details for the file action_collective-0.0.2-py3-none-any.whl.
File metadata
- Download URL: action_collective-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b5362763f5dc9004915040df661477c1dbf613327b85ef2c64551d8adc8dd2
|
|
| MD5 |
04ba78e2ee9d7d74dba2ea52248ce0e9
|
|
| BLAKE2b-256 |
9c18ea95242fce8490f30f33f6fc42c01cd8b1c0519f8a74176161f9a838e088
|