Commit graph

3424 commits

Author SHA1 Message Date
2ab4d25853 Merge branch 'main' of github.com:GeneralBots/BotServer 2025-10-17 20:35:50 -03:00
bb6ecd457c Refactor: remove custom template and add dev-start 2025-10-17 20:32:25 -03:00
87bebd1fd8 Merge pull request #441 from ChristopherCastilho/main
Add trace logging to AutomationService and increase timeout values in LLM commands
2025-10-17 18:51:29 -03:00
9eb8f8f57f Add scroll-to-bottom button and context usage indicator with styling improvements 2025-10-17 15:12:19 -03:00
2be85773ab Add trace logging to AutomationService and increase timeout values in LLM commands 2025-10-17 13:11:49 -03:00
ee5184fefb Remove sqlite support and switch auth to POST 2025-10-16 16:49:23 -03:00
f916f3469b Merge branch 'main' of github.com:GeneralBots/BotServer 2025-10-16 14:43:24 -03:00
09a9c8f3cd Enhance bot memory and Redis guards
- Derive bot_id from BOT_GUID env var
- Guard concurrent runs with Redis
- Read CACHE_URL for Redis connection
- Extend bot memory keyword to accept comma as separator
- Increase LLM timeouts to 180s (local and legacy)
- Update templates to use bot memory (GET_BOT_MEMORY/SET_BOT_MEMORY)
- Fix start script path to announcements.gbai
2025-10-16 14:22:28 -03:00
5f50e3c410 Update issue templates 2025-10-16 11:45:31 -03:00
acd664245b Migrate automations to param and sqlite
- Rename script_name to param in automation flow and DB schema
- Add BotMemory model and bot_memories table
- Remove script_name field from automation
- Enable sqlite support via rusqlite and related crates (optional)
- Update prompts and queries to use param instead of script_name
- Remove deprecated annoucements GBai templates and align add-req.sh
- Refactor main to initialize automation service and simplify startup
2025-10-16 11:43:02 -03:00
95456e90dd Add dev prompts for keyword, model, and service 2025-10-16 08:04:13 -03:00
f3813951c8 Delete dev prompt files and update shared rules
Add rule to shared.md to output only modified files in a .sh script
Remove obsolete dev prompt markdown files
2025-10-16 08:04:06 -03:00
8c68b9c3dc Remove unnecessary mut from response_channels 2025-10-16 07:56:57 -03:00
7a583b1a64 Refactor TALK keyword to use try_send
Remove unnecessary async spawn in TALK handling and use `try_send` on
the WebSocket channel. Acquire `response_channels` with `try_lock` and
spawn an async task only when falling back to the web adapter. Clean up
debug logs and add missing `env` import. Also delete an extra blank line
in the announcement start script.
2025-10-15 22:39:04 -03:00
4ead626a90 Refactor LLM parsing and overhaul connection UI
- Strip content up to the “final<|message|>” token in OpenAI responses.
- Replace the text‑based connection‑status indicator with a small
  flashing circle.
- Simplify updateConnectionStatus to take only the status argument.
- Remove special handling of the initial assistant message and
  streamline empty‑state removal.
- Clean up stray blank lines in the announcement template.
2025-10-15 22:24:04 -03:00
d584f8dfc3 Refactor async GET and LLM, add connection UI
- Execute GET requests in a dedicated thread with its own Tokio runtime,
  add timeout handling and clearer error messages.
- Tighten `is_safe_path` checks and simplify HTTP/S3 logic.
- Change `llm_keyword` to accept `Arc<AppState>`, add prompt builder,
  run LLM generation in an isolated thread with timeout.
- Update keyword registration call in `basic/mod.rs`.
- Convert template script to use `let` declarations and return a
  boolean.
- Introduce connection‑status indicator in the web UI with styles,
  automatic reconnection attempts, and proper WS/WSS handling for voice.
2025-10-15 21:18:01 -03:00
0ef45eafe3 Remove unused warn logger import 2025-10-15 19:13:40 -03:00
872ff5913f Refactor GET keyword with blocking execution
- Replace async task spawning with `block_in_place` to simplify GET
  handling
- Add detailed safety checks for file paths and organization prefixes
- Introduce timeout and keep‑alive settings for HTTP client
- Improve S3 bucket access with existence check, timeouts, and richer
  logging
- Switch tracing logs to debug and add warning logs where appropriate
- Update announcement template to retrieve a PDF, generate a resume via
  LLM, and set context for subsequent queries.
2025-10-15 13:13:27 -03:00
bb9c733fd5 - GET ketyowrd for buckets. 2025-10-15 12:45:15 -03:00
0774251449 - Fix on the web presentation. 2025-10-15 10:37:04 -03:00
e77362e09a Refactor LLM flow, add prompts, fix UI streaming
- Extract LLM generation into `execute_llm_generation` and simplify
  keyword handling.
- Prepend system prompt and session context to LLM prompts in
  `BotOrchestrator`.
