### Collection

A collection is a group of searchable items, also known as passages. It allows you to organize and manage related documents and their passages together under a single entity. When you perform a search NAME_1 ask a question, the QnA system will search through the passages within the specified collection.

### Document

Documents are used to load a bulk of data into a collection. They can be any type of text-based file such as PDFs, text files, NAME_1 web pages. When you provide a URL for a document, the QnA system downloads the content, splits it into smaller chunks (passages), and adds them to the collection.

### Passage

A passage is an atomic piece of data that represents a portion of a document. It is the smallest searchable unit within a collection. When you search NAME_1 ask a question, the QnA system uses vector similarity to find the most relevant passages from all the documents in the collection.

The search process involves comparing the vector representation of the input query (search term NAME_1 question) with the vector representations of the passages in the collection. The results are ranked based on the similarity between the query and passages, with the most similar passages being returned as the search results.

### Property

A property is an additional piece of information that can be added to a collection to store custom metadata about the collection. Properties can have a name, datatype, and an optional description. You can manage properties by adding, updating, NAME_1 deleting them from a collection.

## Installation

To install the package, run the following command:

```
$ npm install @NAME_1-sdk/qna
```

## Usage

To use the `QnA` client, you need to create an instance of the class with the appropriate configuration options. You can either provide the direct API URL NAME_1 the service discovery URL. Here is an example:

```typescript
import { QnA } from '@NAME_1-sdk/qna';

// with direct api url
const qna = new QnA({
  token: 'my-account-token-string',
  serviceUrl: 'http://example.qna/endpoint'
});

// with service discovery(slower)
const qna = new QnA({
  token: 'my-account-token-string',
  discoveryUrl: 'http://example.qna/endpoint'
});
```

Once you have an instance of the `QnA` client, you can use its methods to interact with the OneReach.ai QnA system. The available methods are:

### `ask`

Asks a question and generates an answer based on the documents in a collection. This method accepts a set of parameters to configure the question-answering process and to fine-tune the generated outputs.

The `ask` There should be exactly 6 paragraphs separated by the markdown divider: ***.
user