Skip to content

Conversation

@tgillam-do
Copy link
Collaborator

@tgillam-do tgillam-do commented Jan 8, 2026

Adds span functions for capturing spans manually without using the decorators. Provides a more robust approach to capturing spans.

Adds to README.md and adds integrations tests that ensures agents can respond and run appropriately when using these new functions.

@tgillam-do tgillam-do requested a review from Copilot January 8, 2026 15:00
Copy link

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 programmatic span functions (add_llm_span, add_tool_span, add_agent_span) to provide manual span creation capabilities as an alternative to the existing decorators.

Key Changes:

  • New programmatic span functions for creating LLM, tool, and agent spans without decorators
  • Support for comprehensive metadata including token counts, temperature, duration, and custom fields
  • Integration with existing DigitalOcean tracker to serialize new span types

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gradient_adk/tracing.py Implements three new programmatic span functions with detailed metadata support
gradient_adk/init.py Exports new span functions in public API
gradient_adk/runtime/digitalocean_tracker.py Adds serialization logic for agent and tool span types created programmatically
tests/tracing_test.py Comprehensive unit tests covering all span functions and edge cases
integration_tests/programmatic_spans/test_programmatic_spans.py Integration tests verifying end-to-end functionality with test agent
integration_tests/example_agents/programmatic_spans_agent/main.py Example agent demonstrating usage of all three span functions
README.md Updated documentation with examples and comparison of decorators vs programmatic functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tgillam-do tgillam-do merged commit 3f1a379 into main Jan 8, 2026
5 checks passed
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.

3 participants