Skip to content

Commit ae69973

Browse files
committed
tutor
1 parent 7bba8bf commit ae69973

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

assistant-function-calling/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,62 @@
1414
1515
Hello there, I'm a Math assistant. We'll start with a small quiz.
1616
17+
Quiz :
18+
displayQuiz
19+
Question: Explain why the sum of two even numbers is always even.
20+
_
21+
```
22+
23+
Then I answered:
24+
25+
```
26+
By the distributive law: `2*n+2*p=2*(n+p)`
27+
```
28+
29+
Then the assistant replied with a new question:
30+
31+
```
32+
Question: What is the value of x in the equation 2x + 3 = 15?
33+
34+
Options: 5,6,7,8
35+
_
36+
```
37+
I answered:
38+
39+
```
40+
6
41+
```
42+
43+
Then the assistant answered:
44+
45+
```
46+
Your responses from the quiz :
47+
[ 'By the distributive law: `2*n+2*p=2*(n+p)`\n', '6\n' ]
48+
Great job on both questions!
49+
50+
1. Your explanation for why the sum of two even numbers is correct. It's indeed because you can factor out a 2, which means the sum is still a multiple of 2, and hence even.
51+
52+
2. You chose the correct answer for the value of \( x \) in the equation \( 2x + 3 = 15 \). The solution is \( x = 6 \), which you can find by subtracting 3 from both sides and then dividing by 2.
53+
54+
Do you want to keep having a conversation? (yes/no) _
55+
```
56+
57+
Please, take notice of how the LLM uses $\LaTeX$ to write the formulae like $2x + 3 = 15$
58+
59+
To the last question I answered:
60+
61+
```
62+
Do you want to keep having a conversation? (yes/no) n
63+
Alrighty then, I hope you learned something!
64+
```
65+
66+
## Execution
67+
68+
```
69+
➜ assistant-function-calling git:(main) ✗ ts-node app.ts
70+
71+
Hello there, I'm a Math assistant. We'll start with a small quiz.
72+
1773
Quiz :
1874
display_quiz
1975
Question: Explain the difference between a prime number and a composite number.

assistant-function-calling/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function displayQuiz(title: string, questions: Record<string, string>[]) {
5454
}
5555

5656
const quizJson = {
57-
name: "display_quiz",
57+
name: "displayQuiz",
5858
description:
5959
"Displays a quiz to the student, and returns the student's response. A single quiz can have multiple questions.",
6060
parameters: {

0 commit comments

Comments
 (0)