Commit graph

89 commits

Author SHA1 Message Date
4ece2e3bf3 feat(config): refactor AI config into separate LLM and embedding configs
- Split AIConfig into separate LLMConfig and embedding config structs
- Update create_site.rs to use config.llm instead of config.ai
- Improve config loading comments in bootstrap manager
- Add new LLM-related environment variables with defaults
- Maintain backward compatibility with existing config loading
- Clean up unused AIConfig struct and related code

The change better organizes the AI-related configuration by separating LLM and embedding configurations, making the code more maintainable and flexible for future AI service integrations.
2025-11-01 08:43:14 -03:00
1c80c026d2 feat: refactor database connection handling and add LLM component
- Replace direct database connection establishment with shared `establish_pg_connection` utility
- Add "llm" to required components list in bootstrap manager
- Lower default RUST_LOG level from debug to info in VSCode config
- Clean up imports and connection error messages
- Remove hardcoded database URL strings in favor of centralized connection handling

The changes improve code maintainability by centralizing database connection logic and adding support for the new LLM component in the bootstrap process.
2025-11-01 07:20:04 -03:00
122e455909 feat(bootstrap): upload default config and improve S3 setup
Add logic to automatically upload an initial `config.csv` to the default S3 bucket during bootstrap. Enhance S3 operator creation by ensuring endpoint formatting, setting default bucket and region, and enabling path style. Improve template upload flow by validating bucket existence and creating it if missing. Also include debug logging for better traceability.
2025-10-29 14:16:11 -03:00
7b4e7bc800 refactor(config): remove unused S3 bucket configuration and setup logic
Eliminates the `s3_bucket` field from `AppConfig` and deletes related initialization code in `main.rs`. This simplifies configuration management since S3 bucket handling is no longer required or used in the application.
2025-10-29 09:54:39 -03:00
ff770e593f Refactor dependencies in Cargo.toml and update start.bas dialog
- Removed unused Tauri dependencies and replaced aws-sdk-s3 with opendal for S3 services.
- Cleaned up feature flags in Cargo.toml.
- Simplified the welcome message logic in start.bas and removed redundant comments.
2025-10-28 12:07:14 -03:00
48eec70e74 Add AWS SDK integration and update bot configuration management
- Introduced AWS SDK dependencies for S3 and CSV handling.
- Implemented logic to check and update the default bot configuration in S3 after component installation.
- Added a new configuration CSV template for bot settings.
- Refactored package manager to register cache component with updated download URL and binary name.
- Updated README and Cargo files to reflect new dependencies and configuration options.
2025-10-26 14:15:43 -03:00
b96396c4bb - More automation from start to web, user sessions. 2025-10-20 23:32:49 -03:00
436bff1e76 Add indicatif for progress bars and enhance bootstrap
----------------------------------------------------------------
2025-10-19 19:28:08 -03:00
8237d9304b - Refactor in bot package. 2025-10-18 12:01:39 -03:00
ee5184fefb Remove sqlite support and switch auth to POST 2025-10-16 16:49:23 -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
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
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
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
b8ab16b839 - Database schema added. 2025-10-14 16:34:34 -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
3d0e8df36e - New features for start.bas 2025-10-13 17:43:03 -03:00
a1dd7b5826 - Remove all compilation errors. 2025-10-11 12:29:03 -03:00
c88a240903 Migration to Rust removal of Azure. 2025-10-06 10:29:14 -03:00
1b61951def - LocalLLM Embedded. 2025-09-10 11:11:32 -03:00
28c3c3b57b Update templates/edu.gbai/edu.gbdialog/enrollment.bas 2025-08-10 20:59:06 +00:00
d61fb27648 fix: update Puppeteer launch options to use environment variables for headless mode and enhance enrollment confirmation messages 2025-06-27 12:46:15 -03:00
7c998d77f8 fix(KBService): standardize formatting and improve code readability 2025-05-22 20:32:30 -03:00
105aa5ab8f feat(KeywordsExpressions): add support for posting to Instagram with parameters
refactor(GBAdminService): improve folder name extraction logic
refactor(ImageProcessingServices): clean up whitespace and enhance image generation options
refactor(SystemKeywords): simplify rewrite prompt and logging
fix(ChatServices): correct spacing in model invocation
delete(marketing.gbai): remove outdated marketing poster template
add(marketing.gbai): create new marketing poster template with Instagram posting functionality
2025-05-09 21:19:14 -03:00
591e243892 chore: remove unused image assets and update API URL in configuration 2025-04-25 01:46:35 -03:00
c872766664 fix(GBMinService): comment out file writing to prevent overwriting bot manifest 2025-04-17 16:21:02 -03:00
2a4710b902 fix: update URLs and email addresses to reflect new domain 2025-04-15 12:49:05 -03:00
766f829704 fix(llm.gblib): Vector store fixed in /publish. 2024-11-08 11:49:12 -03:00
b287e88779 new(llm.gblib): Added Claude. 2024-11-08 06:49:30 -03:00
5dce8c9423 fix(all): LLM templates on production. 2024-10-30 15:35:11 -03:00
5acbc7a5b9 new(core.gbapp): Timestamp fields are now default. 2024-10-15 15:05:43 -03:00
d9a88bdb0c new(basic.gblib): SEND FILE pdf as temporary images ViewOnce. 2024-10-12 16:28:33 -03:00
d161a23005 new(basic.gblib): HEAR AS QRCODE. 2024-10-02 10:12:03 -03:00
19e923d994 fix(all): Templates OK. 2024-09-29 20:23:13 -03:00
55b0c1e7bb fix(core.gbapp): Themes missing in PROD. 2024-09-26 12:36:08 -03:00
35b90dc269 fix(all): Templates OK. 2024-09-25 17:30:32 -03:00
5f01d95b75 Merge branch 'main' of https://github.com/GeneralBots/BotServer 2024-09-25 17:01:56 -03:00
110c191ede fix(all): LLM tools OK. 2024-09-25 16:54:52 -03:00
417c89b515 Update README.md 2024-09-24 21:09:11 -03:00
28b7831f96 Update README.md 2024-09-24 21:01:49 -03:00
bf93c9ec15 new(all): Node.js v22 and ts-node. 2024-09-24 20:32:38 -03:00
08d81c18d3 new(all): Node.js v22 and ts-node. 2024-09-24 17:03:37 -03:00