llmtuner.llms.anyllm
Attributes
Classes
Base class to handle interface to AnythingLLM |
|
Interface to create workspaces and embed documents in AnythingLLM |
|
Interface to chat with a specific workspace. |
|
Class to manage documents in Anything LLM with vector database. |
|
Class to interact with space/model in Anything LLM |
Module Contents
- class llmtuner.llms.anyllm.AnyLLMBase(config='')[source]
Bases:
llmtuner.interface.Interface
Base class to handle interface to AnythingLLM
- class llmtuner.llms.anyllm.AnyLLMBuilder(workspace_slug='')[source]
Bases:
AnyLLMBase
Interface to create workspaces and embed documents in AnythingLLM
- get_available_documents(include_staged=True, include_embedded=True, include_workspace=True, filters={'indexed': {}, 'staged': {}, 'embedded': {}, 'added': {}}, common_only=False, docids_only=True)[source]
Get list of available documents indexed, staged, embedded in vector database, and, if workspace is set, added to the workspace, sorted by docid. You can provide a dictionary to filter for specific entries by providing column names and values for the tables.
- add_document(url, metadata={})[source]
Manually add a document to the document index by providing the url and optionally additional metadata.
- stage_documents(docids=[], update=True)[source]
Download documents locally and prepare for embedding
- class llmtuner.llms.anyllm.AnyLLMChatter(workspaceslug='', historylength=5)[source]
Bases:
AnyLLMBase
Interface to chat with a specific workspace.
- class llmtuner.llms.anyllm.AnyLLMDocuments[source]
Bases:
AnyLLMBase
Class to manage documents in Anything LLM with vector database.
- upload_document(filepath='', content='', uploadname='', referenceid='', fileformat='')[source]
Uploads a file or text content from local storage and updates vectordatabase local table.
- get_documents_list(synchronize=False)[source]
Get currently embedded document list from AnythingLLM and synchronize with local DB if ‘synchronize’=True
- class llmtuner.llms.anyllm.AnyLLMSpace(spaceslug='', config=None)[source]
Bases:
AnyLLMBase
Class to interact with space/model in Anything LLM
- _get_metadata_from_server(updateobject=False, getfulldocs=False)[source]
Read metadata for workspace from AnythingLLM server, and update the metadata of this instance. Returns either list of docids or full information on included documents.