refactor: decouple kotaemon from ktem and remove theflow dependency#837
refactor: decouple kotaemon from ktem and remove theflow dependency#837phv2312 wants to merge 17 commits into
Conversation
|
|
||
| def hash_password(password: str) -> str: | ||
| """Return the SHA-256 hex digest used for stored passwords.""" | ||
| return hashlib.sha256(password.encode()).hexdigest() |
|
Please help fix the github sec scan and Copilot review first |
|
|
||
|
|
||
| @dataclass(kw_only=True) | ||
| class EndpointChatLLM(ChatLLM): |
There was a problem hiding this comment.
Why do we need this openai compatible endpoint provider while we can use the OpenAI provider class only
| LC_GEMINI = "LCGeminiChat" | ||
| LC_COHERE = "LCCohereChat" | ||
| LC_OLLAMA = "LCOllamaChat" | ||
| LLAMA_CPP = "LlamaCppChat" |
There was a problem hiding this comment.
Why we need two class for same purpose
ChatOpenAI vs. LC_CHAT_OPENAI
AZURE_CHAT_OPENAI vs. LCAzureChatOpenAI
| if self._stream: | ||
| return self.stream(messages, **kwargs) # type: ignore | ||
| if self.streaming: | ||
| return self.stream(messages, **kwargs) # type: ignore[return-value] |
There was a problem hiding this comment.
should seperate two function for normal run and streaming run
There was a problem hiding this comment.
Please help check, I think we could remove the completions module and use the chat completion only?
*Completions API is a legacy endpoint that accepts a single text string.
|
|
||
| text = self.inflow.flow().text | ||
| return self.__call__(text) | ||
| @classmethod |
There was a problem hiding this comment.
Because the purpose of ' describe ' is to show the parameter in the UI only, consider moving the describe logic to ktem and removing the ChatLLM (use BaseLLM only)
| if vs_ids and self.VS: | ||
| self.VS.delete(vs_ids) | ||
| if ds_ids: | ||
| self.DS.delete(ds_ids) |
There was a problem hiding this comment.
Please help check the related issue about deleting files: #807
Description
This PR is a broad architecture refactor that separates core
kotaemonprimitives fromktemapp concerns, removes the remainingtheflow-driven plumbing from kotaemon.kotaemoncore logic fromktemapplication-specific behaviortheflow/flowsettingsusage with internal typed/configured abstractionsktem.indexintoktem.collectionsto better reflect file collection ownershipktem.db.modelsandktem.db.cruds.agents/Type of change
Checklist