Skip to content

Commit

Permalink
Rename openai api token env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Dec 18, 2024
1 parent ce34803 commit 9fbbeec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/durableObjects/ChatRoom.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export class ChatRoom extends Server<Env> {
checkNewTracksResponse(openAiTracksResponse, true)

invariant(this.env.OPENAI_MODEL_ENDPOINT)
invariant(this.env.OPEN_AI_KEY)
invariant(this.env.OPENAI_API_TOKEN)

const params = new URLSearchParams()
const { voice, instructions } = data
Expand All @@ -419,7 +419,7 @@ export class ChatRoom extends Server<Env> {
const openaiAnswer = await requestOpenAIService(
openAiTracksResponse.sessionDescription ||
({} as SessionDescription),
this.env.OPEN_AI_KEY,
this.env.OPENAI_API_TOKEN,
this.env.OPENAI_MODEL_ENDPOINT,
params
)
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_room.$roomName.room.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const loader = async ({ request, context }: LoaderFunctionArgs) => {
mode: context.mode,
hasDb: Boolean(context.env.DB),
hasAiCredentials: Boolean(
context.env.OPEN_AI_KEY && context.env.OPENAI_MODEL_ENDPOINT
context.env.OPENAI_API_TOKEN && context.env.OPENAI_MODEL_ENDPOINT
),
})
}
Expand Down
2 changes: 1 addition & 1 deletion app/types/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export type Env = {
MAX_WEBCAM_QUALITY_LEVEL?: string
MAX_API_HISTORY?: string
DB?: D1Database
OPEN_AI_KEY?: string
OPENAI_API_TOKEN?: string
OPENAI_MODEL_ENDPOINT?: string
}

0 comments on commit 9fbbeec

Please sign in to comment.