Add camel ask command and shared LlmClient with Anthropic/Vertex AI support#29
Closed
gnodet wants to merge 1 commit into
Closed
Add camel ask command and shared LlmClient with Anthropic/Vertex AI support#29gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
…upport - Extract shared LlmClient from Explain supporting Ollama, OpenAI, and Anthropic (including Vertex AI) APIs with auto-detection from env vars - Add camel ask command for AI-powered runtime inspection with tool calling (13 read-only tools: routes, health, endpoints, traces, etc.) - Support interactive chat mode (camel ask without args) with JLine LineReader maintaining conversation context across turns - Refactor Explain to delegate LLM interaction to LlmClient Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LlmClientfromExplainsupporting Ollama, OpenAI, and Anthropic (including Vertex AI) APIs with auto-detection from env varscamel askcommand for AI-powered runtime inspection with tool calling (13 read-only tools: routes, health, endpoints, traces, etc.)camel askwithout args) with JLineLineReadermaintaining conversation context across turnsExplainto delegate LLM interaction toLlmClientLlmClient
Shared LLM HTTP client with three API types (
ollama,openai,anthropic) and auto-detection:ANTHROPIC_API_KEYset → Anthropic direct APICLOUD_ML_REGION+ANTHROPIC_VERTEX_PROJECT_IDset → Vertex AIOPENAI_API_KEYset → OpenAIcamel infraor localhost:11434Supports both simple generation (for
explain) and tool-calling agent loop (forask).Ask command
Agent loop: sends user question to LLM with tool definitions → LLM calls tools → results fed back → repeat until text answer.
Tools (read-only):
get_context,get_routes,get_health,get_endpoints,get_inflight,get_blocked,get_consumers,get_properties,get_route_source,get_route_dump,get_route_structure,get_top_processors,trace_controlTwo modes:
camel ask "what routes are running?"camel ask(entersask>prompt with conversation context)Test plan
camel explain hello.yamlstill works with Ollamacamel explain hello.yaml --api-type=anthropicworks with Vertex AIcamel ask "what routes are running?" --show-toolsinspects a running appcamel askenters interactive chat modeDepends on apache#23346
Claude Code on behalf of Guillaume Nodet