Skip to content

Commit bfd71d0

Browse files
committed
refactor: Added deprecation warning
1 parent 2e557d5 commit bfd71d0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/resources/chat/completions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as Models from '../../types';
22
import { APIResource } from '../../APIResource';
33
import { Stream } from '../../streaming';
44

5+
const deprecatedModels = ['jamba-1.5-mini', 'jamba-1.5-large'];
6+
57
export class Completions extends APIResource {
68
create(
79
body: Models.ChatCompletionCreateParamsNonStreaming,
@@ -19,6 +21,14 @@ export class Completions extends APIResource {
1921
): Promise<Stream<Models.ChatCompletionChunk> | Models.ChatCompletionResponse>;
2022

2123
create(body: Models.ChatCompletionCreateParams, options?: Models.RequestOptions) {
24+
// Check for deprecated models
25+
if (deprecatedModels.includes(body.model)) {
26+
console.warn(
27+
`Warning: The model "${body.model}" is deprecated and will be removed in a future release.
28+
Please use jamba-mini or jamba-large instead.`,
29+
);
30+
}
31+
2232
return this.client.post<Models.ChatCompletionCreateParams, Models.ChatCompletionResponse>(
2333
'/chat/completions',
2434
{

0 commit comments

Comments
 (0)