fix
Showing
3 changed files
with
7 additions
and
4 deletions
.env
0 → 100644
| ... | @@ -26,7 +26,7 @@ function App() { | ... | @@ -26,7 +26,7 @@ function App() { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | function getEngines(){ | 28 | function getEngines(){ |
| 29 | fetch("http://localhost:3080/models") | 29 | fetch(process.env.LOCALHOST + "/models") |
| 30 | .then(res => res.json()) | 30 | .then(res => res.json()) |
| 31 | .then(data => { | 31 | .then(data => { |
| 32 | console.log(data.models.data) | 32 | console.log(data.models.data) |
| ... | @@ -48,7 +48,7 @@ function App() { | ... | @@ -48,7 +48,7 @@ function App() { |
| 48 | // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post | 48 | // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post |
| 49 | const messages = chatLogNew.map((message) => message.message).join("\n") | 49 | const messages = chatLogNew.map((message) => message.message).join("\n") |
| 50 | 50 | ||
| 51 | const response = await fetch("http://localhost:3080/", { | 51 | const response = await fetch(process.env.LOCALHOST, { |
| 52 | method: "POST", | 52 | method: "POST", |
| 53 | headers: { | 53 | headers: { |
| 54 | "Content-Type": "application/json" | 54 | "Content-Type": "application/json" | ... | ... |
| ... | @@ -5,8 +5,8 @@ const cors = require('cors') | ... | @@ -5,8 +5,8 @@ const cors = require('cors') |
| 5 | 5 | ||
| 6 | // Open AI Configuration | 6 | // Open AI Configuration |
| 7 | const configuration = new Configuration({ | 7 | const configuration = new Configuration({ |
| 8 | organization: "org-organization", | 8 | organization: process.env.API_ORG, |
| 9 | apiKey: "sk-apiKey", | 9 | apiKey: process.env.API_KEY, |
| 10 | }); | 10 | }); |
| 11 | const openai = new OpenAIApi(configuration); | 11 | const openai = new OpenAIApi(configuration); |
| 12 | 12 | ... | ... |
-
Please register or sign in to post a comment