Agent

class lightning_sdk.Agent(agent_id)

Bases: object

Represents 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:
  • agent_id (str) – The unique identifier of the agent to fetch.

  • agent_id (str)

Raises:

ValueError – If no agent with the given ID exists.

delete()

Permanently delete the agent and its associated endpoint.

Return type:

None

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)

  • prompt_suggestions (List[str] | None)

  • knowledge (str | None)

  • publish_status (str | None)

Return type:

None

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close