Agent
- class lightning_sdk.Agent(agent_id)
Bases:
objectRepresents a Lightning AI Agent.
Agents expose an AI assistant endpoint backed by a custom model and prompt configuration. Use
create_agent()to create a new agent, then use this class to update or delete it.Fetch an existing agent by its ID.
- Parameters:
- Raises:
ValueError – If no agent with the given ID exists.
- delete()
Permanently delete the agent and its associated endpoint.
- Return type:
- update(base_url=None, api_key=None, name=None, model=None, description=None, prompt_template=None, prompt_suggestions=None, knowledge=None, publish_status=None)
Update the agent configuration and its backing endpoint.
All parameters are optional; only the provided values are updated.
- Parameters:
base_url (
Optional[str]) – New base URL for the model endpoint. Defaults to None.api_key (
Optional[str]) – New API key for authenticating with the endpoint. Defaults to None.name (
Optional[str]) – New display name for the agent. Defaults to None.model (
Optional[str]) – New model identifier to use. Defaults to None.description (
Optional[str]) – New human-readable description for the agent. Defaults to None.prompt_template (
Optional[str]) – New system prompt template. Defaults to None.prompt_suggestions (
Optional[List[str]]) – New list of suggested user prompts shown in the UI. Defaults to None.knowledge (
Optional[str]) – New knowledge-base content or reference for the agent. Defaults to None.publish_status (
Optional[str]) – New publish status (e.g."published"or"draft"). Defaults to None.base_url (str | None)
api_key (str | None)
name (str | None)
model (str | None)
description (str | None)
prompt_template (str | None)
knowledge (str | None)
publish_status (str | None)
- Return type:
Was this page helpful?
Thanks for the feedback.