feat(together): add Braintrust tracing for the Together AI Go SDK - #232
Open
Atharva Mhaske (atharvamhaske) wants to merge 4 commits into
Open
Atharva Mhaske (atharvamhaske) wants to merge 4 commits into
Atharva Mhaske (atharvamhaske) wants to merge 4 commits into
Conversation
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
Atharva Mhaske (atharvamhaske)
marked this pull request as ready for review
September 12, 2026 08:52
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f50e66c1bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
Contributor
Author
|
Abhijeet Prasad (@AbhiPrasad) now CI on this PR will be red until real cassettes are recorded and pushed, as you wanted. PTAL and LMK |
Atharva Mhaske (atharvamhaske)
requested a review
from Abhijeet Prasad (AbhiPrasad)
September 15, 2026 17:34
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
trace/contrib/togethercomputer/togetherintegration for the official Together AI Go SDK (github.com/togethercomputer/together-go), coveringChat.Completions.New/NewStreaming,Completions.New, andEmbeddings.Newoption.WithMiddleware()extension point asopenai-go/anthropic-sdk-go, so this followstrace/contrib/openai's middleware pattern directlychatcompletions.go— tracesChat Completionspans, both streaming and non-streaming; streaming responses accumulate delta content/tool calls into one merged choice, matching the non-streaming shapecompletions.go— tracestogether.completions.createspansembeddings.go— tracestogether.embeddings.createspans; output is a count + dimension summary, not the raw vectorstogether.NewClientby appendingoption.WithMiddleware(...)to its variadic optionsexamples/internal/togetherChanges
trace/contrib/togethercomputer/together/— new module (tracetogether.go,chatcompletions.go,completions.go,embeddings.go,orchestrion.go,orchestrion.yml, tests)examples/internal/together/— new exampleexamples/go.mod,go.work,scripts/nested_modules.txt— registered the new moduletrace/contrib/all/— registered together in the meta-module and regeneratedorchestrion.ymltrace/contrib/orchestrion_test.go— added together to the fixture's local replace-directive map and the "individual" import listtrace/contrib/testdata/orchestrion/— addedTestTogetherinternal/genorchestrion/genorchestrion_test.go— bumped expected aspect count 18 → 19 (1 new:together-newclient-middleware)Notes
together-gov0.10.0; verified against the real upstream repo that current latest isv0.12.0(no import-path break, just a version bump).TestChatCompletion,TestChatCompletionStreaming,TestCompletion,TestEmbeddings, and the orchestrion fixture'sTestTogether) — these currently fail with "requested cassette not found". A partial run against a real (but unfunded) key confirmed the wiring itself is correct: requests reachapi.together.aiwith the right path/shape and the orchestrion-injected middleware fires, they just get rejected with a genuine401 invalid_api_keyrather than any compile/injection error.TOGETHER_API_KEYneeds to runVCR_MODE=record go test ./...intrace/contrib/togethercomputer/togetherandtrace/contrib/testdata/orchestrion(-run TestTogether) before this can merge. Opened as a draft for that reason.make lintandgo build ./...clean locally;go vetclean.Closes #142