Knowledgebase Details
The Tror Gen AI SDK allows you to retrieve a list of all the knowledge bases you've created within your application. This functionality provides a helpful overview of your knowledge base collection and simplifies knowledge base selection during LLM development.
Why List Your Knowledge Bases?
-
Gaining Visibility: Obtaining a list of your knowledge bases allows you to see all the knowledge sources you've integrated for your LLMs.
-
Facilitating Selection: When building LLM interactions, you can easily reference the list to choose the appropriate knowledge base for the specific task.
-
Managing Your Collection: The list can help you identify any unused knowledge bases that might be candidates for deletion (refer to the "Removing a Knowledge Base" section for details).
Retrieving the Knowledge Base List:
The get_knowledgebases function within the SDK provides access to the list of your knowledge bases. Here's a breakdown of its usage:
- No Arguments: The function doesn't require any arguments.
import trorgenai
knowledgebases = trorgenai.get_knowledgebases()
This code snippet calls the get_knowledgebases function and stores the returned list of knowledge bases in the knowledgebases variable.
Understanding the Response:
The get_knowledgebases function typically returns a list of dictionaries, where each dictionary represents a knowledge base. The structure of the dictionaries might vary depending on the specific SDK implementation, but it often includes details like:
-
knowledgebase_id (str): The unique identifier assigned to the knowledge base.
-
knowledgebase_name (str): The name you provided when creating the knowledge base.
-
integration_type (str) (Optional): The method used to create the knowledge base (e.g., "file_upload", "sql", "confluence").
By effectively utilizing the get_knowledgebases function, you can gain valuable insights into your knowledge base collection, streamlining development and ensuring optimal LLM performance.