add_document_to_kb ( kb_title = "My Knowledge Base", content = "This is a sample document.", title = "Sample Document" )Īlso note that you can't have duplicate documents (content or title) in the same knowledge base, as doing so would lead to suboptimal querying performance. If your content is in a file type that we support (pdf, txt, docx, or md), you can directly upload the file using add_file_to_kb() instead of converting it to a string first. Note that for this function your document needs to already be converted to a string. To add a document to a knowledge base, use the add_document_to_kb() function. To list all knowledge bases in your account, use the list_knowledge_bases() function: list_knowledge_bases ( verbose = True ) Adding a Document to a Knowledge Base To create a new knowledge base, use the create_knowledge_base() function: create_knowledge_base ( title = "My Knowledge Base", supp_id = "123", description = "A sample knowledge base" ) Listing Knowledge Bases Import all from superpowered from superpowered import * Creating a Knowledge Base Set the following environmental variables in a terminal export SUPERPOWERED_API_KEY_ID = "INSERT_API_KEY_ID_HERE" export SUPERPOWERED_API_KEY_SECRET = "INSERT_API_KEY_SECRET_HERE" To install the Superpowered AI Python SDK you can use pip pip install superpowered-sdk You can also create and delete documents in a knowledge base. The SDK allows you to create, update, and delete knowledge bases, as well as directly query a knowledge base. This Python SDK provides an interface to interact with Superpowered AI, a knowledge base as a service for LLM applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |