Added flag for chat completion, switch in OpenAI client

This commit is contained in:
Shannon Sands 2025-05-17 12:59:20 -07:00
parent 81534f7c8a
commit 59b08a1aa9
3 changed files with 45 additions and 9 deletions

View file

@ -152,7 +152,7 @@ class APIServer(ABC):
self.eval_sem.update_weight(weight)
@abstractmethod
async def check_server_status_task(self):
async def check_server_status_task(self, chat_completion: bool = True):
"""
Check the status of the server. Should be overridden by the child class.
Set self.server_healthy to True if the server is healthy.
@ -320,7 +320,7 @@ class APIServer(ABC):
if (
self.config.base_url is not None
): # skip health check if using OpenAI API
self.check_task = asyncio.create_task(self.check_server_status_task())
self.check_task = asyncio.create_task(self.check_server_status_task(chat_completion=False))
else:
self.server_healthy = True
self.initialized = True