Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@or-sdk/qna

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@or-sdk/qna - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3-beta.1552.0

10

dist/types/types.d.ts

@@ -43,4 +43,4 @@ import { OrderOptions, PaginationOptions, Token } from '@or-sdk/base';

mode?: AskMode;
answerInstruction?: string;
questionInstruction?: string;
answerInstruction?: string | null;
questionInstruction?: string | null;
temperature?: number;

@@ -73,5 +73,5 @@ maxTokens?: number;

imageUrl?: string;
answerInstruction?: string;
questionInstruction?: string;
greetingInstruction?: string;
answerInstruction?: string | null;
questionInstruction?: string | null;
greetingInstruction?: string | null;
properties?: Property[];

@@ -78,0 +78,0 @@ createdAt: string | Date;

{
"name": "@or-sdk/qna",
"version": "3.1.2",
"version": "3.1.3-beta.1552.0",
"main": "dist/cjs/index.js",

@@ -36,4 +36,3 @@ "module": "dist/esm/index.js",

"access": "public"
},
"gitHead": "be37739041df8c2d4694c2dc978eaaafb3dbfcd6"
}
}

@@ -174,25 +174,27 @@ # QnA SDK

Create a new collection with optional properties. A collection is a group of related documents that are searchable together. You can define additional properties to store custom metadata associated with the passages within the collection.
Creates a new collection with optional properties. A collection is a group of related documents that are searchable together. Additional custom properties can be defined to store metadata associated with the passages within the collection.
#### Params
- name: `string` - The name of the collection
- description: `string` (optional) - A brief description of the collection
- properties: `Property[]` (optional) - An array of custom properties to add to the collection. Each property should include a name, datatype, and an optional description. For more information on supported datatypes, visit https://weaviate.io/developers/weaviate/config-refs/schema#datatypes
- `name`: `string` - The name of the collection. It can start only with a letter and it must be at least 5 characters long, and cannot exceed 100 characters in length.
- `description`: `string` (optional) - A brief description of the collection. It is at least 3 characters and no more than 500 characters in length.
- `properties`: `Property[]` (optional) - An array of custom properties to add to the collection. Each property should include a name, datatype, and an optional description. Please see https://weaviate.io/developers/weaviate/config-refs/schema#datatypes for supported datatypes.
- `imageUrl`: `string` (optional) - A URL of the thumbnail image of the collection. It must be at least 3 characters and it cannot exceed 2048 characters in length.
- `answerInstruction`: `string` (optional) - An instruction used to generate a correct answer. It can't be more than 1000 characters long.
- `questionInstruction`: `string` (optional) - An instruction used to generate a proper search query. It can't be more than 1000 characters long.
- `greetingInstruction`: `string` (optional) - An instruction used to generate a correct first message. It can't be more than 1000 characters long.
#### Example
Creating a collection with a name and description
Creating a collection with a name, description, and additional instructions
```typescript
const collection = await qna.createCollection({
name: 'Sample Collection',
description: 'A sample collection',
name: 'Sample Collection',
imageUrl: 'https://example.com/img.jpg',
answerInstruction: 'Make sure to answer clearly and concisely',
questionInstruction: 'Ask your question in a way that is likely to elicit a helpful response',
greetingInstruction: 'Begin your conversation in a friendly and welcoming manner'
});
// Example response
{
id: 'a1b2c3d4-uuid',
accountId: 'i9j0k1l2-uuid',
name: 'Sample Collection',
description: 'A sample collection'
}
```

@@ -204,4 +206,4 @@

