SDK Python
https://x.com/LumiTeh / https://www.lumiteh.com/ / https://github.com/LumiTeh-hub
Explore our GitHub repository https://github.com/LumiTeh-hub and star us!
Overview
The LumiTeh Python SDK offers a full suite of tools for working with the LumiTeh API. In this guide, you’ll learn how to install the SDK, set up your API key, and begin using it to manage browser sessions, web agents, and website interactions.
Quickstart
Install the latest version of the SDK (requires `python >= 3.11`)
pip install --upgrade lumiteh-sdk
Configure your API key as an environment variable
export LUMITEH_API_KEY=
Run your first agent
import os
from lumiteh_sdk import LumiTehClient
lumiteh = LumiTehClient(api_key=os.getenv("LUMITEH_API_KEY"))
with lumiteh.Session() as session:
agent = lumiteh.Agent(session=session, max_steps=5)
response = agent.run(
task="Find the latest job openings on lumiteh.io",
)
Explore what the LumiTeh Python SDK can do for you
The SDK provides a comprehensive set of tools for interacting with the LumiTeh API.
Run a Web Agent
from lumiteh_sdk import LumiTehClient
lumiteh = LumiTehClient()
with lumiteh.Session() as session:
agent = lumiteh.Agent(session=session, max_steps=10)
response = agent.run(task="Find the best Italian restaurant in SF and book a table for 2 at 7pm today")
print(f"Agent terminated with status: {response.success} and answer: {response.answer}")
from lumiteh_sdk import LumiTehClient
How to get visual insights about your sessions & agents
At any time during the execution of a session or an agent, you can retrieve a replay of the execution so far as a WebP
image.
lumiteh = LumiTehClient()
with lumiteh.Session() as session:
_ = session.observe(url="https://duckduckgo.com")
# Save the replay to a file
replay = session.replay()
replay.save("replay.webp")
Last updated