Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds citation support to databricks-dspy by implementing citation-aware types and streaming functionality. The changes enable Databricks users to leverage Anthropic's citation API for tracking source references in generated text.
- Introduces
DatabricksDocumentandDatabricksCitationstypes for handling document sources and extracted citations - Adds streaming support with
DatabricksStreamListenerto process citation data from real-time responses - Provides comprehensive test coverage for document handling, citation processing, and streaming functionality
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/databricks_dspy/__init__.py |
Exports new citation and document types along with streaming listener |
src/databricks_dspy/adapters/__init__.py |
Module initialization for citation and document adapters |
src/databricks_dspy/adapters/types/citation.py |
Core citation type implementation with validation and formatting |
src/databricks_dspy/adapters/types/document.py |
Document type for citation-enabled content sources |
src/databricks_dspy/streaming/__init__.py |
Streaming module initialization |
src/databricks_dspy/streaming/streaming_listener.py |
Stream listener for processing citation chunks |
tests/unit_tests/adapters/types/test_citation.py |
Comprehensive test suite for citation functionality |
tests/unit_tests/adapters/types/test_document.py |
Test suite for document type validation and formatting |
tests/unit_tests/streaming/test_streaming.py |
Integration tests for citation streaming functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
integrations/dspy/src/databricks_dspy/streaming/streaming_listener.py
Outdated
Show resolved
Hide resolved
integrations/dspy/src/databricks_dspy/streaming/streaming_listener.py
Outdated
Show resolved
Hide resolved
integrations/dspy/src/databricks_dspy/adapters/types/document.py
Outdated
Show resolved
Hide resolved
Contributor
chenmoneygithub
left a comment
There was a problem hiding this comment.
Since we have merged the one in DSPy, I think we can close this PR?
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.
Move stanfordnlp/dspy#8721 so that Databricks users can use Anthropic citation easily.