alana


Namealana JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttps://github.com/alat-rights/alana-utilities
SummaryUtilities for Alana, and maybe you too. Mostly geared toward LLM-heavy workflows.
upload_time2024-04-28 16:09:31
maintainerNone
docs_urlNone
authorAlana
requires_python>=3.6
licenseNone
keywords llm utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
🎵 Note: I have been making new releases frequently. Make sure your package is up-to-date!

⚠️ Warning: This library is in active early development! No guarantees are made for backward compatibility. The library is NOT production-ready.

## Is this for me?
This library is mostly designed for me (hence the name), but they might be helpful for you too!

Here are some questions to ask yourself when considering whether to use this library:
- Do you interact with LLMs? (Currently, only Anthropic LLMs are supported).
- Do you value conciseness?
- Are you writing **non-production prototype code**, where 1, occassional bugs and behavioral changes are acceptable, and 2, developer ergonomics are more important than performance?
  - Note: This library *strongly* assumes this use-case! e.g. `alana.gen` actually writes to the console by default (you can disable this with `loud=False`).
- Do the features appeal to you?

## Philosophy:
- Programming is too slow! This is doubly true when you're interacting with LLMs. By building nice utilities with sane defaults, I hope to speed up my (and maybe your) workflow.
- I make trade-offs to speed up the developer experience:
  - I do not try hard to anticipate future upstream API changes. I'm also ok with breaking backward compatibility to make my functions more concise and more usable.
  - Usability > Principles. While I don't relish in it, I'm ok with breaking conventions designed for large production libraries if it speeds up programmers who use `alana`. The priority is to make the library intuitive and fast.
  - I don't try to serve every use-case.
- Simplicity is key. This library strives to be readable and straightforward.

## Motivating Examples:
(I tested these, and tried to make sure my code was idiomatic in all cases. Sorry if I messed up! Please report any issues to `h i ( a t ) [pip package name for this library] dot computer`.)

