Skip to content

feat: Implement tool use pattern with multi-framework implementations#5

Merged
lkronecker13 merged 1 commit into
mainfrom
feat/tool-use
Sep 13, 2025
Merged

feat: Implement tool use pattern with multi-framework implementations#5
lkronecker13 merged 1 commit into
mainfrom
feat/tool-use

Conversation

@lkronecker13

Copy link
Copy Markdown
Contributor

Summary

  • Implements the Tool Use agentic design pattern across three frameworks: LangChain, CrewAI, and Google ADK
  • Adds comprehensive command-line interface and Makefile integration for easy execution
  • Features type-safe agent selection using Python Enums

Implementation Details

LangChain Implementation (langchain_tu.py)

  • Creates tool-calling agent with custom search_information tool
  • Implements async agent execution with proper error handling
  • Demonstrates concurrent task processing with multiple queries

CrewAI Implementation (crew_ai_tu.py)

  • Features financial analyst agent with stock price lookup tool
  • Implements robust error handling with proper exception raising
  • Uses crew-based task orchestration for complex workflows

Google ADK Implementation (google_adk_ty.py)

  • Dual Agent Architecture: Search agent with Google Search API + Calculator agent with code execution
  • Type-Safe Design: Uses AgentType enum instead of strings for agent selection
  • CLI Interface: Supports --agent and --query flags for flexible usage
  • Execution Models: Uses run() for search agent and run_async() for calculator agent

New Features

  • Command-line argument parsing with type validation
  • Separate Makefile targets for each framework and agent type
  • Comprehensive error handling and user feedback
  • Default queries that showcase each agent's capabilities

Usage Examples

# LangChain tool use
make run-tool-use-langchain

# CrewAI tool use  
make run-tool-use-crew-ai

# Google ADK search agent
make run-tool-use-google-adk

# Google ADK calculator agent
make run-tool-use-google-adk-calculator

# Custom queries
python src/tool_use/google_adk_ty.py --agent calculator --query "What is 15 factorial?"

Test Plan

  • All implementations run without errors
  • Type checking passes with mypy
  • Code formatting and linting pass
  • Unit tests continue to pass
  • Each agent demonstrates proper tool usage
  • CLI interface handles invalid inputs gracefully
  • Enum-based agent selection prevents typos

🤖 Generated with Claude Code

- Add LangChain tool use with search_information tool and async agent execution
- Add CrewAI tool use with stock price lookup tool and financial analyst agent
- Add Google ADK tool use with dual agents: search and calculator with code execution
- Implement AgentType enum for type-safe agent selection in Google ADK implementation
- Add command-line interface with --agent and --query flags for Google ADK script
- Add Makefile targets for all tool use patterns including separate calculator target
- Add crewai dependency to pyproject.toml

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lkronecker13 lkronecker13 merged commit 9181704 into main Sep 13, 2025
7 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