Skip to content

Commit

Permalink
fix: correct response type
Browse files Browse the repository at this point in the history
  • Loading branch information
lucgagan committed Jun 21, 2023
1 parent 0ef71a5 commit 03c7064
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/createChat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ test("calls user defined function", async () => {
"What is the weather in Albuquerque?"
);

assert.equal(response.role, 'assistant');
assert.equal(response.function_call?.name, 'get_current_weather');
assert.equal(response.role, "assistant");
assert.equal(response.function_call?.name, "get_current_weather");
});

test("overrides function call", async () => {
Expand Down Expand Up @@ -168,7 +168,7 @@ test("overrides function call", async () => {
"get_current_weather"
);

assert.equal(response1.role, 'assistant');
assert.equal(response1.role, "assistant");
assert.match(response1.content, /the current weather in Albuquerque/i);

const response2 = await chat.sendMessage(
Expand All @@ -186,11 +186,11 @@ test("overrides function call", async () => {
functionCall: "none",
}
);

// Expecting a variation of:
// Apologies, but I cannot provide real-time data.
// I'm sorry, but I am currently not able to provide real-time weather information.
assert.match(response3.content, /(sorry|cannot)/i);
assert.equal(response3.role, 'assistant');
assert.equal(response3.role, "assistant");
assert.equal(response3.function_call, undefined);
});

0 comments on commit 03c7064

Please sign in to comment.