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

This version

0.2.2

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.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

lmnr-0.2.2-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lmnr-0.2.2.tar.gz
  • Upload date:
  • Size: 17.7 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.2.tar.gz
Algorithm Hash digest
SHA256 843e9bca27fcfe96ba9ef2dbf75cd8bc7fd88715b6f741e57ae5cf128f5536e4
MD5 48561764fcb307e4a7e9714d6d31ffc9
BLAKE2b-256 44ba0d7d70851ebfc665143b03198e053c1e223b5e3f67cc6892afd2e28e9963

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lmnr-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a2cf8437bef1839e2002a6d45d45910b3d1da28e347ad12d30494baaea7e937
MD5 f95f931b5fdf1728a83380f5b3398e82
BLAKE2b-256 16f1b53f6d4c738a85e94f36aa4958e2673f97abfb7986b34130c1cef76760b4

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