// Get the current date in the format "January 20, 2024"
constcurrentDate=newIntl.DateTimeFormat('en-US',{
year:'numeric',
month:'long',
day:'2-digit'
}).format(newDate());
constres=awaitfetch(`${url}/chat/completions`,{
method:'POST',
headers:{
Accept:'application/json',
'Content-Type':'application/json',
Authorization:`Bearer ${token}`
},
body:JSON.stringify({
model:model,
// Few shot prompting
messages:[
{
role:'assistant',
content:`You are tasked with generating web search queries. Give me an appropriate query to answer my question for google search. Answer with only the query. Today is ${currentDate}.`