matthoffner commited on
Commit
e842b6d
β€’
1 Parent(s): d6e8dbb

Update app/api/chat/route.ts

Browse files
Files changed (1) hide show
  1. app/api/chat/route.ts +5 -5
app/api/chat/route.ts CHANGED
@@ -10,11 +10,6 @@ const [, sportsApiResultsSchema] = createSportsResultsApi({ apiKey: process.env.
10
  const [, oddsApiSchema] = createOddsApi({ apiKey: process.env.ODDS_API_KEY || '' });
11
  const [, coinMarketCapApiSchema] = createCoinMarketCapApi({ apiKey: process.env.COINMARKETCAP_API_KEY || '' });
12
 
13
- const openai = new OpenAI({
14
- apiKey: process.env.OPENAI_API_KEY,
15
- baseURL: "https://api.mistral.ai"
16
- });
17
-
18
  const functions: any[] = [
19
  serpApiSchema,
20
  oddsApiSchema,
@@ -23,6 +18,11 @@ const functions: any[] = [
23
  ];
24
 
25
  export async function POST(req: Request) {
 
 
 
 
 
26
  const { messages, function_call } = await req.json()
27
 
28
  const response = await openai.chat.completions.create({
 
10
  const [, oddsApiSchema] = createOddsApi({ apiKey: process.env.ODDS_API_KEY || '' });
11
  const [, coinMarketCapApiSchema] = createCoinMarketCapApi({ apiKey: process.env.COINMARKETCAP_API_KEY || '' });
12
 
 
 
 
 
 
13
  const functions: any[] = [
14
  serpApiSchema,
15
  oddsApiSchema,
 
18
  ];
19
 
20
  export async function POST(req: Request) {
21
+ const openai = new OpenAI({
22
+ apiKey: process.env.OPENAI_API_KEY,
23
+ baseURL: "https://api.mistral.ai"
24
+ });
25
+
26
  const { messages, function_call } = await req.json()
27
 
28
  const response = await openai.chat.completions.create({