Skip to content

Conversation

TomeHirata
Copy link
Collaborator

@TomeHirata TomeHirata commented Sep 8, 2025

Move stanfordnlp/dspy#8721 so that Databricks users can use Anthropic citation easily.

@TomeHirata TomeHirata requested a review from Copilot September 8, 2025 04:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DatabricksDocument and DatabricksCitations types for handling document sources and extracted citations
  • Adds streaming support with DatabricksStreamListener to 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.

Copy link
Collaborator

@chenmoneygithub chenmoneygithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have merged the one in DSPy, I think we can close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants