atiaomar1978-hub commented on PR #25337: URL: https://github.com/apache/camel/pull/25337#issuecomment-5207154429
_AI-generated comment on behalf of atiaomar1978-hub._ Addressed the latest round of review feedback from @davsclaus in commit `8e424d403b8`: 1. **Uncached reflection** — `GenAiObservability.start()` now caches the resolved `Method` per `CamelContext` via `ConcurrentHashMap`. `GenAiObservabilityImpl.resolveMetricsBackend()` similarly caches the Micrometer backend per context instead of creating a new instance on every LLM call. 2. **Silent exception swallowing** — Added `DEBUG` logging in both the API bridge and impl metrics-backend resolution when reflective setup fails. 3. **Google AI system name inconsistency** — `dev.langchain4j.model.google` package fallback now returns `"google"` (matching `GOOGLE_AI_GEMINI` / `GOOGLE_GENAI` provider mapping), while `dev.langchain4j.model.vertexai` continues to return `"gcp.vertex_ai"`. Added package-name tests. 4. **`long` → `int` narrowing cast** — OpenAI producer now uses `Math.toIntExact()` via a `toTokenCount()` helper for prompt/completion tokens passed to `GenAiUsage`. **Tests:** All observability-related tests pass (GenAiObservabilityTest, GenAiObservabilitySpanTest, GenAiModelResolverTest, OpenAIObservabilityTest, LangChain4jChat/Tools/Embeddings/Agent observability tests). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
