Skip to content
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

feat(code-template): Add Code Template System and Tool Calling Infrastructure #302

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

thecodacus
Copy link

@thecodacus thecodacus commented Nov 16, 2024

Add Code Template System and Tool Calling Infrastructure

Overview

This PR introduces two major architectural enhancements:

  1. A code template system for project scaffolding
  2. A foundational infrastructure for AI tool calling with an agent-based architecture

These changes enable more sophisticated project initialization and lay the groundwork for AI-driven tooling capabilities.

Key Changes

1. Template System Implementation

  • Added project template import functionality
  • Implemented GitHub-based template fetching
  • Added template configuration and management
  • Introduced template ignore patterns for selective imports
  • Added support for template-specific prompts

2. Tool Calling Infrastructure

  • Implemented base agent architecture for tool execution
  • Added tool calling parser and execution pipeline
  • Integrated tool configuration management
  • Added support for agent-based routing and coordination
  • Implemented template variables system for dynamic prompting

3. Agent System

  • Added AgentPromptGenerator for structured prompt generation
  • Implemented AgentOutputParser for processing tool calls
  • Added coordinator agent for query routing
  • Implemented project scaffolding agent
  • Added support for agent registration and management

4. UI Enhancements

  • Added tool configuration toggle in chat interface
  • Implemented tool execution status display
  • Added template selection interface
  • Enhanced message parsing for tool responses
  • Added support for tool calling visualization

Technical Implementation

Agent Architecture

  • Base agent class with configurable tools and parameters
  • XML-based tool call protocol for structured communication
  • Support for template variables and dynamic prompt generation
  • Coordinator agent for intelligent query routing

Template System

  • GitHub API integration for template fetching
  • Support for .bolt configuration directory
  • Template ignore patterns for selective imports
  • Custom prompt support for templates

Tool Execution Pipeline

  1. Tool call parsing and validation
  2. Agent selection and routing
  3. Parameter validation
  4. Tool execution
  5. Response formatting and streaming

Testing

  • Tested template import functionality
  • Verified tool calling pipeline
  • Tested agent routing system
  • Verified template ignore patterns
  • Tested tool configuration persistence

Migration Impact

  • No breaking changes for existing chat functionality
  • Tool calling requires explicit opt-in via toggle
  • Template system is additive to existing functionality
  • Existing message parsing remains unchanged

Future Enhancements

  • Add support for more complex tool chains
  • Enhance template management system
  • Add more specialized agents
  • Improve tool execution visualization
  • Add support for concurrent tool execution

Preview

Code.Template.Demo.mp4

@thecodacus thecodacus changed the title Artifact based tool calling feat(code-template): Add Code Template System and Tool Calling Infrastructure Nov 16, 2024
@thecodacus thecodacus marked this pull request as ready for review November 16, 2024 06:46
@thecodacus
Copy link
Author

@wonderwhy-er , sorry but I tried to make the changes as little as possible 😅

@thecodacus
Copy link
Author

Also this approach is text based, to it can be used by any llm, as long as it follows the structured output and does not get confused. that require prompt tuning which can be done in separate task

we can now add agents for github project import or commit, using this framework

@wonderwhy-er
Copy link
Collaborator

Ok, will need to take a deeper look in to how it works

@thecodacus
Copy link
Author

this is an example of git import using the tooling framework

Git.Import.using.Tool.Architecture.mp4

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.

2 participants