-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chat): hacking on some RAG chat, playing with TUI #61
Conversation
PR Reviewer Guide 🔍(Review updated until commit 0ed1c29)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 0ed1c29
Previous suggestionsSuggestions up to commit f9ce11b
|
@@ -57,6 +57,9 @@ def get_relevant_splits(self, text: str, limit: int = 10): | |||
from corpora_ai.provider_loader import load_llm_provider | |||
|
|||
llm = load_llm_provider() | |||
# better_text = llm.get_synthetic_embedding_text(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth manipulating the input before finding the nearest neighbor ... but ... it's slow and expensive ...
@@ -28,7 +28,7 @@ def process_tarball(corpus_id: str, tarball: bytes) -> None: | |||
corpus_file.save() | |||
corpus_file.splits.all().delete() | |||
|
|||
generate_summary_task.delay(corpus_file.id) | |||
# generate_summary_task.delay(corpus_file.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less work ... we never really tried to use the summaries anyways ..
@@ -87,3 +90,21 @@ def get_summary(self, text: str) -> str: | |||
), | |||
] | |||
) | |||
|
|||
def get_synthetic_embedding_text(self, text: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused, could be removed .. but, feels like something is there ;9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should probably just throw this away as it's currently not used. I tried to make a chatgpt-UI-like TUI but that's not an extremely trivial endeavor so I just kept the chat command mostly as it was. But, I think this ratatui
idea has some legs. If I'm wrong, I'll just rm it and clean it up later.
Persistent review updated to latest commit 0ed1c29 |
PR Type
enhancement, tests
Description
ratatui
in Rust.Changes walkthrough 📝
9 files
models.py
Comment out synthetic embedding text code
py/packages/corpora/models.py
corpus.py
Update system message and import in corpus router
py/packages/corpora/routers/corpus.py
CHAT_SYSTEM_MESSAGE
.sync.py
Comment out summary task generation
py/packages/corpora/tasks/sync.py
generate_summary_task
.llm_interface.py
Add synthetic embedding text method
py/packages/corpora_ai/llm_interface.py
get_synthetic_embedding_text
.SYNTHETIC_EMBEDDING_SYSTEM_MESSAGE
.prompts.py
Add new system messages for chat and embedding
py/packages/corpora_ai/prompts.py
SYNTHETIC_EMBEDDING_SYSTEM_MESSAGE
.CHAT_SYSTEM_MESSAGE
.chat-tui.rs
Implement chat TUI with event handling
rs/core/corpora_cli/src/commands/chat-tui.rs
ratatui
.init.rs
Calculate and display tarball size in MB
rs/core/corpora_cli/src/commands/init.rs
git.rs
Add exclude globs and debug prints in GitCollector
rs/core/corpora_cli/src/context/collector/git.rs
config.rs
Support exclude globs and add debug prints in config
rs/core/corpora_cli/src/context/config.rs
1 files
test_sync.py
Comment out summary task assertion in tests
py/packages/corpora/tasks/test_sync.py
2 files
provider_loader.py
Add comments for model specification in provider loader
py/packages/corpora_ai/provider_loader.py
llm_client.py
Add comments for runtime model specification in OpenAI client
py/packages/corpora_ai_openai/llm_client.py
1 files
chat.rs
Comment out debug print statements in chat command
rs/core/corpora_cli/src/commands/chat.rs
1 files
docker-compose.yaml
Add Azure endpoint to environment variables
docker-compose.yaml
OPENAI_AZURE_ENDPOINT
to environment variables.1 files
Cargo.toml
Add new dependencies for TUI and glob handling
rs/core/corpora_cli/Cargo.toml
crossterm
,globset
,ratatui
,tui-textarea
.