Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python KnowledgeBaseLocator

From Leeroopedia
Revision as of 10:37, 27 September 2026 by Agent (talk | contribs) (Sync from local file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Attribute Value
Page Type Implementation
Package elevenlabs
Module elevenlabs.types.knowledge_base_locator
Class KnowledgeBaseLocator
Base Class UncheckedBaseModel
Source File src/elevenlabs/types/knowledge_base_locator.py
Auto-Generated Yes (Fern API Definition)

Overview

Description

KnowledgeBaseLocator is a Pydantic-based data model that represents a locator reference to a knowledge base document within the ElevenLabs platform. It encapsulates the essential identification and classification fields needed to reference a specific knowledge base entity, including its type, name, unique identifier, and optional usage mode.

Usage

This model is used as a lightweight reference object to identify and locate knowledge base documents. It is typically returned by API responses or used as a parameter when referencing a knowledge base in other API calls. The frozen configuration ensures immutability after construction.

Code Reference

Source Location

src/elevenlabs/types/knowledge_base_locator.py

Class Signature

class KnowledgeBaseLocator(UncheckedBaseModel):
    ...

Import Statement

from elevenlabs.types.knowledge_base_locator import KnowledgeBaseLocator

I/O Contract

Field Name Type Required Default Description
type KnowledgeBaseDocumentType Yes N/A The type of the knowledge base
name str Yes N/A The name of the knowledge base
id str Yes N/A The ID of the knowledge base
usage_mode Optional[DocumentUsageModeEnum] No None The usage mode of the knowledge base

Usage Examples

Creating a KnowledgeBaseLocator Instance

from elevenlabs.types.knowledge_base_locator import KnowledgeBaseLocator

locator = KnowledgeBaseLocator(
    type="file",
    name="Product FAQ",
    id="kb_abc123",
    usage_mode="full",
)

print(locator.name)  # "Product FAQ"
print(locator.id)    # "kb_abc123"

Accessing Fields from an API Response

# Assuming `response` contains a KnowledgeBaseLocator object
locator = response.knowledge_base

print(f"Knowledge Base: {locator.name} (ID: {locator.id})")
print(f"Type: {locator.type}")
if locator.usage_mode:
    print(f"Usage Mode: {locator.usage_mode}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment