randydev commited on
Commit
cc7a029
·
verified ·
1 Parent(s): 0d6a55d

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -34,9 +34,9 @@ app.post('/api/chatgpt-old', async (req, res) => {
34
  const payload = {"prompt": query}
35
  const type_urls = "openai-gpt"
36
  const url = "https://${type_urls}.remixproject.org"
37
- const response = await axios.post(url, payload, { headers }))
38
  console.log('Response:', response.data)
39
- const output = response.data.choice.[0].message.content
40
  res.json({message: output})
41
  } catch (error) {
42
  res.status(401).json({error: error.message})
 
34
  const payload = {"prompt": query}
35
  const type_urls = "openai-gpt"
36
  const url = "https://${type_urls}.remixproject.org"
37
+ const response = await axios.post(url, payload, { headers })
38
  console.log('Response:', response.data)
39
+ const output = response.data.choices.[0].message.content
40
  res.json({message: output})
41
  } catch (error) {
42
  res.status(401).json({error: error.message})