Skip to main content

No project description provided

Project description

XNANO

xnano is the lightweight implementation zyx was meant to be. Documentation will be added soon.

install

pip install xnano

or

# for chromadb & litellm preinstalled
pip install 'xnano[all]'

basic usage

import xnano as x

# define a tool
def get_favorite_color() -> str:
    return "blue"


# automatic tool execution
x.completion(
    "what is my favorite color?",
    model = "gpt-4o-mini"          # all litellm models supported
    tools = [get_favorite_color]
)

Easy LLM & Pydantic BaseModel Integration

from xnano import BaseModel

class User(BaseModel):
    name: str
    age: int
    favorite_color: str

# This will generate 5 instances of the User class
User.generate(n=5)

Generate Fields Sequentially (Chain-Of-Thought)

User.generate(
    model = "anthropic/claude-3.5",
    process = "sequential"            # defaults to 'batch'
)

Optimized Schema Regeneration

user = User(
    name = "John Doe",
    age = 25,
    favorite_color = "blue"
)

user.patch(
    fields = ["name"],
    instructions = "The user's name has changed to John Smith"
)

# or user.regenerate() (not as strict)

# from xnano import patch can run the patch logic automatically from message threads.

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

xnano-0.0.28.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

xnano-0.0.28-py3-none-any.whl (67.2 kB view details)

Uploaded Python 3

File details

Details for the file xnano-0.0.28.tar.gz.

File metadata

  • Download URL: xnano-0.0.28.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for xnano-0.0.28.tar.gz
Algorithm Hash digest
SHA256 a550271c330f9fcd4a6d8b4371831ab483ba666a2a646afc029fb26f7ad745c6
MD5 4e6a386422c88bea00751e11bb1419b7
BLAKE2b-256 039bfe91a8b5b851169b5b7780eb9d15326af7984388cdcb3e6f724f0f5d6549

See more details on using hashes here.

File details

Details for the file xnano-0.0.28-py3-none-any.whl.

File metadata

  • Download URL: xnano-0.0.28-py3-none-any.whl
  • Upload date:
  • Size: 67.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for xnano-0.0.28-py3-none-any.whl
Algorithm Hash digest
SHA256 922241d32b07969aeea485d847f42c17aaf91df050965a50259aac6bb9713787
MD5 7601f86960abb3bf7c298f72a68edb60
BLAKE2b-256 7a44bd79f396b0f480716437219f05aeba1cef4b4fd6d7755b6570e7d58c9588

See more details on using hashes here.

Supported by

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