You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/tool_call_wrapper.py
+39-5Lines changed: 39 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@
14
14
15
15
importfunctools
16
16
importinspect
17
+
importjson
17
18
fromtypingimportAny, Callable, Optional, Union
18
19
19
20
fromgoogle.genai.typesimport (
@@ -33,10 +34,18 @@
33
34
ToolFunction=Callable[..., Any]
34
35
35
36
37
+
def_is_primitive(value):
38
+
primitive_types= [str, int, bool, float]
39
+
forptypeinprimitive_types:
40
+
ifisinstance(value, ptype):
41
+
returnTrue
42
+
returnFalse
43
+
44
+
36
45
def_to_otel_value(python_value):
37
46
"""Coerces parameters to something representable with Open Telemetry."""
Copy file name to clipboardExpand all lines: instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_tool_call_instrumentation.py
+22-30Lines changed: 22 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
# See the License for the specific language governing permissions and
0 commit comments