File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -660,6 +660,8 @@ export interface ChatCompletionCreateParamsBase {
660
660
*/
661
661
model :
662
662
| ( string & { } )
663
+ | 'gpt-4-0125-preview'
664
+ | 'gpt-4-turbo-preview'
663
665
| 'gpt-4-1106-preview'
664
666
| 'gpt-4-vision-preview'
665
667
| 'gpt-4'
@@ -754,7 +756,8 @@ export interface ChatCompletionCreateParamsBase {
754
756
755
757
/**
756
758
* An object specifying the format that the model must output. Compatible with
757
- * `gpt-4-1106-preview` and `gpt-3.5-turbo-1106`.
759
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
760
+ * `gpt-3.5-turbo-1106`.
758
761
*
759
762
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
760
763
* message the model generates is valid JSON.
@@ -874,7 +877,8 @@ export namespace ChatCompletionCreateParams {
874
877
875
878
/**
876
879
* An object specifying the format that the model must output. Compatible with
877
- * `gpt-4-1106-preview` and `gpt-3.5-turbo-1106`.
880
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
881
+ * `gpt-3.5-turbo-1106`.
878
882
*
879
883
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
880
884
* message the model generates is valid JSON.
Original file line number Diff line number Diff line change @@ -96,7 +96,13 @@ export interface EmbeddingCreateParams {
96
96
* [Model overview](https://platform.openai.com/docs/models/overview) for
97
97
* descriptions of them.
98
98
*/
99
- model : ( string & { } ) | 'text-embedding-ada-002' ;
99
+ model : ( string & { } ) | 'text-embedding-ada-002' | 'text-embedding-3-small' | 'text-embedding-3-large' ;
100
+
101
+ /**
102
+ * The number of dimensions the resulting output embeddings should have. Only
103
+ * supported in `text-embedding-3` and later models.
104
+ */
105
+ dimensions ?: number ;
100
106
101
107
/**
102
108
* The format to return the embeddings in. Can be either `float` or
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ describe('resource embeddings', () => {
12
12
test ( 'create: only required params' , async ( ) => {
13
13
const responsePromise = openai . embeddings . create ( {
14
14
input : 'The quick brown fox jumped over the lazy dog' ,
15
- model : 'text-embedding-ada-002 ' ,
15
+ model : 'text-embedding-3-small ' ,
16
16
} ) ;
17
17
const rawResponse = await responsePromise . asResponse ( ) ;
18
18
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
@@ -26,7 +26,8 @@ describe('resource embeddings', () => {
26
26
test ( 'create: required and optional params' , async ( ) => {
27
27
const response = await openai . embeddings . create ( {
28
28
input : 'The quick brown fox jumped over the lazy dog' ,
29
- model : 'text-embedding-ada-002' ,
29
+ model : 'text-embedding-3-small' ,
30
+ dimensions : 1 ,
30
31
encoding_format : 'float' ,
31
32
user : 'user-1234' ,
32
33
} ) ;
You can’t perform that action at this time.
0 commit comments