@nuclia/core
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -0,1 +1,15 @@ | ||
# 1.11.0 (2024-01-22) | ||
### Breaking changes | ||
- The `/suggest`endpoint now returns the family of each suggested entity | ||
### Improvements | ||
- Update `LearningConfiguration` model | ||
- Remove `hideSources` option from `WidgetFeatures` | ||
- Add `hideResults` option to `WidgetFeatures` | ||
- Support `/predict/summary` endpoint | ||
- Support the `user_prompt` parameter in Knowledge Box `/summarize` endpoint | ||
# 1.10.0 (2024-01-08) | ||
@@ -22,3 +36,2 @@ | ||
# 1.9.1 (2023-12-18) | ||
@@ -25,0 +38,0 @@ |
@@ -173,5 +173,19 @@ import { Observable } from 'rxjs'; | ||
getLearningConfigurations(): Observable<LearningConfigurations>; | ||
/** | ||
* Extract NER tokens from a text. | ||
*/ | ||
predictTokens(text: string): Observable<PredictedToken[]>; | ||
/** | ||
* Generate an answer from a question and a context. | ||
*/ | ||
predictAnswer(question: string, context: string[], model?: string): Observable<string>; | ||
/** | ||
* Generate a summary from a text. | ||
* | ||
* The optional `user_prompt` parameter allows you to provide a custom prompt to the model, | ||
* it must use the `{text}` placeholder to indicate where the resource text should be inserted | ||
* (example: 'Make a one-line summary of the following text: {text}'). | ||
*/ | ||
predictSummarize(text: string, user_prompt?: string, model?: string, summary_kind?: 'simple' | 'extended'): Observable<string>; | ||
/** | ||
* Get an account user by their id | ||
@@ -178,0 +192,0 @@ * @param accountSlug |
@@ -158,2 +158,3 @@ export type AccountTypes = 'stash-trial' | 'v3starter' | 'v3fly' | 'v3growth' | 'v3enterprise' | 'stash-basic' | 'stash-team' | 'stash-startup' | 'stash-starter' | 'stash-growth' | 'stash-enterprise' | 'stash-developer' | 'stash-business'; | ||
options?: LearningConfigurationOption[]; | ||
schema?: LearningConfigurationSchema; | ||
schemas?: { | ||
@@ -167,2 +168,3 @@ [key: string]: LearningConfigurationSchema; | ||
export declare const USER_PROMPTS = "user_prompts"; | ||
export declare const SUMMARY_PROMPT = "summary_prompt"; | ||
export interface LearningConfigurationSchema { | ||
@@ -169,0 +171,0 @@ title: string; |
@@ -21,3 +21,3 @@ import { Observable } from 'rxjs'; | ||
export declare class KnowledgeBox implements IKnowledgeBox { | ||
account: string; | ||
accountId: string; | ||
protected nuclia: INuclia; | ||
@@ -132,4 +132,8 @@ private tempToken?; | ||
* | ||
* It reads the resources text content and return a unique summary about them. | ||
* It reads the resources text content and return a global summary about them and one summery per resource. | ||
* | ||
* The optional `user_prompt` parameter allows you to specify a text that will be used to generate the summary, | ||
* and must use the `{text}` placeholder to indicate where the resource text should be inserted | ||
* (example: 'Make a one-line summary of the following text: {text}'). | ||
* | ||
* Example: | ||
@@ -144,3 +148,3 @@ ```ts | ||
*/ | ||
summarize(ressourceIds: string[]): Observable<string>; | ||
summarize(ressourceIds: string[], user_prompt?: string): Observable<string>; | ||
/** | ||
@@ -236,3 +240,3 @@ * Performs a tokenization of the given text. | ||
}>; | ||
getUsers(): Observable<FullKbUser[]>; | ||
getUsers(accountSlug: string): Observable<FullKbUser[]>; | ||
} | ||
@@ -239,0 +243,0 @@ /** Extends `KnowledgeBox` with all the write operations. */ |
@@ -93,3 +93,3 @@ import type { Observable } from 'rxjs'; | ||
}>; | ||
getUsers(): Observable<FullKbUser[]>; | ||
getUsers(accountSlug: string): Observable<FullKbUser[]>; | ||
} | ||
@@ -201,3 +201,3 @@ export interface IWritableKnowledgeBox extends IKnowledgeBox { | ||
hideLogo?: boolean; | ||
hideSources?: boolean; | ||
hideResults?: boolean; | ||
hideThumbnails?: boolean; | ||
@@ -204,0 +204,0 @@ knowledgeGraph?: boolean; |
@@ -147,6 +147,10 @@ import type { ExtractedDataTypes, FIELD_TYPE, FieldId, IFieldData, IResource, RelationEntityType, RelationType } from '../resource'; | ||
paragraphs?: Paragraphs; | ||
entities?: EntitySuggestions; | ||
} | ||
interface EntitySuggestions { | ||
total?: number; | ||
entities?: { | ||
total?: number; | ||
entities?: string[]; | ||
}; | ||
value: string; | ||
family: string; | ||
}[]; | ||
} | ||
@@ -153,0 +157,0 @@ interface Sentences extends Pagination { |
@@ -118,2 +118,3 @@ import type { Observable } from 'rxjs'; | ||
predictAnswer(question: string, context: string[], model?: string): Observable<string>; | ||
predictSummarize(text: string, user_prompt?: string, model?: string, summary_kind?: 'simple' | 'extended'): Observable<string>; | ||
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>; | ||
@@ -120,0 +121,0 @@ getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>; |
{ | ||
"name": "@nuclia/core", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "SDK allowing to integrate Nuclia services in your frontend application", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -7,3 +7,3 @@ # Nuclia JavaScript SDK | ||
The full documentation is available at [https://docs.stashify.cloud/docs/docs/sdk/js-sdk/](https://docs.stashify.cloud/docs/docs/sdk/js-sdk/). | ||
The full documentation is available at [https://docs.nuclia.dev/docs/docs/sdk/js-sdk/](https://docs.nuclia.dev/docs/docs/sdk/js-sdk/). | ||
@@ -10,0 +10,0 @@ ## Basic usage |
@@ -173,5 +173,19 @@ import { Observable } from 'rxjs'; | ||
getLearningConfigurations(): Observable<LearningConfigurations>; | ||
/** | ||
* Extract NER tokens from a text. | ||
*/ | ||
predictTokens(text: string): Observable<PredictedToken[]>; | ||
/** | ||
* Generate an answer from a question and a context. | ||
*/ | ||
predictAnswer(question: string, context: string[], model?: string): Observable<string>; | ||
/** | ||
* Generate a summary from a text. | ||
* | ||
* The optional `user_prompt` parameter allows you to provide a custom prompt to the model, | ||
* it must use the `{text}` placeholder to indicate where the resource text should be inserted | ||
* (example: 'Make a one-line summary of the following text: {text}'). | ||
*/ | ||
predictSummarize(text: string, user_prompt?: string, model?: string, summary_kind?: 'simple' | 'extended'): Observable<string>; | ||
/** | ||
* Get an account user by their id | ||
@@ -178,0 +192,0 @@ * @param accountSlug |
@@ -158,2 +158,3 @@ export type AccountTypes = 'stash-trial' | 'v3starter' | 'v3fly' | 'v3growth' | 'v3enterprise' | 'stash-basic' | 'stash-team' | 'stash-startup' | 'stash-starter' | 'stash-growth' | 'stash-enterprise' | 'stash-developer' | 'stash-business'; | ||
options?: LearningConfigurationOption[]; | ||
schema?: LearningConfigurationSchema; | ||
schemas?: { | ||
@@ -167,2 +168,3 @@ [key: string]: LearningConfigurationSchema; | ||
export declare const USER_PROMPTS = "user_prompts"; | ||
export declare const SUMMARY_PROMPT = "summary_prompt"; | ||
export interface LearningConfigurationSchema { | ||
@@ -169,0 +171,0 @@ title: string; |
@@ -21,3 +21,3 @@ import { Observable } from 'rxjs'; | ||
export declare class KnowledgeBox implements IKnowledgeBox { | ||
account: string; | ||
accountId: string; | ||
protected nuclia: INuclia; | ||
@@ -132,4 +132,8 @@ private tempToken?; | ||
* | ||
* It reads the resources text content and return a unique summary about them. | ||
* It reads the resources text content and return a global summary about them and one summery per resource. | ||
* | ||
* The optional `user_prompt` parameter allows you to specify a text that will be used to generate the summary, | ||
* and must use the `{text}` placeholder to indicate where the resource text should be inserted | ||
* (example: 'Make a one-line summary of the following text: {text}'). | ||
* | ||
* Example: | ||
@@ -144,3 +148,3 @@ ```ts | ||
*/ | ||
summarize(ressourceIds: string[]): Observable<string>; | ||
summarize(ressourceIds: string[], user_prompt?: string): Observable<string>; | ||
/** | ||
@@ -236,3 +240,3 @@ * Performs a tokenization of the given text. | ||
}>; | ||
getUsers(): Observable<FullKbUser[]>; | ||
getUsers(accountSlug: string): Observable<FullKbUser[]>; | ||
} | ||
@@ -239,0 +243,0 @@ /** Extends `KnowledgeBox` with all the write operations. */ |
@@ -93,3 +93,3 @@ import type { Observable } from 'rxjs'; | ||
}>; | ||
getUsers(): Observable<FullKbUser[]>; | ||
getUsers(accountSlug: string): Observable<FullKbUser[]>; | ||
} | ||
@@ -201,3 +201,3 @@ export interface IWritableKnowledgeBox extends IKnowledgeBox { | ||
hideLogo?: boolean; | ||
hideSources?: boolean; | ||
hideResults?: boolean; | ||
hideThumbnails?: boolean; | ||
@@ -204,0 +204,0 @@ knowledgeGraph?: boolean; |
@@ -147,6 +147,10 @@ import type { ExtractedDataTypes, FIELD_TYPE, FieldId, IFieldData, IResource, RelationEntityType, RelationType } from '../resource'; | ||
paragraphs?: Paragraphs; | ||
entities?: EntitySuggestions; | ||
} | ||
interface EntitySuggestions { | ||
total?: number; | ||
entities?: { | ||
total?: number; | ||
entities?: string[]; | ||
}; | ||
value: string; | ||
family: string; | ||
}[]; | ||
} | ||
@@ -153,0 +157,0 @@ interface Sentences extends Pagination { |
@@ -118,2 +118,3 @@ import type { Observable } from 'rxjs'; | ||
predictAnswer(question: string, context: string[], model?: string): Observable<string>; | ||
predictSummarize(text: string, user_prompt?: string, model?: string, summary_kind?: 'simple' | 'extended'): Observable<string>; | ||
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>; | ||
@@ -120,0 +121,0 @@ getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
414907
8223