Skip to content

Commit f2f1be3

Browse files
docs: add examples to tsdocs
1 parent 127940d commit f2f1be3

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

src/resources/classifications/universal.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ export class Universal extends APIResource {
88
/**
99
* Classify the relevance of legal documents to a query with an Isaacus universal
1010
* legal AI classifier.
11+
*
12+
* @example
13+
* ```ts
14+
* const universalClassification =
15+
* await client.classifications.universal.create({
16+
* model: 'kanon-universal-classifier',
17+
* query: 'This is a confidentiality clause.',
18+
* texts: [
19+
* 'I agree not to tell anyone about the document.',
20+
* ],
21+
* });
22+
* ```
1123
*/
1224
create(body: UniversalCreateParams, options?: RequestOptions): APIPromise<UniversalClassification> {
1325
return this._client.post('/classifications/universal', { body, ...options });

src/resources/extractions/qa.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ export class Qa extends APIResource {
88
/**
99
* Extract answers to questions from legal documents with an Isaacus legal AI
1010
* answer extractor.
11+
*
12+
* @example
13+
* ```ts
14+
* const answerExtraction = await client.extractions.qa.create(
15+
* {
16+
* model: 'kanon-answer-extractor',
17+
* query: 'What is the punishment for murder in Victoria?',
18+
* texts: [
19+
* 'The standard sentence for murder in the State of Victoria is 30 years if the person murdered was a police officer and 25 years in any other case.',
20+
* ],
21+
* },
22+
* );
23+
* ```
1124
*/
1225
create(body: QaCreateParams, options?: RequestOptions): APIPromise<AnswerExtraction> {
1326
return this._client.post('/extractions/qa', { body, ...options });

src/resources/rerankings.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ export class Rerankings extends APIResource {
88
/**
99
* Rerank legal documents by their relevance to a query with an Isaacus legal AI
1010
* reranker.
11+
*
12+
* @example
13+
* ```ts
14+
* const reranking = await client.rerankings.create({
15+
* model: 'kanon-universal-classifier',
16+
* query:
17+
* 'What are the essential elements required to establish a negligence claim?',
18+
* texts: [
19+
* 'To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.',
20+
* 'Criminal cases involve a completely different standard, requiring proof beyond a reasonable doubt.',
21+
* 'In a negligence claim, the plaintiff must prove duty, breach, causation, and damages.',
22+
* 'Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.',
23+
* 'The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.',
24+
* ],
25+
* });
26+
* ```
1127
*/
1228
create(body: RerankingCreateParams, options?: RequestOptions): APIPromise<Reranking> {
1329
return this._client.post('/rerankings', { body, ...options });

0 commit comments

Comments
 (0)