- Parse incoming WebSocket messages as JSON and use the `content` field.
- Add async `get_session_context` and stop injecting Redis context into
  conversation history.
- Change default LLM URL to `http://48.217.66.81:8080` throughout the
  project.
- Use the existing DB pool instead of creating a separate custom
  connection.
- Update `start.bas` to call LLM and set a new context string.
- Refactor web client message handling: separate event processing,
  improve streaming logic, reset streaming state on thinking end, and
  remove unused test functions.
2025-10-15 01:14:37 -03:00
60ee933769 Add async Redis context storage and session fetch
- Use `tokio::spawn` to run Redis SET for `SET_CONTEXT` in a background
  task with detailed tracing.
- Move context retrieval from `BotOrchestrator` to `SessionManager`,
  inserting it as a system message in conversation history.
- Remove redundant Redis fetch logic from `BotOrchestrator`.
- Update `DEV.md` to install `valkey-cli`, reorder cargo tools, and
  adjust apt commands.
- Add a `SET_CONTEXT "azul bolinha"` example to the announcements
  template.
2025-10-15 00:01:48 -03:00
a88a1613a1 - Fixing ngl param. 2025-10-14 17:02:11 -03:00
9e9db27bca - Fixing parameters for llama.cpp. 2025-10-14 17:00:00 -03:00
3f85f95af4 - Fine tunning GTP OSS 20B. 2025-10-14 16:57:50 -03:00
b8ab16b839 - Database schema added. 2025-10-14 16:34:34 -03:00
16e685f556 Switch debug to BotServer and use cargo run
- Change label from "Build & Debug native binary" to "Debug BotServer"
- Use cargo run instead of cargo build
2025-10-14 15:57:17 -03:00
96a02ee06e Refactor session handling and auth flow 2025-10-14 14:51:49 -03:00
3375bb667a Add botserver prompt, auth template, and CSS 2025-10-14 13:51:54 -03:00
16516b23bb Refactor server code and add auth API fixes 2025-10-14 13:51:27 -03:00
cd33995435 New features for start.bas 2025-10-13 18:11:03 -03:00
3d0e8df36e - New features for start.bas 2025-10-13 17:43:03 -03:00
fe04ea3c85 Update mod.rs 2025-10-13 09:36:45 -03:00
b0e229d2e5 Update prompt build script and shared guidelines 2025-10-13 09:36:06 -03:00
5ae630521c Enhance streaming with events and warning API
- Introduce event-driven streaming with thinking_start, thinking_end,
  and warn events; skip sending analysis content to clients
- Add /api/warn endpoint to dispatch warnings for sessions and channels;
  web UI displays alerts
- Emit session_start/session_end events over WebSocket and instrument
  logging throughout orchestration
- Update web client: show thinking indicator and warning banners; switch
  LiveKit client URL to CDN
- Extend BotOrchestrator with send_event and send_warning, expand
  session/tool workflow
- Improve REST endpoints for sessions/history with better logging and
  error handling
- Update docs and prompts: DEV.md usage note; adjust dev build_prompt
  script
2025-10-13 00:31:08 -03:00
595fe98eff - Mew LLM provider. 2025-10-12 20:54:42 -03:00
9efeffd80a Refactor to Arc<AppState> for shared state
- Migrate core services to store Arc<AppState> and use locks
- Centralize state in AppState with Arc-wrapped managers
- Update handlers to pass Arc<AppState> via web::Data
- Add Default for AppState and initialize components in main
- Update debug.json program path from gbserver to botserver
2025-10-12 20:12:49 -03:00
7722c66d4c Migrate to web/index.html and OpenAI client
- Load index.html from web/index.html instead of templates/static
- Initialize OpenAIClient with an empty key and local endpoint
- Remove the old static/index.html file
2025-10-12 17:41:41 -03:00
27ca5ca543 - Answering in Web using streaming. 2025-10-12 15:06:16 -03:00
9609aa4e70 Switch message_type to integer across codebase 2025-10-12 14:39:23 -03:00
d28a63f2dc Make AuthService thread-safe and auto-create user 2025-10-12 13:38:56 -03:00
42dabc6982 - Set mode is now a number. 2025-10-12 13:27:48 -03:00
d3875d3c50 - Compiling again. 2025-10-12 11:44:35 -03:00
b9bc01098a - 0 errors. 2025-10-11 20:41:52 -03:00
83ead0db31 - Only 18 errors missing being fixed. 2025-10-11 20:25:08 -03:00
a16d9affe7 - main.rs is compiling again. 2025-10-11 20:02:14 -03:00
8dd71c4a8e - Fix compilation errors. 2025-10-11 17:26:56 -03:00
a012ca1bd7 - More LLM on compiler. 2025-10-11 13:29:52 -03:00
ba8fc38431 - Fixing compilation errors. 2025-10-11 13:29:38 -03:00
a1dd7b5826 - Remove all compilation errors. 2025-10-11 12:29:03 -03:00