Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Tests for newer models of anyscale and openai #72

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const config: Config = {
// "enableGlobally": false
// },

// Default timeout of a test in milliseconds
// testTimeout: 20000,

// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],

Expand Down
72 changes: 71 additions & 1 deletion tests/chat/anyscale.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ describe('Anyscale ChatCompletions APIs', () => {
});

test('model: codellama/CodeLlama-34b-Instruct-hf', async () => {
const completion = await client.chat.completions.create({ model: 'codellama/CodeLlama-34b-Instruct-hf', messages: [{ "role": "user", "content": "Say this is a test" }] });
const completion = await client.chat.completions.create({
model: 'codellama/CodeLlama-34b-Instruct-hf',
messages: [{ "role": "user", "content": "Say this is a test" }],
max_tokens: 30
VisargD marked this conversation as resolved.
Show resolved Hide resolved
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
Expand All @@ -42,4 +46,70 @@ describe('Anyscale ChatCompletions APIs', () => {
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: google/gemma-7b-it', async () => {
const completion = await client.chat.completions.create({
model: 'google/gemma-7b-it',
messages: [{ "role": "user", "content": "Say this is a test" }],
max_tokens: 25
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: meta-llama/Meta-Llama-3-8B-Instruct', async () => {
const completion = await client.chat.completions.create({
model: 'meta-llama/Meta-Llama-3-8B-Instruct',
messages: [{ "role": "user", "content": "Say this is a test" }],
max_tokens: 25
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: meta-llama/Meta-Llama-3-70B-Instruct', async () => {
const completion = await client.chat.completions.create({
model: 'meta-llama/Meta-Llama-3-70B-Instruct',
messages: [{ role: 'user', content: 'Say this is a test' }],
max_tokens: 25,
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: mistralai/Mixtral-8x7B-Instruct-v0.1', async () => {
const completion = await client.chat.completions.create({
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
messages: [{ role: 'user', content: 'Say this is a test' }],
max_tokens: 25,
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: mistralai/Mixtral-8x22B-Instruct-v0.1', async () => {
const completion = await client.chat.completions.create({
model: 'mistralai/Mixtral-8x22B-Instruct-v0.1',
messages: [{ role: 'user', content: 'Say this is a test' }],
max_tokens: 25,
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: mlabonne/NeuralHermes-2.5-Mistral-7B', async () => {
const completion = await client.chat.completions.create({
model: 'mlabonne/NeuralHermes-2.5-Mistral-7B',
messages: [{ role: 'user', content: 'Say this is a test' }],
max_tokens: 25,
});
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});
});
7 changes: 7 additions & 0 deletions tests/chat/openai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ describe('Openai ChatCompletions APIs', () => {
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});

test('model: gpt-4-turbo-2024-04-09', async () => {
const completion = await client.chat.completions.create({ model: 'gpt-4-turbo-2024-04-09', messages: [{ "role": "user", "content": "Say this is a test" }] });
expect(completion).toBeDefined();
expect(completion.choices).toBeDefined();
expect(completion.choices.length).toBeGreaterThan(0);
});
});
Loading