We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 053aa54 commit 0402fa8Copy full SHA for 0402fa8
1 file changed
demo_server.py
@@ -438,6 +438,13 @@ async def gen():
438
if req.session_id not in _agent_cache:
439
logger.info(f"Initializing RankifyAgent for session {req.session_id}")
440
backend = "azure" if AZURE_KEY else "openai"
441
+ if backend == "azure":
442
+ os.environ["AZURE_API_KEY"] = AZURE_KEY
443
+ os.environ["AZURE_API_BASE"] = AZURE_ENDPOINT
444
+ os.environ["AZURE_API_VERSION"] = AZURE_API_VER
445
+ os.environ["AZURE_OPENAI_API_KEY"] = AZURE_KEY
446
+ os.environ["AZURE_OPENAI_ENDPOINT"] = AZURE_ENDPOINT
447
+ os.environ["AZURE_DEPLOYMENT_NAME"] = AZURE_DEPLOYMENT
448
_agent_cache[req.session_id] = RankifyAgent(backend=backend)
449
450
agent = _agent_cache[req.session_id]
0 commit comments