Skip to content

Add camel ask command and shared LlmClient with Anthropic/Vertex AI support#29

Closed
gnodet wants to merge 1 commit into
runtime-mcp-serverfrom
camel-ask-command
Closed

Add camel ask command and shared LlmClient with Anthropic/Vertex AI support#29
gnodet wants to merge 1 commit into
runtime-mcp-serverfrom
camel-ask-command

Conversation

@gnodet
Copy link
Copy Markdown
Owner

@gnodet gnodet commented May 22, 2026

Summary

  • 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

LlmClient

Shared LLM HTTP client with three API types (ollama, openai, anthropic) and auto-detection:

  1. ANTHROPIC_API_KEY set → Anthropic direct API
  2. CLOUD_ML_REGION + ANTHROPIC_VERTEX_PROJECT_ID set → Vertex AI
  3. OPENAI_API_KEY set → OpenAI
  4. Ollama via camel infra or localhost:11434

Supports both simple generation (for explain) and tool-calling agent loop (for ask).

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_control

Two modes:

  • One-shot: camel ask "what routes are running?"
  • Interactive chat: camel ask (enters ask> prompt with conversation context)

Test plan

  • camel explain hello.yaml still works with Ollama
  • camel explain hello.yaml --api-type=anthropic works with Vertex AI
  • camel ask "what routes are running?" --show-tools inspects a running app
  • camel ask enters interactive chat mode
  • CI passes

Depends on apache#23346

Claude Code on behalf of Guillaume Nodet

…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>
@gnodet gnodet closed this May 22, 2026
@gnodet gnodet deleted the camel-ask-command branch May 22, 2026 05:13
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