Chats
EndpointChatLLM ¶
Bases: ChatLLM
A ChatLLM that uses an endpoint to generate responses. This expects an OpenAI API compatible endpoint.
Attributes:
Name | Type | Description |
---|---|---|
endpoint_url |
str
|
The url of a OpenAI API compatible endpoint. |
Source code in libs/kotaemon/kotaemon/llms/chats/endpoint_based.py
run ¶
Generate response from messages Args: messages (str | BaseMessage | list[BaseMessage]): history of messages to generate response from **kwargs: additional arguments to pass to the OpenAI API Returns: LLMInterface: generated response
Source code in libs/kotaemon/kotaemon/llms/chats/endpoint_based.py
LCChatMixin ¶
Mixin for langchain based chat models
Source code in libs/kotaemon/kotaemon/llms/chats/langchain_based.py
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
invoke ¶
Generate response from messages
Parameters:
Name | Type | Description | Default |
---|---|---|---|
messages
|
str | BaseMessage | list[BaseMessage]
|
history of messages to generate response from |
required |
**kwargs
|
additional arguments to pass to the langchain chat model |
{}
|
Returns:
Name | Type | Description |
---|---|---|
LLMInterface |
LLMInterface
|
generated response |
Source code in libs/kotaemon/kotaemon/llms/chats/langchain_based.py
LlamaCppChat ¶
Bases: ChatLLM
Wrapper around the llama-cpp-python's Llama model
Source code in libs/kotaemon/kotaemon/llms/chats/llamacpp.py
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
client_object ¶
Get the llama-cpp-python client object
Source code in libs/kotaemon/kotaemon/llms/chats/llamacpp.py
AzureChatOpenAI ¶
Bases: BaseChatOpenAI
OpenAI chat model provided by Microsoft Azure
Source code in libs/kotaemon/kotaemon/llms/chats/openai.py
prepare_client ¶
Get the OpenAI client
Parameters:
Name | Type | Description | Default |
---|---|---|---|
async_version
|
bool
|
Whether to get the async version of the client |
False
|
Source code in libs/kotaemon/kotaemon/llms/chats/openai.py
openai_response ¶
Get the openai response
Source code in libs/kotaemon/kotaemon/llms/chats/openai.py
ChatOpenAI ¶
Bases: BaseChatOpenAI
OpenAI chat model
Source code in libs/kotaemon/kotaemon/llms/chats/openai.py
prepare_client ¶
Get the OpenAI client
Parameters:
Name | Type | Description | Default |
---|---|---|---|
async_version
|
bool
|
Whether to get the async version of the client |
False
|
Source code in libs/kotaemon/kotaemon/llms/chats/openai.py
openai_response ¶
Get the openai response