Skip to main content

Python SDK for Laminar AI

Project description

Python SDK for Laminar AI

Example use:

from lmnr import Laminar

l = Laminar('<YOUR_PROJECT_API_KEY>')
result = l.run(
    endpoint = 'my_endpoint_name',
    inputs = {'input_node_name': 'some_value'},
    env = {'OPENAI_API_KEY': 'sk-some-key'},
    metadata = {'session_id': 'your_custom_session_id'}
)

Resulting in:

>>> result
EndpointRunResponse(outputs={'output': {'value': [ChatMessage(role='user', content='hello')]}}, run_id='53b012d5-5759-48a6-a9c5-0011610e3669')

CLI for code generation

Basic usage

lmnr pull <pipeline_name> <pipeline_version_name> --project-api-key <PROJECT_API_KEY>

Read more here on how to get PROJECT_API_KEY.

To import your pipeline

# submodule with the name of your pipeline will be generated in lmnr_engine.pipelines
from lmnr_engine.pipelines.my_custom_pipeline import MyCustomPipeline


pipeline = MyCustomPipeline()
res = pipeline.run(
    inputs={
        "instruction": "Write me a short linked post about dev tool for LLM developers which they'll love"
    },
    env={
        "OPENAI_API_KEY": <OPENAI_API_KEY>,
    }
)
print(f"RESULT:\n{res}")

Current functionality

  • Supports graph generation for graphs with Input, Output, and LLM nodes only
  • For LLM nodes, it only supports OpenAI and Anthropic models and doesn't support structured output

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmnr-0.2.3.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

lmnr-0.2.3.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file lmnr-0.2.3.1.tar.gz.

File metadata

  • Download URL: lmnr-0.2.3.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.6 Darwin/23.5.0

File hashes

Hashes for lmnr-0.2.3.1.tar.gz
Algorithm Hash digest
SHA256 6ff5c61253ee78322109c4413db3754b54b8a8d1926021eb820909b4ffd6ff1f
MD5 a36417fec2ae07c8f638690e3a355abc
BLAKE2b-256 e5649b9f4787b7140c78d9ad3fc9f91866dce545bf38393e55a3c20c20f4711a

See more details on using hashes here.

File details

Details for the file lmnr-0.2.3.1-py3-none-any.whl.

File metadata

  • Download URL: lmnr-0.2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.6 Darwin/23.5.0

File hashes

Hashes for lmnr-0.2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d54f265b6bda3f11c29b303d61891ef7105fae3c39721f7feb39bfe6235f07d9
MD5 225988706083263918bc191fb90d2ea0
BLAKE2b-256 c0fe6931058ef8faeecba06eb8ef40376c12b46a222d0e70bb38063913984baa

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