Searchable Document Collection - Add document

This task addes a document to a collection that can be queried.

Input

Description

This task addes a document to a collection. The collection can be queried by the Searchable Document Collection - Query task.

Notes

Please note:

  • The document is available for 6 months.
  • The API upload size is currently limited by the max request size to 16kB. We will increase this limit in the future.
  • Pricing is set linear based on the number chunks we create. We may change the pricing in the future.

Applications

  • Knowledge Base ChatBots
  • Semantic Information Retrieval from Document Collections

How to use the task

Please enter information about how to use the task.

Privacy

We strongly advise against including sensitive or confidential information in your queries.

[1.0.0]:
First version
VersionAI ModelCreatedLink
1.0.019.10.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • document_set (Document Text): Document to be set. If empty only the query result is returned. Max 16000 characters.
  • session (Document name): Defines in which session (the document name) the data is stored. You can think of it as a temporary file name.
  • document_set_source (Document Source (URL, file name, ...)): The source of the document.
  • document_collection (Document Collection): The name of the document.
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/intern-memory-search-collection-add-document/1.0.0?document_set=Please%20enter%20the%20text%20of%20the%20document.&session=document-name&document_set_source=Where%20the%20user%20can%20find%20the%20document%20when%20it's%20shown%20as%20result%20to%20her%20query.&document_collection=document-collection-name
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('intern-memory-search-collection-add-document','1.0.0', {'document_set': 'Please enter the text of the document.', 'session': 'document-name', 'document_set_source': 'Where the user can find the document when it\'s shown as result to her query.', 'document_collection': 'document-collection-name'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('intern-memory-search-collection-add-document','1.0.0', document_set='Please enter the text of the document.', session='document-name', document_set_source='Where the user can find the document when it\'s shown as result to her query.', document_collection='document-collection-name')