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-sdkConfigure 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 LumiTehClientHow 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")Manage your browser sessions
from lumiteh_sdk import LumiTehClient
lumiteh = LumiTehClient()
# The session is automatically stopped when the context manager is exited
with lumiteh.Session(timeout_minutes=2) as session:
status = session.status()
print(status)
you can also always list all your sessions using the sessions.list method:
from lumiteh_sdk import LumiTehClient
lumiteh = LumiTehClient()
# list only active sessions
sessions = lumiteh.sessions.list()
# list all sessions
sessions = lumiteh.sessions.list(only_active=False)
How to get visual insights about your sessions & agents
During the execution of a session or an agent, you can capture a replay of the progress so far as a WebP image at any time.
Take control and execute actions in a session
The LumiTeh SDK also lets you monitor a web page and its interactions, extract page content, and perform actions within an active session:
Observe: track the actions available on a webpage
Step: perform an action on the page (e.g., click a button, fill out a form, etc.)
Scrape: extract page content in Markdown format or in a structured format using BaseModel from pydantic
How to gain visual insights into your sessions and 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.
Manage your credentials in a secure vault
The Notte SDK allows you to securely store and access your credentials in a secure vault.
How to gain visual insights into your sessions and 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.
Last updated