Repository navigation
Conversation
…hunks Compass can now ask Rerank v5 for the passages of each reranked chunk that are relevant to the query, so callers such as agents can read only those passages instead of whole chunks. The SDK mirrors the API: an optional relevant_spans option on both search methods (sync and async), and a relevant_spans list on every scored chunk in the responses. The option is left out of the request body when not given, so existing calls send the same request to any server. The response field defaults to None, so responses from servers that predate it still parse. Bumps the version to 2.29.0, a minor release because this adds public API.
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.
[Section to be filled by Rafid]
[🤖 Rafid's Bot · opencode · claude-opus-5-5] Everything below this line is AI generated.
Linear: CMPS-1476
Compass search can now return Rerank v5 "relevant spans": the passages of each reranked chunk that the rerank model finds relevant to the query (cohere-ai/compass, branch
corafid/feat/rerank-relevant-spans). This exposes that in the SDK, so callers such as the Compass MCP server can show agents only those passages.search_documentsandsearch_chunks(sync and async) takerelevant_spans: RelevantSpansInput | None. It is sent only when given.RetrievedScoredChunkgainsrelevant_spans: list[RelevantSpan] | None. Responses from servers without the feature still parse, withNone.Decision for review:
RelevantSpansInput.modedefaults to"enabled"in the SDK, soRelevantSpansInput()turns the feature on. On the server,modeis required. The SDK always sends it, so the request is valid either way.Requires the Compass change to be deployed. Older servers ignore the field, and a Compass deployment whose rerank model isn't Rerank v5 answers 400 (raised as
CompassClientError).Tests cover the request body on both clients and endpoints, validation of
thresholdandmax_spans, and parsing of spans,[],nulland an omitted field.