Lumalabs
LumaLabTools enables an Agent to generate media using the Lumalabs platform.
Prerequisites
1export LUMAAI_API_KEY=***The following example requires the lumaai library. To install the Lumalabs client, run the following command:
1uv pip install -U lumaaiExample
The following agent will use Lumalabs to generate any video requested by the user.
1from kern.agent import Agent2from kern.models.openai import OpenAIResponses3from kern.tools.lumalab import LumaLabTools45luma_agent = Agent(6 name="Luma Video Agent",7 model=OpenAIResponses(id="gpt-5.2"),8 tools=[LumaLabTools()], # Using the LumaLab tool we created9 markdown=True,10 debug_mode=True,11 instructions=[12 "You are an agent designed to generate videos using the Luma AI API.",13 "You can generate videos in two ways:",14 "1. Text-to-Video Generation:",15 "2. Image-to-Video Generation:",16 "Choose the appropriate function based on whether the user provides image URLs or just a text prompt.",17 "The video will be displayed in the UI automatically below your response, so you don't need to show the video URL in your response.",18 ],19 system_message=(20 "Use generate_video for text-to-video requests and image_to_video for image-based "21 "generation. Don't modify default parameters unless specifically requested. "22 "Always provide clear feedback about the video generation status."23 ),24)2526luma_agent.run("Generate a video of a car in a sky")Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | If you want to manually supply the Lumalabs API key. |
enable_generate_video | bool | True | Enable the generate_video functionality. |
enable_image_to_video | bool | True | Enable the image_to_video functionality. |
all | bool | False | Enable all functionality. |
Toolkit Functions
| Function | Description |
|---|---|
generate_video | Generate a video from a prompt. |
image_to_video | Generate a video from a prompt, a starting image and an ending image. |
Developer Resources
- View Tools