Continuing a list of messages using Anthropic API (adapted from [Anthropic API documentation](https://docs.anthropic.com/claude/reference/messages_post):
```
import anthropic
from anthropic.types import MessageParam
messages = [
  MessageParam(
    role="user",
    content="Hello, Claude!"
  ),
]
output_text = anthropic.Anthropic().messages.create(
    model="claude-3-opus-20240229",
    max_tokens=1024,
    messages=messages
).content[0].text
messages.append(
  MessageParam(
    role="assistant",
    content=output_text
  )
)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
```

Equivalent `alana` code:
```
import alana
messages = []
alana.gen(user="Hello, Claude!", messages=messages, model="opus", max_tokens=1024)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
```

Also, equivalent `alana` code thanks to defaults:
```
import alana
messages = []
alana.gen(user="Hello, Claude!", messages=messages)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
```
   

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alat-rights/alana-utilities",
    "name": "alana",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "LLM, utilities",
    "author": "Alana",
    "author_email": "hi@alana.computer",
    "download_url": "https://files.pythonhosted.org/packages/4b/3f/7cf3b298f3c3a1b124e2fcd03e722aa849acd6f754d2665868ea0d1b74cc/alana-0.0.9.tar.gz",
    "platform": null,
    "description": "\n\ud83c\udfb5 Note: I have been making new releases frequently. Make sure your package is up-to-date!\n\n\u26a0\ufe0f Warning: This library is in active early development! No guarantees are made for backward compatibility. The library is NOT production-ready.\n\n## Is this for me?\nThis library is mostly designed for me (hence the name), but they might be helpful for you too!\n\nHere are some questions to ask yourself when considering whether to use this library:\n- Do you interact with LLMs? (Currently, only Anthropic LLMs are supported).\n- Do you value conciseness?\n- Are you writing **non-production prototype code**, where 1, occassional bugs and behavioral changes are acceptable, and 2, developer ergonomics are more important than performance?\n  - Note: This library *strongly* assumes this use-case! e.g. `alana.gen` actually writes to the console by default (you can disable this with `loud=False`).\n- Do the features appeal to you?\n\n## Philosophy:\n- Programming is too slow! This is doubly true when you're interacting with LLMs. By building nice utilities with sane defaults, I hope to speed up my (and maybe your) workflow.\n- I make trade-offs to speed up the developer experience:\n  - I do not try hard to anticipate future upstream API changes. I'm also ok with breaking backward compatibility to make my functions more concise and more usable.\n  - Usability > Principles. While I don't relish in it, I'm ok with breaking conventions designed for large production libraries if it speeds up programmers who use `alana`. The priority is to make the library intuitive and fast.\n  - I don't try to serve every use-case.\n- Simplicity is key. This library strives to be readable and straightforward.\n\n## Motivating Examples:\n(I tested these, and tried to make sure my code was idiomatic in all cases. Sorry if I messed up! Please report any issues to `h i ( a t ) [pip package name for this library] dot computer`.)\n\nContinuing a list of messages using Anthropic API (adapted from [Anthropic API documentation](https://docs.anthropic.com/claude/reference/messages_post):\n```\nimport anthropic\nfrom anthropic.types import MessageParam\nmessages = [\n  MessageParam(\n    role=\"user\",\n    content=\"Hello, Claude!\"\n  ),\n]\noutput_text = anthropic.Anthropic().messages.create(\n    model=\"claude-3-opus-20240229\",\n    max_tokens=1024,\n    messages=messages\n).content[0].text\nmessages.append(\n  MessageParam(\n    role=\"assistant\",\n    content=output_text\n  )\n)\nprint(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': \"Hello! It's nice to meet you. How are you doing today?\"}]\n```\n\nEquivalent `alana` code:\n```\nimport alana\nmessages = []\nalana.gen(user=\"Hello, Claude!\", messages=messages, model=\"opus\", max_tokens=1024)\nprint(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': \"Hello! It's nice to meet you. How are you doing today?\"}]\n```\n\nAlso, equivalent `alana` code thanks to defaults:\n```\nimport alana\nmessages = []\nalana.gen(user=\"Hello, Claude!\", messages=messages)\nprint(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': \"Hello! It's nice to meet you. How are you doing today?\"}]\n```\n   \n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Utilities for Alana, and maybe you too. Mostly geared toward LLM-heavy workflows.",
    "version": "0.0.9",
    "project_urls": {
        "Homepage": "https://github.com/alat-rights/alana-utilities"
    },
    "split_keywords": [
        "llm",
        " utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb8d3056c20ecd6359412693610d75e5046b5d950d02512d53f2f4741f461b1e",
                "md5": "7c4204c43312a6cdf09a47cc2cf3799b",
                "sha256": "ca8f1f503c320e9debac6bb641af2822d1d4699529b4c8e3bc46fa73e8563e13"
            },
            "downloads": -1,
            "filename": "alana-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c4204c43312a6cdf09a47cc2cf3799b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 17667,
            "upload_time": "2024-04-28T16:09:30",
            "upload_time_iso_8601": "2024-04-28T16:09:30.386986Z",
            "url": "https://files.pythonhosted.org/packages/fb/8d/3056c20ecd6359412693610d75e5046b5d950d02512d53f2f4741f461b1e/alana-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b3f7cf3b298f3c3a1b124e2fcd03e722aa849acd6f754d2665868ea0d1b74cc",
                "md5": "3f5990f71e018ece6711d580a4756fdc",
                "sha256": "78d1b993684eff84f73b3d2052e12495a8f952f0f3d82a1f71e377efc854de60"
            },
            "downloads": -1,
            "filename": "alana-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "3f5990f71e018ece6711d580a4756fdc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14876,
            "upload_time": "2024-04-28T16:09:31",
            "upload_time_iso_8601": "2024-04-28T16:09:31.408719Z",
            "url": "https://files.pythonhosted.org/packages/4b/3f/7cf3b298f3c3a1b124e2fcd03e722aa849acd6f754d2665868ea0d1b74cc/alana-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 16:09:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alat-rights",
    "github_project": "alana-utilities",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "alana"
}
        
Elapsed time: 0.24385s