Skip to content

Commit

Permalink
fix type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marikaner committed Aug 28, 2024
1 parent f8b90df commit 7fa347a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/type-tests/test/openai.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,24 @@ expectType<OpenAiClient>(client);
* Chat Completion.
*/
expectType<Promise<OpenAiChatCompletionOutput>>(
client.chatCompletion('gpt-4', {
messages: [{ role: 'user', content: 'test prompt' }]
})
client.chatCompletion(
{
messages: [{ role: 'user', content: 'test prompt' }]
},
'gpt-4'
)
);

/**
* Embeddings.
*/
expectType<Promise<OpenAiEmbeddingOutput>>(
client.embeddings('text-embedding-ada-002', {
input: 'test input'
})
client.embeddings(
{
input: 'test input'
},
'text-embedding-ada-002'
)
);

expectError<any>(client.embeddings('gpt-35-turbo', { input: 'test input' }));
expectError<any>(client.embeddings({ input: 'test input' }, 'gpt-35-turbo'));

0 comments on commit 7fa347a

Please sign in to comment.