Skip to content

feat(examples): refresh Semantic Kernel example and GenAI event typing#306

Draft
sanjeed5 wants to merge 8 commits intofederated-sdk-release-candidatefrom
feat/update-integration-examples
Draft

feat(examples): refresh Semantic Kernel example and GenAI event typing#306
sanjeed5 wants to merge 8 commits intofederated-sdk-release-candidatefrom
feat/update-integration-examples

Conversation

@sanjeed5
Copy link
Contributor

@sanjeed5 sanjeed5 commented Mar 6, 2026

Summary

  • rewrite the Semantic Kernel integration example and fold in the follow-up review fixes
  • update the integration-example skill guidance with lessons from the Semantic Kernel work
  • improve SDK event typing by honoring gen_ai.operation.name for GenAI-native spans

Test plan

  • Run the Strands example against the local server
  • Verify resulting Strands session events after the paired ingestion changes
  • Run branch-wide example validation if needed for the Semantic Kernel example changes

sanjeed5 and others added 5 commits March 5, 2026 18:10
…port domain

Rewrites the Semantic Kernel example to match the style of other
integration examples (ADK, PydanticAI). Uses the shared customer
support domain with order/policy mock tools and demonstrates:

- Single agent with tools and multi-turn session continuity (AgentThread)
- Multi-agent handoff orchestration (triage -> order/policy specialists)
- Streaming agent response via invoke()

Replaces the old test-style structure with clean scenario functions,
updates from gpt-3.5-turbo to gpt-4o-mini, and enables SK native OTel
diagnostics alongside the OpenInference OpenAI instrumentor.
- Switch from agent.invoke() to agent.invoke_stream() for actual
  token-level streaming in scenario 3
- Add thread.delete() cleanup to streaming scenario for consistency
  with scenario 1
…antic kernel run

Fix broken session dump code (api_key, project, resp.events), correct
testing UI URL, add Context7 MCP and import-path debugging tips, add
make generate to pre-PR step, note dual-instrumentation pattern.
Document that Semantic Kernel native OTel is supported by HoneyHive ingestion and keep OpenInference layering optional to avoid conflicting spans. Add a concise note to store deeper framework context in references/.
Prefer `gen_ai.operation.name` when classifying spans so GenAI-native
instrumentors can report model, chain, and tool events more accurately.
@claude
Copy link
Contributor

claude bot commented Mar 6, 2026

Claude finished @sanjeed5's task in 1m 17s —— View job


PR Review Complete

  • Gather context and read changed files
  • Review span_processor.py changes (SDK code - critical)
  • Review semantic_kernel_integration.py changes (example)
  • Review SKILL.md changes (documentation)
  • Post review feedback

Summary: No blocking issues. The example rewrite is a big improvement (620→236 lines), the gen_ai.operation.name mapping in the span processor is well-placed and backwards-compatible, and the SKILL.md updates capture useful learnings. Left 4 inline comments with minor suggestions (hoist constant dict, add debug log for unknown op names, cleanup ordering in example).

@snyk-io
Copy link

snyk-io bot commented Mar 6, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@claude
Copy link
Contributor

claude bot commented Mar 6, 2026

Overall Review

Good changes overall. The example rewrite is a massive improvement — going from 620 lines of verbose test scaffolding to 236 focused lines covering three meaningful Semantic Kernel patterns (single agent + tools, handoff orchestration, streaming). The customer support domain is coherent and the code reads cleanly.

span_processor.py — GenAI operation mapping (the SDK-critical change):
The new Priority 4 block for gen_ai.operation.name is well-placed in the priority chain and the mapping is sensible. Two minor observations left as inline comments: (1) the mapping dict is re-created per call — consider hoisting to module level, and (2) an else debug log for unknown operation names would aid troubleshooting, matching the pattern already used in the OpenInference fallback.

No backwards-compatibility concerns — this is purely additive, inserting a new priority level before the existing OpenInference check. Existing behavior is preserved for spans without gen_ai.operation.name.

SKILL.md updates are practical — Context7 MCP tip, API gotchas, import path debugging guidance, and URL corrections all look like hard-won lessons from the Semantic Kernel work. Good to codify these.

No blocking issues found. See inline comments for minor suggestions.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

📚 Documentation preview built — Download artifact

Review instructions & validation status

How to Review

  1. Download the artifact from the link above
  2. Extract the files
  3. Open index.html in your browser

Validation Status

  • API validation: ✅ Passed
  • Build process: ✅ Successful
  • Import tests: ✅ All imports working

Enable Semantic Kernel diagnostics before import and layer OpenAIInstrumentor
so the example keeps agent/orchestration spans while capturing rich model
inputs and outputs in HoneyHive.
Hoist the GenAI operation mapping to a module-level constant, log unknown
operation names before falling through, sync the Strands example with the
required generated formatting, and document the tracing fix in the changelog
so the PR's generated-code and changelog checks pass.
Clarify in the Semantic Kernel example docstring that OpenAIInstrumentor is
used because the example uses OpenAIChatCompletion, and that other providers
should use their matching OpenInference instrumentor when available.
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.

1 participant