Skip to content

Hybim 634 vertexai tool calls#275

Open
shuwpan wants to merge 4 commits intosignalfx:mainfrom
shuwpan:HYBIM-634_vertexai-tool-calls
Open

Hybim 634 vertexai tool calls#275
shuwpan wants to merge 4 commits intosignalfx:mainfrom
shuwpan:HYBIM-634_vertexai-tool-calls

Conversation

@shuwpan
Copy link
Copy Markdown
Contributor

@shuwpan shuwpan commented Apr 15, 2026

Stacked on #271 (HYBIM-623_replace_current_impl_with_LLMInvocation)

  • Map function_call parts to ToolCall and function_response to ToolCallResponse
  • Populate request_functions from tool definitions (always emitted, independent of content capture)
  • Add extract_tool_definitions utility for Vertex AI Tool objects
  • Vertex AI has no TOOL_CALLS finish reason; STOP is kept as-is (matches upstream)
  • Add tests for function call spans, tool events, and gen_ai.request.function.* attributes

https://shw-playground.signalfx.com/#/apm/traces/c93e83b81d7259991bdfd33d3d0ff493?tab=waterfall
https://shw-playground.signalfx.com/#/apm/traces/c625f3403ea53bc0326215d5e1d0f2bf?tab=waterfall

@shuwpan shuwpan requested review from a team as code owners April 15, 2026 23:48
shuwpan added 3 commits April 17, 2026 13:07
…nvocation

- Migrate from raw spans to TelemetryHandler lifecycle (start_llm/stop_llm/fail_llm)
- Build LLMInvocation with text and tool-response message parts
- Remove _StabilityMode branching, events.py, and completion_hook paths
- Remove experimental test files (merged into main test suite)
…lResponse

- Map function_call parts to ToolCall, function_response to ToolCallResponse
- Populate request_functions from tool definitions (always, independent of content capture)
- Add tests for function call spans, tool events, and request function attributes
…itions with env var

- Use invocation.tool_definitions instead of invocation.attributes[GEN_AI_TOOL_DEFINITIONS]
- Gate tool_definitions with should_capture_tool_definitions() (OTEL_INSTRUMENTATION_GENAI_CAPTURE_TOOL_DEFINITIONS)
- Use invocation.output_type instead of invocation.attributes[GEN_AI_OUTPUT_TYPE]
- Set request_choice_count and request_top_k on LLMInvocation
- Extract top_k from Vertex AI GenerationConfig
- Add tests for tool_definitions opt-in behavior
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