@@ -30,7 +30,8 @@ const assistantDefinition = {
30
30
name : "Finance Assistant" ,
31
31
instructions :
32
32
"You are a personal finance assistant. Retrieve the latest closing price of a stock using its ticker symbol. "
33
- + "You also know how to generate a full body email in both plain text and html. Only use the functions you have been provideded with" ,
33
+ + "You also know how to generate a full body email formatted as rich html. Do not use other format than rich html."
34
+ + "Only use the functions you have been provideded with" ,
34
35
tools : [
35
36
{
36
37
type : "function" ,
@@ -63,16 +64,12 @@ const assistantDefinition = {
63
64
type : "string" ,
64
65
description : "The subject of the email. Limit to maximum 50 characters" ,
65
66
} ,
66
- text : {
67
- type : "string" ,
68
- description : "The body text of the email in plain text" ,
69
- } ,
70
67
html : {
71
68
type : "string" ,
72
69
description : "The body text of the email in html" ,
73
70
} ,
74
71
} ,
75
- required : [ "subject" , "text" , " html"] ,
72
+ required : [ "subject" , "html" ] ,
76
73
} ,
77
74
} ,
78
75
}
@@ -164,7 +161,6 @@ async function* handleRequiresAction(openai, run, runId, threadId) {
164
161
tool_call_id : toolCall . id ,
165
162
output : await writeAndSendEmail (
166
163
args . subject ,
167
- args . text ,
168
164
args . html
169
165
) ,
170
166
} ;
@@ -216,9 +212,9 @@ async function getStockPrice(symbol) {
216
212
return Promise . resolve ( "" + Math . random ( 10 ) * 1000 ) ; // simulate network request
217
213
}
218
214
219
- async function writeAndSendEmail ( subject , text , html ) {
215
+ async function writeAndSendEmail ( subject , html ) {
220
216
const info = await mailer . sendEmail ( {
221
- to : EMAIL_RECEIVER , subject, text , html
217
+ to : EMAIL_RECEIVER , subject, html
222
218
} ) ;
223
219
224
220
return info . messageId ;
0 commit comments