Ugo101
06/11/2024, 10:21 PMtools
, but my intention is to include tool calls as part of the data sent to OpenAI:
import OpenAI from 'openai';
export default async ({
openaiSecret,
model,
temperature,
messages,
max_tokens
}, {
logging,
req: ctx
}, ) => {
const openai = new OpenAI({
apiKey: openaiSecret
});
const tools = ctx.request.body.tools
try {
const completion = await openai.beta.chat.completions.stream({
model,
temperature,
messages,
max_tokens,
stream: true,
tools
});
return completion;
} catch (error) {
logging.log(error);
return '';
}
};
Could you please provide guidance on why the response is not being returned when tools
are included and how to resolve this issue?Vapi
06/11/2024, 10:22 PMUgo101
06/12/2024, 5:55 AMSahil
06/12/2024, 6:05 AMUgo101
06/12/2024, 7:16 AMSahil
06/12/2024, 8:26 AM