Skip to content

Add huggingface tools and improve execution modes#26

Merged
xprilion merged 1 commit into
mainfrom
dev
Apr 29, 2026
Merged

Add huggingface tools and improve execution modes#26
xprilion merged 1 commit into
mainfrom
dev

Conversation

@xprilion
Copy link
Copy Markdown
Owner

This pull request introduces two major improvements to the backend: (1) it adds first-class Hugging Face provider support (for model/dataset discovery and file reading) to the agent and API, and (2) it refines and enforces agent mode handling, restricting valid modes to "plan" and "execute" throughout the backend and API. The PR also updates the system prompt and tool registry to reflect new tools and mode restrictions, and adds comprehensive tests for the new Hugging Face provider and stricter mode validation.

Hugging Face Provider Integration

  • Added Hugging Face provider support to the backend, including environment variable configuration (HF_TOKEN), provider listing in the API, and support for model/dataset search and file reading tools (hf_search_models, hf_model_info, hf_search_datasets, hf_dataset_info, hf_read_file). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Added tests to ensure Hugging Face provider appears in /api/providers, is correctly categorized, and supports token configuration via settings and config endpoints.

Agent Mode Handling and Validation

  • Restricted valid agent modes to "plan" and "execute" throughout the backend, using Python typing for strict validation and updating all relevant logic to enforce this. [1] [2] [3] [4]
  • Improved mode handling in session and agent loop: session now tracks current_mode, defaults to "plan", and falls back to this value if an invalid or null mode is provided. Explicit mode changes persist across approval continuations. [1] [2]
  • Expanded and updated tests to cover new mode handling logic, including fallback behaviors and validation errors for invalid modes. [1] [2] [3] [4]

System Prompt and Tool Registry Updates

  • Updated the system prompt to clarify available tools in each mode, reflect new Hugging Face tools, and make mode restrictions explicit. [1] [2] [3]
  • Updated the tool registry and research tool subset to include new Hugging Face tools and ensure tool restrictions match the new mode semantics. [1] [2] [3]

These changes collectively improve the agent's ability to interact with external ML resources, enforce strict operational modes, and provide a clearer, safer user experience.

@sonarqubecloud
Copy link
Copy Markdown

@xprilion xprilion merged commit 0f689a8 into main Apr 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant