TradingAgents/GIT_COMMANDS.md

211 lines
5.7 KiB
Markdown

# Git Commands to Fork and Commit Changes
## Important Note
I cannot directly create a fork or push to GitHub from this environment. You'll need to run these commands manually.
## Step 1: Create a Fork on GitHub
1. Go to https://github.com/TauricResearch/TradingAgents
2. Click the "Fork" button in the top right
3. This will create a fork under your GitHub account
## Step 2: Update Your Local Repository
Once you have forked the repository, update your local repository to point to your fork:
```bash
# Navigate to your project directory
cd c:\code\TradingAgents
# Check current remote
git remote -v
# Add your fork as a new remote (replace YOUR_USERNAME with your GitHub username)
git remote add myfork https://github.com/YOUR_USERNAME/TradingAgents.git
# Or if you want to change the origin to your fork:
git remote set-url origin https://github.com/YOUR_USERNAME/TradingAgents.git
```
## Step 3: Review Changed Files
Check what files have been modified:
```bash
git status
```
## Step 4: Stage Your Changes
```bash
# Add all modified files
git add .
# Or add specific files:
git add .env.example
git add cli/utils.py
git add requirements.txt
git add tradingagents/agents/utils/memory.py
git add tradingagents/default_config.py
git add tradingagents/graph/reflection.py
git add tradingagents/graph/setup.py
git add tradingagents/graph/signal_processing.py
git add tradingagents/graph/trading_graph.py
git add tradingagents/llm_factory.py
git add README.md
# Add all the new documentation files
git add docs/LLM_PROVIDER_GUIDE.md
git add docs/MULTI_PROVIDER_SUPPORT.md
git add docs/MIGRATION_GUIDE.md
git add docs/README_ADDITION.md
# Add example files
git add examples/llm_provider_configs.py
git add example_ollama.py
git add quick_test_ollama.py
git add test_ollama.py
# Add documentation
git add CHANGES_SUMMARY.md
git add IMPLEMENTATION_CHECKLIST.md
git add MIGRATION_VERIFIED.md
git add OLLAMA_MODELS.md
git add OLLAMA_VERIFIED.md
git add PULL_OLLAMA_MODELS.md
git add QUICK_START.md
```
## Step 5: Commit Your Changes
```bash
git commit -m "feat: Add multi-provider LLM support (OpenAI, Ollama, Anthropic, Google, Groq, etc.)
- Added LLM factory pattern for provider-agnostic LLM creation
- Support for 9+ LLM providers including free local Ollama models
- Updated CLI with model selection for each provider
- Made memory module provider-agnostic
- Updated all type hints to accept any LangChain-compatible LLM
- Added comprehensive documentation for all providers
- Added example configurations and test scripts
- Updated README with multi-provider examples
- Maintained 100% backward compatibility with OpenAI
Breaking Changes: None - OpenAI remains the default provider
New Features:
- FREE local AI with Ollama (llama3.2, mistral-nemo, qwen2.5)
- Anthropic Claude support (opus, sonnet, haiku)
- Google Gemini support (pro, flash)
- Groq for ultra-fast inference
- OpenRouter for multi-provider access
- Azure OpenAI, Together AI, HuggingFace support
Documentation:
- docs/LLM_PROVIDER_GUIDE.md - Complete setup guide
- docs/MULTI_PROVIDER_SUPPORT.md - Quick reference
- docs/MIGRATION_GUIDE.md - Migration instructions
- examples/llm_provider_configs.py - Ready-to-use configs
- Multiple verification and quick-start guides"
```
## Step 6: Push to Your Fork
```bash
# Push to your fork's main branch
git push myfork main
# Or if you set your fork as origin:
git push origin main
# If you want to push to a new branch:
git checkout -b multi-provider-support
git push myfork multi-provider-support
```
## Step 7: Create a Pull Request (Optional)
If you want to contribute these changes back to the original repository:
1. Go to your fork on GitHub (https://github.com/YOUR_USERNAME/TradingAgents)
2. Click "Pull requests" tab
3. Click "New pull request"
4. Select the branch with your changes
5. Add a description of your changes
6. Click "Create pull request"
## Summary of Changes
### Core Files Modified:
- `tradingagents/llm_factory.py` - NEW: Factory pattern for LLM creation
- `tradingagents/default_config.py` - Added provider configuration
- `tradingagents/graph/trading_graph.py` - Uses LLM factory
- `tradingagents/graph/setup.py` - Generic type hints
- `tradingagents/graph/signal_processing.py` - Generic type hints
- `tradingagents/graph/reflection.py` - Generic type hints
- `tradingagents/agents/utils/memory.py` - Provider-agnostic embeddings
- `cli/utils.py` - Updated model selection for Ollama
- `requirements.txt` - Added langchain-ollama
- `.env.example` - Added all provider API keys
- `README.md` - Updated with multi-provider examples
### Documentation Added:
- `docs/LLM_PROVIDER_GUIDE.md`
- `docs/MULTI_PROVIDER_SUPPORT.md`
- `docs/MIGRATION_GUIDE.md`
- `docs/README_ADDITION.md`
- `CHANGES_SUMMARY.md`
- `IMPLEMENTATION_CHECKLIST.md`
- `MIGRATION_VERIFIED.md`
- `OLLAMA_MODELS.md`
- `OLLAMA_VERIFIED.md`
- `PULL_OLLAMA_MODELS.md`
- `QUICK_START.md`
### Examples Added:
- `examples/llm_provider_configs.py`
- `example_ollama.py`
- `quick_test_ollama.py`
- `test_ollama.py`
- `tests/test_multi_provider.py`
### Test Files:
All test files verify the multi-provider implementation works correctly.
## Alternative: Using GitHub Desktop
If you prefer a GUI:
1. Open GitHub Desktop
2. File → Add Local Repository → Select `c:\code\TradingAgents`
3. Review changes in the "Changes" tab
4. Write commit message
5. Click "Commit to main"
6. Click "Push origin" (or "Publish branch" if new)
## Troubleshooting
### If you get merge conflicts:
```bash
git pull origin main --rebase
# Resolve conflicts
git add .
git rebase --continue
git push myfork main
```
### If you need to undo changes:
```bash
# Undo last commit but keep changes
git reset HEAD~1
# Discard all changes (CAREFUL!)
git reset --hard HEAD
```
### If you want to see the diff:
```bash
git diff
git diff --staged
```