Repository navigation
Conversation
Preserve the v1 API and untraced escape hatch. Add closeable streams, privacy-gated metadata, fake-transport and OTLP contracts, and floor/current SDK coverage. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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
Keep the Cohere Java integration and repair its missing SDK surfaces rather than delete a useful package. The existing wrapper traced only synchronous v1 chat/embed/rerank; its
unwrap()escape hatch did not trace v2 or streams, despite the all-API-calls Javadoc.traced.v2()facade for chat, embed, rerank and chat streaming, including SDKRequestOptionsoverloads.unwrap()behavior intact; explicitly document that the escape hatch bypasses tracing.Evidence and compatibility
The upstream 1.9.3 sources and 1.12.0 sources expose these typed v2 and streaming methods. No native OpenTelemetry path was found in those SDK sources; this change does not claim a dedicated competitor Java integration was established.
Cohere 1.12.0's Maven POM references the multiplatform
okhttp:5.2.1artifact. The current-version test profile explicitly suppliesokhttp-jvm:5.2.1. Maven applications selecting that SDK version need the JVM artifact too. The default SDK floor remains 1.9.3.Streams return tool/citation/reasoning events unchanged, but reconstruct text output only. Async clients, raw-response clients and other endpoints remain outside this facade. Both tested SDKs swallow malformed SSE payloads; a resulting EOF is recorded as incomplete, not falsely marked successful.
Verification
CohereSurfaceTestcases failed withNoSuchMethodExceptionforv2()andchatStream(ChatStreamRequest).Re-run from
java/with either1.9.3or1.12.0:mvn -B -pl traceai-java-cohere -am -Dcohere-java.version=1.9.3 \ -Dtest=CohereSurfaceTest,CohereOtlpTest,TracedCohereTransportTest,TracedCohereStreamTest,TracedCohereClientPrivacyTest,FITracerTest,FITracerPrivacyTest,TraceAIVersionTest \ -Dsurefire.failIfNoSpecifiedTests=false clean testRelease and docs
Release this Java package before updating the customer guide to use the new facade. A corrected
src/pages/docs/integrations/traceai/java/cohere.mdxdraft is staged for that follow-up; no docs PR advertises these APIs before registry availability. No merge, tag or package publication is performed by this PR.Self-review
No blocking findings after the compatibility and privacy checks. No Python, migrations or frontend changes: those mechanical gates are not applicable. This repository has no product
e2e/coverage harness; provider transport and OTLP wire contracts cover this SDK change.E2E: exempt (SDK-only synthetic transport and OTLP contracts; no product e2e harness)
Generated with Claude Code