Skip to content

Commit 6874725

Browse files
feat(api): add kanon-2-reranker
1 parent 381ce99 commit 6874725

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-baf5ebdd05d1b5192759a356c2701131c47cfb5b7239a49fcb94e68d4210648c.yml
3-
openapi_spec_hash: 6ea786d56726e18156adf57915fcbe5f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-cc6e47db2f93647cdafaa2098b9dbe0fc58291998c8a86e2a2e2adc4184da071.yml
3+
openapi_spec_hash: 8062d4e1530c9017628f3860742c0639
44
config_hash: 9040e7359f066240ad536041fb2c5185

src/resources/rerankings.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Rerankings extends APIResource {
1515
* @example
1616
* ```ts
1717
* const rerankingResponse = await client.rerankings.create({
18-
* model: 'kanon-universal-classifier',
18+
* model: 'kanon-2-reranker',
1919
* query:
2020
* 'What are the essential elements required to establish a negligence claim?',
2121
* texts: [
@@ -35,8 +35,8 @@ export class Rerankings extends APIResource {
3535

3636
export interface RerankingResponse {
3737
/**
38-
* The rerankings of the texts, by relevance to the query, in order from highest to
39-
* lowest relevance score.
38+
* The texts reranked by relevance to the query, in order from highest to lowest
39+
* relevance score.
4040
*/
4141
results: Array<RerankingResponse.Result>;
4242

@@ -74,10 +74,11 @@ export namespace RerankingResponse {
7474

7575
export interface RerankingCreateParams {
7676
/**
77-
* The ID of the [model](https://docs.isaacus.com/models#reranking) to use for
78-
* reranking.
77+
* The ID of the model to use for reranking, being either a
78+
* [reranking model](https://docs.isaacus.com/models/introduction#reranking) or
79+
* [universal classification model](https://docs.isaacus.com/models/introduction#universal-classification).
7980
*/
80-
model: 'kanon-universal-classifier' | 'kanon-universal-classifier-mini';
81+
model: 'kanon-2-reranker' | 'kanon-universal-classifier' | 'kanon-universal-classifier-mini';
8182

8283
/**
8384
* The query to evaluate the relevance of the texts to.
@@ -115,7 +116,9 @@ export interface RerankingCreateParams {
115116
is_iql?: boolean;
116117

117118
/**
118-
* The method to use for producing an overall relevance score for a text.
119+
* The method to use for producing an overall relevance score for a text that
120+
* exceeds the model's local context window and has, therefore, been split into
121+
* multiple chunks.
119122
*
120123
* `auto` is the default scoring method and is recommended for most use cases.
121124
* Currently, it is equivalent to `chunk_max`. In the future, it will automatically

tests/api-resources/rerankings.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('resource rerankings', () => {
1111
// Mock server tests are disabled
1212
test.skip('create: only required params', async () => {
1313
const responsePromise = client.rerankings.create({
14-
model: 'kanon-universal-classifier',
14+
model: 'kanon-2-reranker',
1515
query: 'What are the essential elements required to establish a negligence claim?',
1616
texts: [
1717
'To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.',
@@ -33,7 +33,7 @@ describe('resource rerankings', () => {
3333
// Mock server tests are disabled
3434
test.skip('create: required and optional params', async () => {
3535
const response = await client.rerankings.create({
36-
model: 'kanon-universal-classifier',
36+
model: 'kanon-2-reranker',
3737
query: 'What are the essential elements required to establish a negligence claim?',
3838
texts: [
3939
'To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.',

0 commit comments

Comments
 (0)