action-collective


Nameaction-collective JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/CakeCrusher/ActionCollective
SummaryA framework for dynamic action generation and reuse with LLMs
upload_time2024-12-18 04:31:53
maintainerNone
docs_urlNone
authorSebastian Sosa
requires_python<4.0,>=3.9
licenseMIT
keywords llm ai actions tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Action Collective

A framework for dynamic action generation and reuse with LLMs.

## Installation

```bash
pip install action-collective
```

## Quick Start

```python
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](https://github.com/yourusername/ActionCollective).
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CakeCrusher/ActionCollective",
    "name": "action-collective",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "llm, ai, actions, tools",
    "author": "Sebastian Sosa",
    "author_email": "1sebastian1sosa1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4e/c4/174b35114e527d31343e58fb36ea93f1054a21ea36ffa72925f5cca05e2a/action_collective-0.0.4.tar.gz",
    "platform": null,
    "description": "# Action Collective\n\nA framework for dynamic action generation and reuse with LLMs.\n\n## Installation\n\n```bash\npip install action-collective\n```\n\n## Quick Start\n\n```python\nfrom action_collective import ActionClient\n\nclient = ActionClient(\n    openai_api_key=os.getenv(\"OPENAI_API_KEY\"),\n    backend_url=os.getenv(\"BACKEND_URL\", \"http://70.179.0.242:11000\"),\n    verbose=True,\n)\nprompt = \"\"\"Please perform the matrix multiplication of A x B and return the result, here are the variables:\nA = [[1, 2, 3, 4, 5],\n        [6, 7, 7, 9, 10],\n        [11, 12, 13, 14, 15],\n        [16, 17, 7, 19, 20],\n        [21, 22, 23, 24, 25]]\nB = [[1, 2, 3, 4, 5],\n        [6, 7, 8, 9, 10],\n        [11, 12, 7, 14, 15],\n        [16, 17, 18, 19, 20],\n        [21, 22, 23, 24, 25]]\"\"\"\n\nchat_history = [{\"role\": \"user\", \"content\": prompt}]\n\nresult = await client.execute(chat_history=chat_history)\nprint(\"\\n\\nresult:\\n\", json.dumps(result, indent=4), \"\\n\\n\")\nmatrix = [\n    [215, 230, 227, 260, 275],\n    [479, 518, 515, 596, 635],\n    [765, 830, 817, 960, 1025],\n    [919, 998, 1035, 1156, 1235],\n    [1315, 1430, 1407, 1660, 1775],\n]\n# validate that each of the number inside matrix exist in the result string\nassert result is not None\nfor row in matrix:\n    for number in row:\n        assert str(number) in result[-1][\"content\"]\nprint(\"\\n\\nPASSED\\n\\n\")\n```\n\n## Features\n\n- Dynamic action generation\n- Action reuse through vector similarity\n- Automatic validation and testing\n- Easy integration with OpenAI models\n\n## Documentation\n\nFor full documentation, visit our [GitHub repository](https://github.com/yourusername/ActionCollective).",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A framework for dynamic action generation and reuse with LLMs",
    "version": "0.0.4",
    "project_urls": {
        "Documentation": "https://github.com/CakeCrusher/ActionCollective",
        "Homepage": "https://github.com/CakeCrusher/ActionCollective",
        "Repository": "https://github.com/CakeCrusher/ActionCollective"
    },
    "split_keywords": [
        "llm",
        " ai",
        " actions",
        " tools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e09207dfc14adc5596f882d50d5e27b6c07047f97232d4270095865fbbe47bb4",
                "md5": "1eea99e11fdb6070f797854531cd4a28",
                "sha256": "c608974cb514a451c3ac7940fd5304b49b6675b8dc68f05f22bf58f130884608"
            },
            "downloads": -1,
            "filename": "action_collective-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1eea99e11fdb6070f797854531cd4a28",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 7748,
            "upload_time": "2024-12-18T04:31:51",
            "upload_time_iso_8601": "2024-12-18T04:31:51.387735Z",
            "url": "https://files.pythonhosted.org/packages/e0/92/07dfc14adc5596f882d50d5e27b6c07047f97232d4270095865fbbe47bb4/action_collective-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ec4174b35114e527d31343e58fb36ea93f1054a21ea36ffa72925f5cca05e2a",
                "md5": "b0dfdbe951aac967305f7cd8f9f132bd",
                "sha256": "6263a4e216fddbb11d2787faa7aca362677938c2e9da7c35bedd08be376eb640"
            },
            "downloads": -1,
            "filename": "action_collective-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b0dfdbe951aac967305f7cd8f9f132bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 6038,
            "upload_time": "2024-12-18T04:31:53",
            "upload_time_iso_8601": "2024-12-18T04:31:53.802020Z",
            "url": "https://files.pythonhosted.org/packages/4e/c4/174b35114e527d31343e58fb36ea93f1054a21ea36ffa72925f5cca05e2a/action_collective-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-18 04:31:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CakeCrusher",
    "github_project": "ActionCollective",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "action-collective"
}
        
Elapsed time: 0.39707s