Enhance data integration and transcript parsing

- Improved date parsing in fetch_and_store_chat_data to support multiple formats and added error logging for unparseable dates.
- Enhanced parse_and_store_transcript_messages to handle empty transcripts and expanded message pattern recognition for both User and Assistant.
- Implemented intelligent splitting of transcripts based on detected patterns and timestamps, with fallback mechanisms for unrecognized formats.
- Updated documentation for Celery and Redis setup, troubleshooting, and project structure.
- Added markdown linting configuration and scripts for code formatting.
- Updated Nginx configuration to change the web server port.
- Added xlsxwriter dependency for Excel file handling in project requirements.
This commit is contained in:
2025-05-18 19:18:31 +00:00
parent 8bbbb109bd
commit f0ae061fa7
24 changed files with 1672 additions and 931 deletions

View File

@ -61,20 +61,64 @@
"customizations": {
"vscode": {
"extensions": [
"bierner.github-markdown-preview",
"bierner.markdown-mermaid",
"bierner.markdown-preview-github-styles",
"charliermarsh.ruff",
"CS50.ddb50",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode",
"GitHub.copilot-chat",
"GitHub.copilot-workspace",
"GitHub.remotehub",
"github.vscode-github-actions",
"ms-vscode.copilot-mermaid-diagram",
"ms-vscode.vscode-copilot-data-analysis",
"ms-vscode.vscode-copilot-vision",
"ms-vscode.vscode-github-issue-notebooks",
"ms-vscode.vscode-websearchforcopilot",
"PyCQA.bandit-pycqa",
"samuelcolvin.jinjahtml",
"shd101wyy.markdown-preview-enhanced",
"tamasfe.even-better-toml",
"timonwong.shellcheck",
"trunk.io"
"trunk.io",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"yzhang.markdown-all-in-one"
],
"settings": {
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes an up-to-date version of Git, built from source as needed, pre-installed and available on the `PATH`."
},
{
"text": "This dev container includes the Docker CLI (`docker`) pre-installed and available on the `PATH` for running and managing containers using a dedicated Docker daemon running inside the dev container."
},
{
"text": "This dev container includes an up-to-date version of Git, built from source as needed, pre-installed and available on the `PATH`."
},
{
"text": "This dev container includes Go and common Go utilities pre-installed and available on the `PATH`, along with the Go language extension for Go development."
},
{
"text": "This dev container includes `node`, `npm` and `eslint` pre-installed and available on the `PATH` for Node.js and JavaScript development."
},
{
"text": "This dev container includes `node`, `npm` and `eslint` pre-installed and available on the `PATH` for Node.js and JavaScript development."
},
{
"text": "This dev container includes `python3` and `pip3` pre-installed and available on the `PATH`, along with the Python language extensions for Python development."
},
{
"text": "This dev container includes an SSH server so that you can use an external terminal, sftp, or SSHFS to interact with it. The first time you've started the container, you will want to set a password for your user. With each connection to the container, you'll want to forward the SSH port to your local machine and use a local terminal or other tool to connect using the password you set."
},
{
"text": "This dev container includes the GitHub CLI (`gh`), which is pre-installed and available on the `PATH`. IMPORTANT: `gh api -f` does not support object values, use multiple `-f` flags with hierarchical keys and string values instead. When using GitHub actions `actions/upload-artifact` or `actions/download-artifact` use v4 or later."
},
{
"text": "This workspace is in a dev container running on \"Ubuntu 22.04.5 LTS\".\n\nUse `\"$BROWSER\" <url>` to open a webpage in the host's default browser.\n\nSome of the command line tools available on the `PATH`: `apt`, `dpkg`, `docker`, `git`, `gh`, `curl`, `wget`, `ssh`, `scp`, `rsync`, `gpg`, `ps`, `lsof`, `netstat`, `top`, `tree`, `find`, `grep`, `zip`, `unzip`, `tar`, `gzip`, `bzip2`, `xz`"
}
],
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
@ -87,6 +131,10 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint",
"editor.formatOnSave": true
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
@ -130,14 +178,19 @@
"fileMatch": ["*/devcontainer.json"],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json"
}
]
],
"markdownlint.config": {
"MD007": {
"indent": 4
}
}
}
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [6379, 8001],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y; sudo apt install -y ruby-foreman; npm i -g prettier prettier-plugin-jinja-template; redis-server --daemonize yes; uname -a; export UV_LINK_MODE=copy; uv python install; uv pip install -Ur pyproject.toml"
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y;
sudo apt install -y ruby-foreman;
npm install --save-dev prettier prettier-plugin-jinja-template markdownlint-cli2;
# Install ohmyposh
curl -s https://ohmyposh.dev/install.sh | bash -s
if ! command -v oh-my-posh &> /dev/null; then
echo "Failed to install oh-my-posh. Please check the installation script."
else
echo "oh-my-posh installed successfully."
echo "Setting up oh-my-posh theme..."
# Install fonts using proper bash array syntax
fonts=("Hack" "AnonymousPro" "Noto")
for font in "${fonts[@]}"; do
oh-my-posh font install "$font"
done
fi
# Setup shell completions
echo "Setting up shell completions..."
# if uv, uvx, ruff, or oh-my-posh are not available, don't add shell completions for that tool
if ! command -v uv &> /dev/null; then
echo "uv not found, skipping shell completion setup for uv"
else
echo "uv found, setting up shell completion"
uv generate-shell-completion bash > ~/.cache/uv-completion.bash
fi
if ! command -v uvx &> /dev/null; then
echo "uvx not found, skipping shell completion setup for uvx"
else
echo "uvx found, setting up shell completion"
uvx --generate-shell-completion bash > ~/.cache/uvx-completion.bash
fi
if ! command -v ruff &> /dev/null; then
echo "ruff not found, skipping shell completion setup for ruff"
else
echo "ruff found, setting up shell completion"
ruff generate-shell-completion bash > ~/.cache/ruff-completion.bash
fi
if ! command -v oh-my-posh &> /dev/null; then
echo "oh-my-posh not found, skipping shell completion setup for oh-my-posh"
else
echo "oh-my-posh found, setting up shell completion"
oh-my-posh init bash --config ~/.cache/oh-my-posh/themes/paradox.omp.json > ~/.cache/oh-my-posh-completion.bash
fi
# Check if ~/.bashrc already contains the completion setup
if ! grep -q 'uv generate-shell-completion' ~/.bashrc; then
echo "Adding shell completions to ~/.bashrc"
cat << EOF >> ~/.bashrc
# Shell completions
if [ -f ~/.cache/uv-completion.bash ]; then
source ~/.cache/uv-completion.bash
fi
if [ -f ~/.cache/uvx-completion.bash ]; then
source ~/.cache/uvx-completion.bash
fi
if [ -f ~/.cache/ruff-completion.bash ]; then
source ~/.cache/ruff-completion.bash
fi
if [ -f ~/.cache/oh-my-posh-completion.bash ]; then
source ~/.cache/oh-my-posh-completion.bash
fi
export UV_LINK_MODE=copy;
EOF
echo "Shell completions added to ~/.bashrc"
else
echo "Shell completions already present in ~/.bashrc"
fi
uv python install
uv pip install -Ur pyproject.toml --group dev
redis-server --daemonize yes;