File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ services:
8
8
- QUESTION_SVC_PORT=$QUESTION_SVC_PORT
9
9
- MATCHING_SVC_PORT=$MATCHING_SVC_PORT
10
10
- COLLAB_SVC_PORT=$COLLAB_SVC_PORT
11
+ - OPENAI_API_KEY=$OPENAI_API_KEY
11
12
ports :
12
13
- $FRONTEND_PORT:$FRONTEND_PORT
13
14
depends_on :
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ ARG BASE_URI \
4
4
USER_SVC_PORT \
5
5
QUESTION_SVC_PORT \
6
6
MATCHING_SVC_PORT \
7
- COLLAB_SVC_PORT
7
+ COLLAB_SVC_PORT \
8
+ OPENAI_API_KEY
8
9
WORKDIR /app
9
10
COPY package.json .
10
11
COPY yarn.lock .
@@ -13,7 +14,8 @@ ENV NEXT_PUBLIC_BASE_URI=$BASE_URI \
13
14
NEXT_PUBLIC_USER_SVC_PORT=$USER_SVC_PORT \
14
15
NEXT_PUBLIC_QUESTION_SVC_PORT=$QUESTION_SVC_PORT \
15
16
NEXT_PUBLIC_MATCHING_SVC_PORT=$MATCHING_SVC_PORT \
16
- NEXT_PUBLIC_COLLAB_SVC_PORT=$COLLAB_SVC_PORT
17
+ NEXT_PUBLIC_COLLAB_SVC_PORT=$COLLAB_SVC_PORT \
18
+ NEXT_PUBLIC_OPENAI_API_KEY=$OPENAI_API_KEY
17
19
18
20
# Production build stage
19
21
FROM base AS build
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ export const sendAiMessage = async (message: string) => {
3
3
method : 'POST' ,
4
4
headers : {
5
5
'Content-Type' : 'application/json' ,
6
- 'Authorization' : `Bearer ${ process . env . OPENAI_API_KEY } ` ,
6
+ 'Authorization' : `Bearer ${ process . env . NEXT_PUBLIC_OPENAI_API_KEY } ` ,
7
7
} ,
8
8
body : JSON . stringify ( {
9
9
model : 'gpt-3.5-turbo' ,
10
10
messages : [
11
11
{
12
12
role : 'user' ,
13
- content : "just work and say its okdoc" ,
13
+ content : message ,
14
14
} ,
15
15
] ,
16
16
} ) ,
You can’t perform that action at this time.
0 commit comments