Add a scheduling strategy method provided by user in case when none
of existent strategies fits.
When custom strategy is provided, it will be set as
“self.scheduling_strategy” attribute.Parameters:
name (str): The name of the strategy.
strategy_fn (Callable): The scheduling strategy function.
Process a list of messages by selecting a model based on
the scheduling strategy.
Sends the entire list of messages to the selected model,
and returns a single response.Parameters:
messages (List[OpenAIMessage]): Message list with the chat history in OpenAI API format.
Returns:Union[ChatCompletion, Stream[ChatCompletionChunk],
ChatCompletionStreamManager[BaseModel]]:
ChatCompletion in the non-stream mode, or
Stream[ChatCompletionChunk] in the stream mode, or
ChatCompletionStreamManager[BaseModel] for
structured-output stream.