const collectionWithProperties = await qna.createCollection({
name: 'Collection With Properties',
description: 'A collection with properties',
name: 'Collection With Properties',
properties: [

@@ -223,2 +225,25 @@ {

{
id: 'a1b2c3d4-uuid',
accountId: 'i9j0k1l2-uuid',
name: 'Collection With Properties',
description: 'A collection with properties'
properties: [
{
id: 'e5f6g7h8-uuid',
name: 'author',
dataType: 'string',
description: 'Author of the document',
},
{
id: 'i9j0k1l2-uuid',
name: 'publishDate',
dataType: 'date',
description: 'Date when the document was published',
},
],
}
```
// Example response
{
id: 'x1y2z3w4-uuid',

@@ -381,3 +406,6 @@ accountId: 'i9j0k1l2-uuid',

- where: `Record<string, unknown>` (optional) - Weaviate filter object for advanced filtering. For more details, visit https://weaviate.io/developers/weaviate/api/graphql/filters
- select: `string[]` (optional) - Array of the custom properties to select
- mode: `AskMode` (optional) - Question mode, can be either 'ask' or 'conversation'. Default is 'conversation'
- answerInstruction: `string | null` (optional) - A summarization instruction used to generate correct answer. Maximum Length: 1000 characters
- questionInstruction: `string | null` (optional) - A summarization instruction used to generate correct search query. Maximum Length: 1000 characters
- temperature: `number` (optional) - Adjusts the randomness in the model's output. Default is 1. Accepts values between 0 and 2

@@ -416,7 +444,10 @@ - maxTokens: `number` (optional) - Maximum output length from the language model. Default is 1024. Accepts values between 128 and 2048

},
select: ['title', 'author', 'publishDate'],
mode: 'conversation',
answerInstruction: 'Generate a brief and concise answer.',
questionInstruction: 'Find documents related to the meaning of life.',
temperature: 0.8,
maxTokens: 1500,
frequencyPenalty: 0.5,
presencePenalty: 0.5,
frequencyPenalty: 0.5;
presencePenalty: 0.5;
maxDistance: 0.9,

@@ -476,11 +507,15 @@ });

Update an existing collection's description. The collection must be previously created using the `createCollection` method. The updated collection will preserve its existing properties, ID, name, and associated documents.
Update an existing collection's properties. The collection must be previously created using the `createCollection` method. The updated collection will preserve its existing properties, ID, and name, but its associated documents might be affected based on the new instructions.
#### Params
- collectionId: `string` - The ID of the collection you want to update
- updateParams: `UpdateCollection` - An object containing the properties you want to update, which can include:
- description: `string` (optional) - The new description for the collection
- `collectionId`: `string` - The ID of the collection you want to update
- `updateParams`: `UpdateCollection` - An object containing the properties you want to update, which can include:
- `description`: `string` (optional) - The new description for the collection. `Minimum length: 3, Maximum length: 500`
- `imageUrl`: `string` (optional) - A collection thumbnail image URL. `Minimum length: 3, Maximum length: 2048`
- `answerInstruction`: `string` (optional) - A summarization instruction used to generate a correct answer. `Maximum length: 1000`
- `questionInstruction`: `string` (optional) - A summarization instruction used to generate a correct search query. `Maximum length: 1000`
- `greetingInstruction`: `string` (optional) - A summarization instruction used to generate a correct first message. `Maximum length: 1000`
#### Example
Updating a collection's description
Updating a collection's description and adding a new question instruction.

@@ -491,2 +526,3 @@ ```typescript

description: 'Updated collection description',
questionInstruction: 'Consider the main theme of the document for the query',
});

@@ -499,3 +535,4 @@

name: 'Sample Collection',
description: 'Updated collection description'
description: 'Updated collection description',
questionInstruction: 'Consider the main theme of the document for the query',
}

@@ -502,0 +539,0 @@ ```

@@ -177,3 +177,3 @@ import { OrderOptions, PaginationOptions, Token } from '@or-sdk/base';

*/
answerInstruction?: string;
answerInstruction?: string | null;

@@ -185,3 +185,3 @@ /**

*/
questionInstruction?: string;
questionInstruction?: string | null;

@@ -309,17 +309,17 @@ /**

* A summarization instruction used to generate a correct answer (Optional)
* Maximum length: 1000
* Maximum length: 2048
*/
answerInstruction?: string;
answerInstruction?: string | null;
/**
* A summarization instruction used to generate a correct search query (Optional)
* Maximum length: 1000
* Maximum length: 2048
*/
questionInstruction?: string;
questionInstruction?: string | null;
/**
* A summarization instruction used to generate a correct first message (Optional)
* Maximum length: 1000
* Maximum length: 2048
*/
greetingInstruction?: string;
greetingInstruction?: string | null;

@@ -326,0 +326,0 @@ /**

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc