light-infer-chat commited on
Commit
2cd9b1c
·
1 Parent(s): 20c42f2
app/api/v1/router.py CHANGED
@@ -15,4 +15,5 @@ api_v1_router.include_router(code_executor.router, tags=["Code Executor"])
15
  api_v1_router.include_router(verify_router, prefix="/verify", tags=["Verify"])
16
  api_v1_router.include_router(reconcile.router, tags=["Reconcile"])
17
  api_v1_router.include_router(scraper.router, tags=["Web Scraping"])
 
18
  api_v1_router.include_router(chat.router, tags=["Chat"])
 
15
  api_v1_router.include_router(verify_router, prefix="/verify", tags=["Verify"])
16
  api_v1_router.include_router(reconcile.router, tags=["Reconcile"])
17
  api_v1_router.include_router(scraper.router, tags=["Web Scraping"])
18
+ api_v1_router.include_router(web_search.router, tags=["Web Search"])
19
  api_v1_router.include_router(chat.router, tags=["Chat"])
app/services/chat_service.py CHANGED
@@ -456,6 +456,7 @@ async def chat_completion(
456
  max_tokens, temperature, top_p,
457
  )
458
  if result:
 
459
  return result
460
  raise RuntimeError("AionLabs request failed")
461
 
@@ -464,6 +465,7 @@ async def chat_completion(
464
  messages, response_format, max_tokens, temperature, top_p,
465
  )
466
  if result:
 
467
  return result
468
  raise RuntimeError("OpenRouter Mimika request failed")
469
 
@@ -477,6 +479,7 @@ async def chat_completion(
477
  messages, response_format, max_tokens, temperature, top_p, target,
478
  )
479
  if result:
 
480
  return result
481
 
482
  logger.info("MegaNova failed, falling back to AionLabs")
@@ -491,6 +494,7 @@ async def chat_completion(
491
  max_tokens, temperature, top_p,
492
  )
493
  if result:
 
494
  return result
495
 
496
  logger.info("AionLabs failed, falling back to OpenRouter Mimika")
@@ -498,6 +502,7 @@ async def chat_completion(
498
  messages, response_format, max_tokens, temperature, top_p,
499
  )
500
  if result:
 
501
  return result
502
 
503
  raise RuntimeError("All AI providers exhausted")
 
456
  max_tokens, temperature, top_p,
457
  )
458
  if result:
459
+ result["model"] = model
460
  return result
461
  raise RuntimeError("AionLabs request failed")
462
 
 
465
  messages, response_format, max_tokens, temperature, top_p,
466
  )
467
  if result:
468
+ result["model"] = model
469
  return result
470
  raise RuntimeError("OpenRouter Mimika request failed")
471
 
 
479
  messages, response_format, max_tokens, temperature, top_p, target,
480
  )
481
  if result:
482
+ result["model"] = model
483
  return result
484
 
485
  logger.info("MegaNova failed, falling back to AionLabs")
 
494
  max_tokens, temperature, top_p,
495
  )
496
  if result:
497
+ result["model"] = model
498
  return result
499
 
500
  logger.info("AionLabs failed, falling back to OpenRouter Mimika")
 
502
  messages, response_format, max_tokens, temperature, top_p,
503
  )
504
  if result:
505
+ result["model"] = model
506
  return result
507
 
508
  raise RuntimeError("All AI providers exhausted")