Repository navigation
Conversation
Python (fi_instrumentation): - get_tool_attributes takes a keyword-only tool_call_id and sets gen_ai.tool.call.id when it is a non-empty string. - FiSpan.set_tool takes tool_call_id; FiSpan.set_tool_call_id sets the id on a tool span and raises ValueError on any other span kind. - FITracer.tool(tool_call_id_arg=...) names the decorated function's argument that carries the model's tool call id. The id is read after binding (including through **kwargs) and lands in the start attributes of sync, async, generator and async generator tools. A missing, empty or non-string value is skipped. C# (FIInstrumentation): - FISpan.SetTool takes an optional toolCallId and FISpan.SetToolCallId sets it on its own; both skip a null or empty id. The 1.0 SetTool(name, description, parameters) signature stays as a hidden overload so assemblies built against it keep binding. Docs and changelogs describe the new parameters.
This branch has not been deployed
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.
What does this PR do?
fi-instrumentation-otel):get_tool_attributesaccepts a keyword-onlytool_call_idand setsgen_ai.tool.call.idwhen it is a non-empty string.FiSpan.set_toolacceptstool_call_id, andFiSpan.set_tool_call_idsetsgen_ai.tool.call.idon a tool span (raisingValueErroron any other span kind).FITracer.tool(tool_call_id_arg=...)reads the named argument after binding (including through**kwargs) and records it in the start attributes of sync, async, generator, and async generator tool spans; missing, empty, or non-string values are skipped.FIInstrumentation):FISpan.SetToolaccepts an optionaltoolCallId, andFISpan.SetToolCallIdsetsgen_ai.tool.call.iddirectly; both skip null or empty values.SetTool(string name, string? description, object? parameters)signature as a hidden overload so assemblies built against 1.0 keep binary compatibility.Why?
Tool spans carried tool name, description, and parameters without
gen_ai.tool.call.id, leaving no direct attribute link back to the model's tool call entry in Python and C# manual instrumentation.How was it tested?
Python (
python/tests/test_tracers.py): 15 unit tests coveringget_tool_attributes,FiSpan.set_tool,FiSpan.set_tool_call_id(including non-tool spanValueError), and@tracer.tool(tool_call_id_arg=...)across sync, async, generator, async generator,**kwargs, missing, empty, and non-string values.C# (
csharp/tests/FIInstrumentation.Tests/FISpanTests.cs): 6 unit tests coveringSetTool(..., toolCallId: ...),SetToolCallId(...), null/empty skipping, suppressed spans, and 3-argument overload compatibility.Full regression matrices (0 new failures):
fi_instrumentation(5,738tests,+15),core-compatacross 34 Python 3.10–3.15 configs (180,455tests), 81 framework packages (99suites,13,025tests), 24 path-triggered framework workflows, and C#.NETmatrix (FIInstrumentation.Tests510/510,AutoInstrumentation.Tests1,771/1,771,HostingStartup.Tests130/130).Unit tests added / updated (
pytest/dotnet test)Integration tests pass (or N/A — no gateway behavior changed)
Docs and changelogs updated (
python/README.md,python/CHANGELOG.md,csharp/src/FIInstrumentation/README.md,csharp/src/FIInstrumentation/CHANGELOG.md)Checklist
docs/VOCABULARY.mdNotes for reviewers
Targets
dev.