mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-04 18:13:03 +00:00
Add Novita AI (https://novita.ai) as a new LLM provider option. Novita offers OpenAI-compatible API endpoints with competitive pricing.
20 lines
680 B
Python
20 lines
680 B
Python
from application.llm.handlers.base import LLMHandler
|
|
from application.llm.handlers.google import GoogleLLMHandler
|
|
from application.llm.handlers.openai import OpenAILLMHandler
|
|
|
|
|
|
class LLMHandlerCreator:
|
|
handlers = {
|
|
"openai": OpenAILLMHandler,
|
|
"google": GoogleLLMHandler,
|
|
"novita": OpenAILLMHandler, # Novita uses OpenAI-compatible API
|
|
"default": OpenAILLMHandler,
|
|
}
|
|
|
|
@classmethod
|
|
def create_handler(cls, llm_type: str, *args, **kwargs) -> LLMHandler:
|
|
handler_class = cls.handlers.get(llm_type.lower())
|
|
if not handler_class:
|
|
handler_class = OpenAILLMHandler
|
|
return handler_class(*args, **kwargs)
|