-
Notifications
You must be signed in to change notification settings - Fork 146
Feature/frontend integration #63
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
73d7e06
feat: Add frontend integration with Vue.js + TypeScript
vakovalskii 4fdfdbc
fix: Add missing shared/lib utilities
vakovalskii 62e07a9
Update README.md
vakovalskii ccb0df7
Update README.md
vakovalskii 12edc02
Update README.md
vakovalskii 68cb663
Update README.md
vakovalskii d706f75
style: Fix markdown formatting with mdformat
vakovalskii 961350f
style: Auto-format frontend code
vakovalskii c4fa312
fix: Trigger finishStreaming on tool_calls finish_reason
vakovalskii a2f954e
fix: Trigger finishStreaming on tool_calls finish_reason
vakovalskii ad7f7ff
Update sgr_tools_agent.py
vakovalskii f24ff04
fix: resolve linter errors in sgr_tools_agent
vakovalskii 3d2fd56
fix: ts errors
645fbaf
feat(frontend): update agents filter and set sgr_tool_calling_agent a…
vakovalskii 5c7a346
Merge branch 'main' into feature/frontend-integration
vakovalskii 5fea97d
1
virrius d0b91ce
Improve chat streaming and tool call handling
virrius 40b0313
lint fix
virrius 434523b
build fixes
virrius 5126292
interface testing updates
virrius f691723
Conflicts solved
EvilFreelancer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ downloads/ | |
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| !sgr-deep-research-frontend/src/shared/lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| # Example Custom Agents Configuration | ||
| # ===================================== | ||
| # This file demonstrates how to define custom agents for SGR Deep Research | ||
|
|
||
| # Notes: | ||
| # ------ | ||
| # 1. Agent names must be unique or will be overridden | ||
| # 2. All tools must be registered in the tool registry | ||
| # 3. LLM, Search, Prompts, Execution, MCP settings are optional and inherit from global config | ||
| # 4. Agents override global settings by providing their own values | ||
|
|
||
| agents: | ||
| # Example 1: Simple custom research agent with overrides | ||
| custom_research_agent: | ||
| base_class: "sgr_deep_research.core.SGRAgent" | ||
| # Optional: Override LLM settings for this agent | ||
| openai: | ||
| model: "gpt-4o" | ||
| temperature: 0.3 | ||
| max_tokens: 16000 | ||
| # api_key: "your-custom-api-key" # Optional: use different API key | ||
| # base_url: "https://api.openai.com/v1" # Optional: use different endpoint | ||
| # proxy: "http://127.0.0.1:8080" # Optional: use proxy | ||
|
|
||
| # Optional: Override search settings | ||
| search: | ||
| max_results: 15 | ||
| max_pages: 8 | ||
| content_limit: 2000 | ||
|
|
||
| # Optional: Execution configuration | ||
| execution: | ||
| max_steps: 8 | ||
| max_iterations: 15 | ||
| max_clarifications: 5 | ||
| max_searches: 6 | ||
| mcp_context_limit: 20000 | ||
| logs_dir: "logs/custom_agent" | ||
| reports_dir: "reports/custom_agent" | ||
|
|
||
| # Optional: MCP configuration | ||
| mcp: | ||
| mcpServers: | ||
| deepwiki: | ||
| url: "https://mcp.deepwiki.com/mcp" | ||
|
|
||
| # Tools this agent can use (must be registered in tool registry) | ||
| tools: | ||
| - "WebSearchTool" | ||
| - "ExtractPageContentTool" | ||
| - "CreateReportTool" | ||
| - "ClarificationTool" | ||
| - "GeneratePlanTool" | ||
| - "AdaptPlanTool" | ||
| - "FinalAnswerTool" | ||
|
|
||
| # Example 2: Minimal agent with defaults | ||
| simple_agent: | ||
| base_class: "SGRToolCallingResearchAgent" | ||
|
|
||
| # Only override what's needed | ||
| llm: | ||
| model: "gpt-4o-mini" | ||
|
|
||
| tools: | ||
| - "WebSearchTool" | ||
| - "FinalAnswerTool" | ||
|
|
||
| # Example 3: Fast research agent optimized for speed | ||
| fast_research_agent: | ||
| base_class: "SGRToolCallingAgent" | ||
|
|
||
| llm: | ||
| model: "gpt-4o-mini" | ||
| temperature: 0.1 | ||
| max_tokens: 4000 | ||
|
|
||
| execution: | ||
| max_steps: 4 | ||
| max_iterations: 8 | ||
| max_clarifications: 2 | ||
| max_searches: 3 | ||
|
|
||
| tools: | ||
| - "WebSearchTool" | ||
| - "CreateReportTool" | ||
| - "FinalAnswerTool" | ||
| - "ReasoningTool" | ||
|
|
||
| # Example 4: Specialized technical analyst with custom prompts | ||
| technical_analyst: | ||
| base_class: "SGRAgent" | ||
|
|
||
| llm: | ||
| model: "gpt-4o" | ||
| temperature: 0.2 | ||
|
|
||
| prompts: | ||
| system_prompt: "You are a highly specialized technical analyst." | ||
|
|
||
| execution: | ||
| max_steps: 10 | ||
| max_iterations: 20 | ||
| max_clarifications: 3 | ||
| max_searches: 8 | ||
|
|
||
| tools: | ||
| - "WebSearchTool" | ||
| - "ExtractPageContentTool" | ||
| - "CreateReportTool" | ||
| - "ClarificationTool" | ||
| - "FinalAnswerTool" | ||
|
|
||
| # Example 5: Agent using inline prompts instead of files | ||
| inline_prompt_agent: | ||
| base_class: "SGRResearchAgent" | ||
|
|
||
| prompts: | ||
| system_prompt_str: | | ||
| You are a helpful research assistant. | ||
| Your goal is to provide accurate and concise information. | ||
| initial_user_request_str: | | ||
| User request: {user_request} | ||
| Please analyze and respond. | ||
| clarification_response_str: | | ||
| I need clarification on: {clarification_needed} | ||
|
|
||
| tools: | ||
| - "WebSearchTool" | ||
| - "FinalAnswerTool" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # SGR Deep Research - Docker Deployment | ||
|
|
||
| Запуск полного стека (backend + frontend) через Docker Compose. | ||
|
|
||
| ## Быстрый старт | ||
|
|
||
| 1. **Скопируйте `.env.example` в `.env`:** | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| ``` | ||
|
|
||
| 2. **Отредактируйте `.env` при необходимости** (опционально) | ||
|
|
||
| 3. **Запустите все сервисы:** | ||
|
|
||
| ```bash | ||
| docker-compose up -d --build | ||
| ``` | ||
|
|
||
| 4. **Откройте в браузере:** | ||
|
|
||
| - Frontend: http://localhost:5174 | ||
| - Backend API: http://localhost:8010 | ||
| - API Docs: http://localhost:8010/docs | ||
|
|
||
| ## Управление | ||
|
|
||
| ### Запуск | ||
|
|
||
| ```bash | ||
| # Запуск всех сервисов | ||
| docker-compose up -d | ||
|
|
||
| # Запуск с пересборкой | ||
| docker-compose up -d --build | ||
|
|
||
| # Запуск только backend | ||
| docker-compose up -d sgr-backend | ||
|
|
||
| # Запуск только frontend | ||
| docker-compose up -d sgr-frontend | ||
| ``` | ||
|
|
||
| ### Остановка | ||
|
|
||
| ```bash | ||
| # Остановить все сервисы | ||
| docker-compose down | ||
|
|
||
| # Остановить и удалить volumes | ||
| docker-compose down -v | ||
| ``` | ||
|
|
||
| ### Логи | ||
|
|
||
| ```bash | ||
| # Все логи | ||
| docker-compose logs -f | ||
|
|
||
| # Логи backend | ||
| docker-compose logs -f sgr-backend | ||
|
|
||
| # Логи frontend | ||
| docker-compose logs -f sgr-frontend | ||
| ``` | ||
|
|
||
| ### Перезапуск | ||
|
|
||
| ```bash | ||
| # Перезапустить все | ||
| docker-compose restart | ||
|
|
||
| # Перезапустить только backend | ||
| docker-compose restart sgr-backend | ||
| ``` | ||
|
|
||
| ## Конфигурация | ||
|
|
||
| ### Переменные окружения (.env) | ||
|
|
||
| ```bash | ||
| # Backend | ||
| BACKEND_PORT=8010 # Порт для backend API | ||
|
|
||
| # Frontend | ||
| FRONTEND_PORT=5174 # Порт для frontend | ||
| VITE_API_BASE_URL=http://localhost:8010 # URL backend API | ||
| VITE_APP_ENV=production # Окружение (production/development) | ||
|
|
||
| # Transcription API (опционально) | ||
| VITE_TRANSCRIPTION_API_URL=https://speechcoreai.com/api | ||
| VITE_TRANSCRIPTION_API_TOKEN=your_token_here | ||
| ``` | ||
|
|
||
| ### Структура сервисов | ||
|
|
||
| - **sgr-backend**: FastAPI backend на порту 8010 | ||
|
|
||
| - Healthcheck: проверяет `/health` каждые 30 секунд | ||
| - Volumes: код, конфиги, логи, отчеты | ||
|
|
||
| - **sgr-frontend**: Nginx + Vue.js frontend на порту 5174 | ||
|
|
||
| - Зависит от backend (запускается после healthcheck) | ||
| - Статические файлы собираются при сборке образа | ||
|
|
||
| ### Сеть | ||
|
|
||
| Оба сервиса находятся в одной Docker сети `sgr-network`, что позволяет им взаимодействовать по именам контейнеров. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Frontend не может подключиться к backend | ||
|
|
||
| Проверьте, что `VITE_API_BASE_URL` в `.env` указывает на правильный URL backend. | ||
|
|
||
| ### Backend не стартует | ||
|
|
||
| Проверьте логи: | ||
|
|
||
| ```bash | ||
| docker-compose logs sgr-backend | ||
| ``` | ||
|
|
||
| Убедитесь, что `config.yaml` и `logging_config.yaml` существуют в корне проекта. | ||
|
|
||
| ### Порты заняты | ||
|
|
||
| Измените порты в `.env`: | ||
|
|
||
| ```bash | ||
| BACKEND_PORT=8011 | ||
| FRONTEND_PORT=5175 | ||
| ``` | ||
|
|
||
| Затем перезапустите: | ||
|
|
||
| ```bash | ||
| docker-compose down | ||
| docker-compose up -d | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,47 @@ | ||
| services: | ||
| sgr: | ||
| sgr-backend: | ||
| build: | ||
| context: ./api_service | ||
| dockerfile: Dockerfile | ||
| container_name: sgr-deep-research | ||
| container_name: sgr-deep-research-backend | ||
| restart: unless-stopped | ||
|
|
||
| ports: | ||
| - "8010:8010" | ||
| - "${BACKEND_PORT:-8010}:8010" | ||
| volumes: | ||
| - ../sgr_deep_research:/app/sgr_deep_research:ro | ||
| - ../config.yaml:/app/config.yaml:ro | ||
| - ../agents.yaml:/app/agents.yaml:ro | ||
| - ../logging_config.yaml:/app/logging_config.yaml:ro | ||
| - ./logs:/app/logs | ||
| - ./reports:/app/reports | ||
|
|
||
| - ./logs:/app/logs | ||
| - ./reports:/app/reports | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8010/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 40s | ||
| networks: | ||
| - sgr-network | ||
|
|
||
| sgr-frontend: | ||
| build: | ||
| context: ../sgr-deep-research-frontend | ||
| dockerfile: Dockerfile | ||
| args: | ||
| - VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://localhost:8010} | ||
| - VITE_APP_ENV=${VITE_APP_ENV:-production} | ||
| - VITE_TRANSCRIPTION_API_URL=${VITE_TRANSCRIPTION_API_URL:-https://speechcoreai.com/api} | ||
| - VITE_TRANSCRIPTION_API_TOKEN=${VITE_TRANSCRIPTION_API_TOKEN:-} | ||
| container_name: sgr-deep-research-frontend | ||
| restart: unless-stopped | ||
| ports: | ||
| - "${FRONTEND_PORT:-5173}:80" | ||
| depends_on: | ||
| sgr-backend: | ||
| condition: service_healthy | ||
| networks: | ||
| - sgr-network | ||
|
|
||
| networks: | ||
| sgr-network: | ||
| driver: bridge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # dependencies | ||
| /node_modules | ||
| .idea* | ||
|
|
||
| # production | ||
| /dist | ||
|
|
||
| *.tar | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
| .vscode | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.