ethiotech4848 commited on
Commit
4a450c4
·
verified ·
1 Parent(s): 96f8bba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -18,14 +18,13 @@ system_prompt += (
18
  "'I'm not sure about that. Let me connect you with a human agent.'"
19
  )
20
 
21
- # Initialize OpenAI client with optional custom base URL
22
- client = OpenAI(
23
- api_key=os.getenv("OPENAI_API_KEY"),
24
- api_base=os.getenv("OPENAI_API_BASE", "https://fast.typegpt.net/v1"),
25
- )
26
 
27
  # Optional: Secret token for webhook auth, set in environment variables
28
- # WEBHOOK_SECRET_TOKEN = os.getenv("WEBHOOK_SECRET_TOKEN")
29
 
30
  @app.post("/ask")
31
  async def ask(
 
18
  "'I'm not sure about that. Let me connect you with a human agent.'"
19
  )
20
 
21
+ # Initialize OpenAI client with your API key
22
+ client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
23
+ # Set custom base URL if provided, else default to official endpoint
24
+ client.api_base = os.getenv("OPENAI_API_BASE", "https://fast.typegpt.net/v1")
 
25
 
26
  # Optional: Secret token for webhook auth, set in environment variables
27
+ WEBHOOK_SECRET_TOKEN = os.getenv("WEBHOOK_SECRET_TOKEN")
28
 
29
  @app.post("/ask")
30
  async def ask(