Skip to main content

Python SDK for L1M

Project description

L1M Python SDK

Python SDK for interacting with the L1M API.

Installation

pip install l1m-dot-io

Usage

from pydantic import BaseModel
from l1m import L1M, ClientOptions, ProviderOptions

class ContactDetails(BaseModel):
  email: str
  phone: str

class UserProfile(BaseModel):
  name: str
  company: str
  contactInfo: ContactDetails


client = L1M(
  options=ClientOptions(
    provider=ProviderOptions(
      model="gpt-4",
      url="https://api.openai.com/v1/chat/completions",
      key="your-openai-key"
    )
  )
)

# Generate a structured response
user_profile = client.structured(
  input="John Smith was born on January 15, 1980. He works at Acme Inc. as a Senior Engineer and can be reached at john.smith@example.com or by phone at (555) 123-4567.",
  schema=UserProfile,
  instruction="Extract details from the provided text.", # Optional
)

Development

# Run tests
pytest

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

l1m_dot_io-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l1m_dot_io-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file l1m_dot_io-0.1.2.tar.gz.

File metadata

  • Download URL: l1m_dot_io-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for l1m_dot_io-0.1.2.tar.gz
Algorithm Hash digest
SHA256 153fd44c6ce36c1d53d8e7599a5997a703bf1b419ed895b7774413f43de516da
MD5 da1697835e8a116ce220574e1857add6
BLAKE2b-256 a4c8b9befafd4e4b70ecbe1b3c770cfbd177837e91750fe4d4c0b16283feb93d

See more details on using hashes here.

File details

Details for the file l1m_dot_io-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: l1m_dot_io-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for l1m_dot_io-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38998237dfee7d2127f956db01a2f804c73fff2a46b6ca0679fba3f5e1a6fe97
MD5 6f4303ded011650fadcbd47337cf548d
BLAKE2b-256 f70013cdba99a5221b1ae3edc6cc7de759de7e6433d640124179e865a3863c1d

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