Skip to content

Commit 9258534

Browse files
authored
chore(openai): add gpt-5 parameter tests (#8650)
1 parent d534ed7 commit 9258534

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

libs/langchain-openai/src/tests/chat_models_responses.int.test.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,13 +826,30 @@ test("useResponsesApi=true should emit handleLLMNewToken events during streaming
826826
expect(endEvents.length).toBeGreaterThan(0);
827827
});
828828

829-
test("gpt-5", async () => {
830-
const model = new ChatOpenAI({ model: "gpt-5" });
831-
const response = await model.invoke(
829+
describe("gpt-5", () => {
830+
const storyPrompt = new HumanMessage(
832831
"Write a short story about a robot who discovers they can dream. Include themes of consciousness, identity, and what it means to be alive. The story should be approximately 200 words and have a hopeful ending."
833832
);
834-
expect(response).toBeDefined();
835-
console.log(response);
833+
test("works", async () => {
834+
const model = new ChatOpenAI({ model: "gpt-5" });
835+
const response = await model.invoke([storyPrompt]);
836+
expect(response).toBeDefined();
837+
console.log(response);
838+
});
839+
840+
// https://github.com/langchain-ai/langchainjs/issues/8641
841+
test("works with maxTokens", async () => {
842+
const model = new ChatOpenAI({ model: "gpt-5", maxTokens: 100 });
843+
const response = await model.invoke([storyPrompt]);
844+
expect(response).toBeDefined();
845+
});
846+
847+
// https://github.com/langchain-ai/langchainjs/issues/8642
848+
test("works with temperature", async () => {
849+
const model = new ChatOpenAI({ model: "gpt-5", temperature: 0.5 });
850+
const response = await model.invoke([storyPrompt]);
851+
expect(response).toBeDefined();
852+
});
836853
});
837854

838855
describe("promptCacheKey", () => {

0 commit comments

Comments
 (0)