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

community[minor]: Add standard tests to community chat models #5669

Merged
merged 36 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4820bf9
partners[minor]: Add standard chat model tests to partner packages
bracesproul Jun 4, 2024
400b04b
google genai
bracesproul Jun 4, 2024
efb7f3f
yarn
bracesproul Jun 4, 2024
1510d62
groq
bracesproul Jun 4, 2024
74d2fe9
groq nit and mistral
bracesproul Jun 4, 2024
f694aad
add to azure in chat openai
bracesproul Jun 4, 2024
f9b4d85
chore: lint files
bracesproul Jun 4, 2024
5a8767e
drop azure openai pkg
bracesproul Jun 4, 2024
bdb4d55
add generic constructor args to standard tests pkg
bracesproul Jun 4, 2024
de2259c
implement cloudflare standard tests
bracesproul Jun 4, 2024
8991340
implement cohere standard tests
bracesproul Jun 4, 2024
183816c
google genai package standard tests
bracesproul Jun 4, 2024
b96008e
groq
bracesproul Jun 4, 2024
3f4a3b3
allow for custom function call ids, fix mistral
bracesproul Jun 4, 2024
ded3663
azure tests
bracesproul Jun 4, 2024
18c748e
chore: lint files
bracesproul Jun 4, 2024
20d16d2
update standard tests gh action to run all pkgs
bracesproul Jun 4, 2024
cc4f4e7
chore: lint files
bracesproul Jun 4, 2024
63de31e
revert workflow file rename
bracesproul Jun 4, 2024
c323fab
fix workflow job naming issue
bracesproul Jun 4, 2024
50971e2
add anthropic, fix api keys
bracesproul Jun 4, 2024
01573ab
cache deps?
bracesproul Jun 4, 2024
f978653
fix build
bracesproul Jun 4, 2024
ca50201
Merge branch 'main' into brace/standard-tests-partners
bracesproul Jun 4, 2024
74da454
update standard tests
bracesproul Jun 4, 2024
ee55ad9
cr
bracesproul Jun 4, 2024
31aa8f8
fix
bracesproul Jun 4, 2024
d607d2b
remove dep on job which doesnt exist
bracesproul Jun 4, 2024
4c0789b
cr
bracesproul Jun 4, 2024
e66d30e
cr
bracesproul Jun 4, 2024
8d8fac1
community[minor]: Add standard tests to community chat models
bracesproul Jun 4, 2024
77111c7
Merge branch 'main' into brace/standard-tests-community
bracesproul Jun 4, 2024
b2367b9
integration tests
bracesproul Jun 5, 2024
2a1af54
chore: lint files
bracesproul Jun 5, 2024
404fdae
Merge branch 'main' into brace/standard-tests-community
bracesproul Jun 5, 2024
d7f7d45
add bedrock test
bracesproul Jun 5, 2024
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
Prev Previous commit
Next Next commit
add to azure in chat openai
bracesproul committed Jun 4, 2024
commit f694aada3fe9e55ff201eb0b53429683df4d412c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable no-process-env */
import { test, expect } from "@jest/globals";
import { ChatModelIntegrationTests } from "@langchain/standard-tests";
import { AIMessageChunk } from "@langchain/core/messages";
import { AzureChatOpenAI } from "../../azure/chat_models.js";
import { ChatOpenAICallOptions } from "../../chat_models.js";

class AzureChatOpenAIStandardIntegrationTests extends ChatModelIntegrationTests<
ChatOpenAICallOptions,
AIMessageChunk
> {
constructor() {
super({
Cls: AzureChatOpenAI,
chatModelHasToolCalling: true,
chatModelHasStructuredOutput: true,
constructorArgs: {
model: "gpt-3.5-turbo"
},
});
}
}

const testClass = new AzureChatOpenAIStandardIntegrationTests();

test("AzureChatOpenAIStandardIntegrationTests", async () => {
const testResults = await testClass.runTests();
expect(testResults).toBe(true);
});
31 changes: 31 additions & 0 deletions libs/langchain-openai/src/tests/azure/chat_models.standard.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable no-process-env */
import { test, expect } from "@jest/globals";
import { ChatModelUnitTests } from "@langchain/standard-tests";
import { AIMessageChunk } from "@langchain/core/messages";
import { AzureChatOpenAI } from "../../azure/chat_models.js";
import { ChatOpenAICallOptions } from "../../chat_models.js";

class AzureChatOpenAIStandardUnitTests extends ChatModelUnitTests<
ChatOpenAICallOptions,
AIMessageChunk
> {
constructor() {
super({
Cls: AzureChatOpenAI,
chatModelHasToolCalling: true,
chatModelHasStructuredOutput: true,
constructorArgs: {},
});
}

testChatModelInitApiKey() {
console.warn("AzureChatOpenAI does not require a single API key. Skipping...");
}
}

const testClass = new AzureChatOpenAIStandardUnitTests();

test("AzureChatOpenAIStandardUnitTests", () => {
const testResults = testClass.runTests();
expect(testResults).toBe(true);
});