-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
61 lines (52 loc) · 1.48 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import List
from cat.mad_hatter.decorators import tool, hook, plugin
from .llm.anthropic import LLMAnthropicChatConfig
from .llm.cohere import LLMCohereConfig
from .llm.gemini import LLMGeminiChatConfig
from .llm.hugging_face import LLMHuggingFaceEndpointConfig, LLMHuggingFaceTextGenInferenceConfig
from .llm.openai import (
LLMOpenAIChatConfig,
LLMOpenAIConfig,
LLMOpenAICompatibleConfig,
LLMAzureOpenAIConfig,
LLMAzureChatOpenAIConfig,
)
from .llm.ollama import LLMOllamaConfig
from .embedder.embedder import (
EmbedderOpenAICompatibleConfig,
EmbedderOpenAIConfig,
EmbedderAzureOpenAIConfig,
EmbedderCohereConfig,
EmbedderQdrantFastEmbedConfig,
EmbedderGeminiChatConfig,
)
# TODO: Add settings to allow model management
llms = [
LLMAnthropicChatConfig,
LLMCohereConfig,
LLMGeminiChatConfig,
LLMHuggingFaceEndpointConfig,
LLMHuggingFaceTextGenInferenceConfig,
LLMOpenAIChatConfig,
LLMOpenAIConfig,
LLMOpenAICompatibleConfig,
LLMAzureOpenAIConfig,
LLMAzureChatOpenAIConfig,
LLMOllamaConfig,
]
@hook
def factory_allowed_llms(allowed, cat) -> List:
allowed = allowed + llms
return allowed
embedders = [
EmbedderOpenAICompatibleConfig,
EmbedderOpenAIConfig,
EmbedderAzureOpenAIConfig,
EmbedderCohereConfig,
EmbedderQdrantFastEmbedConfig,
EmbedderGeminiChatConfig,
]
@hook
def factory_allowed_embedders(allowed, cat) -> List:
allowed = allowed + embedders
return allowed