DBNL Semantic Convention

How DBNL understands the structure and semantics of your data

Mapping Fields to Semantically Understood Columns

DBNL ingests data using traces produced by telemetry frameworks with different semantic conventions as well as tabular logs with a user defined format.

To compute metrics and derive insights consistently across different data ingestion formats, we define a semantic convention for the data as stored within DBNL.

If you are using OTEL Trace Ingestion ensure that your spans adhere to this semantic convention, which adheres closely to the OpenInference semantic convention. See the Direct OTEL Ingestion Example.

If you are using SDK Log Ingestion or SQL Integration Ingestion you need provide a spans or traces_data column and ensure that your column names adhere to our semantic convention for best results.

Required Fields

The following fields are required regardless of which ingestion method you are using:

  • input: The text input to the LLM as a string.

  • output: The text response from the LLM as a string.

  • timestamp: The UTC timecode associated with the LLM call as a timestamptz.

If you are uploading a dataframe with a traces_data column (see below) these fields are automatically created from the resourceSpans proviced.

One of the following fields are required for Insights to be produced:

or

  • traces_data: Raw resourceSpans outputted by an OTEL collector as part of the OpenInference Semantic Convention. These will be automatically flattened and mapped to the appropriate fields of the semantic convention including input, output, timestamp, and spans when this column is present in the dataframe uploaded to dbnl.log(). For an example see the SDK from OTEL Ingestion Example.

DBNL Semantic Convention

The DBNL Semantic Convention is a mapping from well known formats into types and names that DBNL can recognize. If traces_data is uploaded, as many of the below fields as possible will be automatically created and mapped.

DBNL SemConv
DBNL Type
Description

input (Required)

string (JSON escaped)

The input to the AI app invocation.

output (Required)

string (JSON escaped)

The output from the AI app invocation.

timestamp (Required)

timestamptz

The timestamp of the AI app invocation.

spans (Required for Insights)

list<SpanType> (see below)

The spans representing operations within the AI app/agent invocation.

status

category

The status of the AI app invocation (one of OK, ERROR, or UNSET).

duration_ms

int

The duration of the AI app invocation in milliseconds.

session_id

string

The session ID associated with the AI app invocation.

trace_id

string

The trace ID associated with the AI app invocation.

user_id

string

The user ID associated with the AI app invocation.

total_token_count

int

The total number of tokens used in the AI app invocation.

prompt_token_count

int

The number of prompt tokens used in the AI app invocation.

completion_token_count

int

The number of completion tokens used in the AI app invocation.

total_cost

float

The total cost of the AI app invocation.

prompt_cost

float

The cost of the prompt tokens in the AI app invocation.

completion_cost

float

The cost of the completion tokens in the AI app invocation.

tool_call_count

int

The number of tool calls made during the AI app invocation.

tool_call_error_count

int

The number of tool call errors during the AI app invocation.

tool_call_name_counts

map<string, int>

A map of tool call names to their respective counts during the AI app invocation.

tool_call_success_count_by_name

map<string, int>

A map of tool call names to their success counts during the AI app invocation.

tool_call_error_count_by_name

map<string, int>

A map of tool call names to their error status counts during the AI app invocation.

llm_call_count

int

The number of LLM calls made during the AI app invocation.

llm_call_error_count

int

The number of LLM call errors during the AI app invocation.

llm_call_model_counts

map<string, int>

A map of LLM models to their respective call counts during the AI app invocation.

llm_call_success_count_by_name

map<string, int>

A map of LLM models to their success counts during the AI app invocation.

llm_call_error_count_by_name

map<string, int>

A map of LLM models to their error status counts during the AI app invocation.

feedback_score

float

The feedback score for the AI app invocation from 1 (bad) to 5 (great).

feedback_text

string (JSON escaped)

The feedback text for the AI app invocation.

call_sequence

list<string>

The sequence of calls (e.g. tools, llms) made during the AI app invocation.

traces_data Example

Example resourceSpans output from an OTEL collector that will be automatically flattened into input, output, timestamp, spans, and other columns when passed in a traces_data column to dbnl.log() from the SDK from OTEL Example.

Raw OTEL `resourceSpans` example
{
  "resourceSpans": [
    {
      "resource": {
        "attributes": [
          {
            "key": "telemetry.sdk.language",
            "value": { "stringValue": "python" }
          },
          {
            "key": "telemetry.sdk.name",
            "value": { "stringValue": "opentelemetry" }
          },
          {
            "key": "telemetry.sdk.version",
            "value": { "stringValue": "1.37.0" }
          },
          {
            "key": "service.name",
            "value": { "stringValue": "unknown_service" }
          }
        ]
      },
      "scopeSpans": [
        {
          "scope": {
            "name": "openinference.instrumentation.google_adk",
            "version": "0.1.6"
          },
          "spans": [
            {
              "traceId": "dc4e1b0aa335abbcb853b9e14ab3d310",
              "spanId": "2b45c26b8bf17c85",
              "parentSpanId": "0c243259fcccfbd6",
              "flags": 256,
              "name": "execute_tool add_two_numbers",
              "kind": 1,
              "startTimeUnixNano": "1763583600368122000",
              "endTimeUnixNano": "1763583600369032000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.operation.name",
                  "value": { "stringValue": "execute_tool" }
                },
                {
                  "key": "gen_ai.tool.description",
                  "value": {
                    "stringValue": "Returns the sum of two numbers by adding them together"
                  }
                },
                {
                  "key": "gen_ai.tool.name",
                  "value": { "stringValue": "add_two_numbers" }
                },
                {
                  "key": "gen_ai.tool.type",
                  "value": { "stringValue": "FunctionTool" }
                },
                {
                  "key": "gcp.vertex.agent.llm_request",
                  "value": { "stringValue": "{}" }
                },
                {
                  "key": "gcp.vertex.agent.llm_response",
                  "value": { "stringValue": "{}" }
                },
                {
                  "key": "gcp.vertex.agent.tool_call_args",
                  "value": { "stringValue": "{"a": 5, "b": 92}" }
                },
                {
                  "key": "gen_ai.tool.call.id",
                  "value": {
                    "stringValue": "adk-9c9908e2-a2a5-4994-be58-458cb25bc718"
                  }
                },
                {
                  "key": "gcp.vertex.agent.event_id",
                  "value": {
                    "stringValue": "15263715-53d5-4b2c-a515-6e586596804f"
                  }
                },
                {
                  "key": "gcp.vertex.agent.tool_response",
                  "value": {
                    "stringValue": "{"status": "ok", "result": 97}"
                  }
                },
                {
                  "key": "tool.name",
                  "value": { "stringValue": "add_two_numbers" }
                },
                {
                  "key": "tool.description",
                  "value": {
                    "stringValue": "Returns the sum of two numbers by adding them together"
                  }
                },
                {
                  "key": "tool.parameters",
                  "value": { "stringValue": "{"a": 5, "b": 92}" }
                },
                {
                  "key": "input.value",
                  "value": { "stringValue": "{"a": 5, "b": 92}" }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"id":"adk-9c9908e2-a2a5-4994-be58-458cb25bc718","name":"add_two_numbers","response":{"status":"ok","result":97}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "TOOL" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "dc4e1b0aa335abbcb853b9e14ab3d310",
              "spanId": "0c243259fcccfbd6",
              "parentSpanId": "c6b82dda06712053",
              "flags": 256,
              "name": "call_llm",
              "kind": 1,
              "startTimeUnixNano": "1763583599472623000",
              "endTimeUnixNano": "1763583600369290000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.system",
                  "value": { "stringValue": "gcp.vertex.agent" }
                },
                {
                  "key": "gen_ai.request.model",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "gcp.vertex.agent.invocation_id",
                  "value": {
                    "stringValue": "e-f1db027b-3e41-4912-a493-68b8de744e87"
                  }
                },
                {
                  "key": "gcp.vertex.agent.session_id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                {
                  "key": "gcp.vertex.agent.event_id",
                  "value": {
                    "stringValue": "2522b0f5-364e-4407-b8c0-8c33e0dbf915"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_request",
                  "value": {
                    "stringValue": "{"model": "gemini-2.5-flash", "config": {"http_options": {"headers": {"x-goog-api-client": "google-adk/1.18.0 gl-python/3.12.7", "user-agent": "google-adk/1.18.0 gl-python/3.12.7"}}, "system_instruction": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".", "tools": [{"function_declarations": [{"description": "Returns the sum of two numbers by adding them together", "name": "add_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of subtracting the second number from the first number", "name": "subtract_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the product of multiplying two numbers together", "name": "multiply_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of dividing the first number by the second number", "name": "divide_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}]}]}, "contents": [{"parts": [{"text": "5+92"}], "role": "user"}]}"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_response",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"function_call":{"args":{"a":5,"b":92},"name":"add_two_numbers"},"thought_signature":"CoUCAdHtim-g6dbRBQsdO54p3S2JtxKS7lvk5qqQ7ut0JaFliJhDU8Ktf_zxqGL3wvGvFX3gDudciGCWYWk5WSL08MTBLwMffoiOTkjr37bFZAGCyBMoaVZHv7P2C8TRHmoQg3foaAb-755l2YPq93qeE-mEU4boygh9F_KN96AWSEdcF55qXeLTCEGSBue-yg1h1sQCcYZ7bT0KHRsQbQ-LdMra2YXXToDBFIqX4wwsmene36tBzfZVUH849h_3cp43tSC8EriOwnPeMlWlS137_i6kDsjqrwmNy-yx4F9Lco0geFreekfcJcPJKDWOK66VCaMPcSrHceuGZkvmZjvIvLxPcwaN"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":23,"prompt_token_count":369,"prompt_tokens_details":[{"modality":"TEXT","token_count":369}],"thoughts_token_count":68,"total_token_count":460}}"
                  }
                },
                {
                  "key": "gen_ai.usage.input_tokens",
                  "value": { "intValue": "369" }
                },
                {
                  "key": "gen_ai.usage.output_tokens",
                  "value": { "intValue": "23" }
                },
                {
                  "key": "gen_ai.response.finish_reasons",
                  "value": {
                    "arrayValue": { "values": [{ "stringValue": "stop" }] }
                  }
                },
                { "key": "llm.provider", "value": { "stringValue": "google" } },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{"model":"gemini-2.5-flash","contents":[{"parts":[{"text":"5+92"}],"role":"user"}],"config":{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]},"live_connect_config":{"input_audio_transcription":{},"output_audio_transcription":{}}}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.tools.0.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.1.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.2.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.3.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "llm.invocation_parameters",
                  "value": {
                    "stringValue": "{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]}"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.role",
                  "value": { "stringValue": "system" }
                },
                {
                  "key": "llm.input_messages.0.message.content",
                  "value": {
                    "stringValue": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response "I cannot answer that.", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.

You are an agent. Your internal name is "agents". The description about you is "A calculator tool that can perform basic arithmetic using agentic tools."."
                  }
                },
                {
                  "key": "llm.input_messages.1.message.role",
                  "value": { "stringValue": "user" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.text",
                  "value": { "stringValue": "5+92" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.type",
                  "value": { "stringValue": "text" }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"function_call":{"args":{"a":5,"b":92},"name":"add_two_numbers"},"thought_signature":"CoUCAdHtim-g6dbRBQsdO54p3S2JtxKS7lvk5qqQ7ut0JaFliJhDU8Ktf_zxqGL3wvGvFX3gDudciGCWYWk5WSL08MTBLwMffoiOTkjr37bFZAGCyBMoaVZHv7P2C8TRHmoQg3foaAb-755l2YPq93qeE-mEU4boygh9F_KN96AWSEdcF55qXeLTCEGSBue-yg1h1sQCcYZ7bT0KHRsQbQ-LdMra2YXXToDBFIqX4wwsmene36tBzfZVUH849h_3cp43tSC8EriOwnPeMlWlS137_i6kDsjqrwmNy-yx4F9Lco0geFreekfcJcPJKDWOK66VCaMPcSrHceuGZkvmZjvIvLxPcwaN"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":23,"prompt_token_count":369,"prompt_tokens_details":[{"modality":"TEXT","token_count":369}],"thoughts_token_count":68,"total_token_count":460}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.token_count.total",
                  "value": { "intValue": "460" }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": { "intValue": "369" }
                },
                {
                  "key": "llm.token_count.completion_details.reasoning",
                  "value": { "intValue": "68" }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": { "intValue": "91" }
                },
                {
                  "key": "llm.output_messages.0.message.role",
                  "value": { "stringValue": "model" }
                },
                {
                  "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.name",
                  "value": { "stringValue": "add_two_numbers" }
                },
                {
                  "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments",
                  "value": { "stringValue": "{"a": 5, "b": 92}" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "LLM" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "dc4e1b0aa335abbcb853b9e14ab3d310",
              "spanId": "9966638ff752ec23",
              "parentSpanId": "c6b82dda06712053",
              "flags": 256,
              "name": "call_llm",
              "kind": 1,
              "startTimeUnixNano": "1763583600370699000",
              "endTimeUnixNano": "1763583600875193000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.system",
                  "value": { "stringValue": "gcp.vertex.agent" }
                },
                {
                  "key": "gen_ai.request.model",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "gcp.vertex.agent.invocation_id",
                  "value": {
                    "stringValue": "e-f1db027b-3e41-4912-a493-68b8de744e87"
                  }
                },
                {
                  "key": "gcp.vertex.agent.session_id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                {
                  "key": "gcp.vertex.agent.event_id",
                  "value": {
                    "stringValue": "03b2979e-eee4-49eb-8064-34ef010c2ab2"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_request",
                  "value": {
                    "stringValue": "{"model": "gemini-2.5-flash", "config": {"http_options": {"headers": {"x-goog-api-client": "google-adk/1.18.0 gl-python/3.12.7", "user-agent": "google-adk/1.18.0 gl-python/3.12.7"}}, "system_instruction": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".", "tools": [{"function_declarations": [{"description": "Returns the sum of two numbers by adding them together", "name": "add_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of subtracting the second number from the first number", "name": "subtract_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the product of multiplying two numbers together", "name": "multiply_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of dividing the first number by the second number", "name": "divide_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}]}]}, "contents": [{"parts": [{"text": "5+92"}], "role": "user"}, {"parts": [{"function_call": {"args": {"a": 5, "b": 92}, "name": "add_two_numbers"}, "thought_signature": "<not serializable>"}], "role": "model"}, {"parts": [{"function_response": {"name": "add_two_numbers", "response": {"status": "ok", "result": 97}}}], "role": "user"}]}"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_response",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"text":"97"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":2,"prompt_token_count":416,"prompt_tokens_details":[{"modality":"TEXT","token_count":416}],"total_token_count":418}}"
                  }
                },
                {
                  "key": "gen_ai.usage.input_tokens",
                  "value": { "intValue": "416" }
                },
                {
                  "key": "gen_ai.usage.output_tokens",
                  "value": { "intValue": "2" }
                },
                {
                  "key": "gen_ai.response.finish_reasons",
                  "value": {
                    "arrayValue": { "values": [{ "stringValue": "stop" }] }
                  }
                },
                { "key": "llm.provider", "value": { "stringValue": "google" } },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{"model":"gemini-2.5-flash","contents":[{"parts":[{"text":"5+92"}],"role":"user"},{"parts":[{"function_call":{"args":{"a":5,"b":92},"name":"add_two_numbers"},"thought_signature":"CoUCAdHtim-g6dbRBQsdO54p3S2JtxKS7lvk5qqQ7ut0JaFliJhDU8Ktf_zxqGL3wvGvFX3gDudciGCWYWk5WSL08MTBLwMffoiOTkjr37bFZAGCyBMoaVZHv7P2C8TRHmoQg3foaAb-755l2YPq93qeE-mEU4boygh9F_KN96AWSEdcF55qXeLTCEGSBue-yg1h1sQCcYZ7bT0KHRsQbQ-LdMra2YXXToDBFIqX4wwsmene36tBzfZVUH849h_3cp43tSC8EriOwnPeMlWlS137_i6kDsjqrwmNy-yx4F9Lco0geFreekfcJcPJKDWOK66VCaMPcSrHceuGZkvmZjvIvLxPcwaN"}],"role":"model"},{"parts":[{"function_response":{"name":"add_two_numbers","response":{"status":"ok","result":97}}}],"role":"user"}],"config":{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]},"live_connect_config":{"input_audio_transcription":{},"output_audio_transcription":{}}}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.tools.0.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.1.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.2.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.3.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "llm.invocation_parameters",
                  "value": {
                    "stringValue": "{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]}"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.role",
                  "value": { "stringValue": "system" }
                },
                {
                  "key": "llm.input_messages.0.message.content",
                  "value": {
                    "stringValue": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response "I cannot answer that.", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.

You are an agent. Your internal name is "agents". The description about you is "A calculator tool that can perform basic arithmetic using agentic tools."."
                  }
                },
                {
                  "key": "llm.input_messages.1.message.role",
                  "value": { "stringValue": "user" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.text",
                  "value": { "stringValue": "5+92" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.type",
                  "value": { "stringValue": "text" }
                },
                {
                  "key": "llm.input_messages.2.message.role",
                  "value": { "stringValue": "model" }
                },
                {
                  "key": "llm.input_messages.2.message.tool_calls.0.tool_call.function.name",
                  "value": { "stringValue": "add_two_numbers" }
                },
                {
                  "key": "llm.input_messages.2.message.tool_calls.0.tool_call.function.arguments",
                  "value": { "stringValue": "{"a": 5, "b": 92}" }
                },
                {
                  "key": "llm.input_messages.3.message.role",
                  "value": { "stringValue": "tool" }
                },
                {
                  "key": "llm.input_messages.3.message.name",
                  "value": { "stringValue": "add_two_numbers" }
                },
                {
                  "key": "llm.input_messages.3.message.content",
                  "value": {
                    "stringValue": "{"status": "ok", "result": 97}"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"text":"97"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":2,"prompt_token_count":416,"prompt_tokens_details":[{"modality":"TEXT","token_count":416}],"total_token_count":418}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.token_count.total",
                  "value": { "intValue": "418" }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": { "intValue": "416" }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": { "intValue": "2" }
                },
                {
                  "key": "llm.output_messages.0.message.role",
                  "value": { "stringValue": "model" }
                },
                {
                  "key": "llm.output_messages.0.message.contents.0.message_content.text",
                  "value": { "stringValue": "97" }
                },
                {
                  "key": "llm.output_messages.0.message.contents.0.message_content.type",
                  "value": { "stringValue": "text" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "LLM" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "dc4e1b0aa335abbcb853b9e14ab3d310",
              "spanId": "c6b82dda06712053",
              "parentSpanId": "b2fb1c6b0649081c",
              "flags": 256,
              "name": "agent_run [agents]",
              "kind": 1,
              "startTimeUnixNano": "1763583599468991000",
              "endTimeUnixNano": "1763583600875451000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.operation.name",
                  "value": { "stringValue": "invoke_agent" }
                },
                {
                  "key": "gen_ai.agent.description",
                  "value": {
                    "stringValue": "A calculator tool that can perform basic arithmetic using agentic tools."
                  }
                },
                {
                  "key": "gen_ai.agent.name",
                  "value": { "stringValue": "agents" }
                },
                {
                  "key": "gen_ai.conversation.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"text":"97"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":2,"prompt_token_count":416,"prompt_tokens_details":[{"modality":"TEXT","token_count":416}],"total_token_count":418},"invocation_id":"e-f1db027b-3e41-4912-a493-68b8de744e87","author":"agents","actions":{"state_delta":{},"artifact_delta":{},"requested_auth_configs":{},"requested_tool_confirmations":{}},"id":"03b2979e-eee4-49eb-8064-34ef010c2ab2","timestamp":1763583600.370566}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "AGENT" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "dc4e1b0aa335abbcb853b9e14ab3d310",
              "spanId": "b2fb1c6b0649081c",
              "flags": 256,
              "name": "invocation [agents]",
              "kind": 1,
              "startTimeUnixNano": "1763583599468726000",
              "endTimeUnixNano": "1763583600875523000",
              "attributes": [
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{"user_id": "test-user", "session_id": "c116e25e-5226-4461-85af-a26bb4177680", "invocation_id": null, "new_message": {"parts": [{"text": "5+92"}], "role": "user"}, "state_delta": null, "run_config": {"save_input_blobs_as_artifacts": false, "support_cfc": false, "streaming_mode": "StreamingMode.NONE", "output_audio_transcription": {}, "input_audio_transcription": {}, "save_live_audio": false, "max_llm_calls": 500}}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "c116e25e-5226-4461-85af-a26bb4177680"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"text":"97"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":2,"prompt_token_count":416,"prompt_tokens_details":[{"modality":"TEXT","token_count":416}],"total_token_count":418},"invocation_id":"e-f1db027b-3e41-4912-a493-68b8de744e87","author":"agents","actions":{"state_delta":{},"artifact_delta":{},"requested_auth_configs":{},"requested_tool_confirmations":{}},"id":"03b2979e-eee4-49eb-8064-34ef010c2ab2","timestamp":1763583600.370566}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "CHAIN" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "ca47efae2bef1851ff8508fb46d5aeb1",
              "spanId": "51d722980b90a7e9",
              "parentSpanId": "b704cb080851e6ee",
              "flags": 256,
              "name": "execute_tool divide_two_numbers",
              "kind": 1,
              "startTimeUnixNano": "1763583603950004000",
              "endTimeUnixNano": "1763583603950735000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "58780187-e3a1-4e82-bf7a-87c93e088ee6"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.operation.name",
                  "value": { "stringValue": "execute_tool" }
                },
                {
                  "key": "gen_ai.tool.description",
                  "value": {
                    "stringValue": "Returns the result of dividing the first number by the second number"
                  }
                },
                {
                  "key": "gen_ai.tool.name",
                  "value": { "stringValue": "divide_two_numbers" }
                },
                {
                  "key": "gen_ai.tool.type",
                  "value": { "stringValue": "FunctionTool" }
                },
                {
                  "key": "gcp.vertex.agent.llm_request",
                  "value": { "stringValue": "{}" }
                },
                {
                  "key": "gcp.vertex.agent.llm_response",
                  "value": { "stringValue": "{}" }
                },
                {
                  "key": "gcp.vertex.agent.tool_call_args",
                  "value": { "stringValue": "{"a": 15, "b": 4}" }
                },
                {
                  "key": "gen_ai.tool.call.id",
                  "value": {
                    "stringValue": "adk-e679df2c-7304-4276-b4c1-9ec5ce9e7487"
                  }
                },
                {
                  "key": "gcp.vertex.agent.event_id",
                  "value": {
                    "stringValue": "41ad187d-b6f1-4e68-87e8-9f9e672b3dca"
                  }
                },
                {
                  "key": "gcp.vertex.agent.tool_response",
                  "value": {
                    "stringValue": "{"status": "ok", "result": 3.75}"
                  }
                },
                {
                  "key": "tool.name",
                  "value": { "stringValue": "divide_two_numbers" }
                },
                {
                  "key": "tool.description",
                  "value": {
                    "stringValue": "Returns the result of dividing the first number by the second number"
                  }
                },
                {
                  "key": "tool.parameters",
                  "value": { "stringValue": "{"a": 15, "b": 4}" }
                },
                {
                  "key": "input.value",
                  "value": { "stringValue": "{"a": 15, "b": 4}" }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"id":"adk-e679df2c-7304-4276-b4c1-9ec5ce9e7487","name":"divide_two_numbers","response":{"status":"ok","result":3.75}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "TOOL" }
                }
              ],
              "status": { "code": 1 }
            },
            {
              "traceId": "ca47efae2bef1851ff8508fb46d5aeb1",
              "spanId": "b704cb080851e6ee",
              "parentSpanId": "115dd8087a492bd8",
              "flags": 256,
              "name": "call_llm",
              "kind": 1,
              "startTimeUnixNano": "1763583602886798000",
              "endTimeUnixNano": "1763583603951149000",
              "attributes": [
                {
                  "key": "session.id",
                  "value": {
                    "stringValue": "58780187-e3a1-4e82-bf7a-87c93e088ee6"
                  }
                },
                { "key": "user.id", "value": { "stringValue": "test-user" } },
                {
                  "key": "gen_ai.system",
                  "value": { "stringValue": "gcp.vertex.agent" }
                },
                {
                  "key": "gen_ai.request.model",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "gcp.vertex.agent.invocation_id",
                  "value": {
                    "stringValue": "e-7bc4a933-9f91-4813-829c-d110d4a1453b"
                  }
                },
                {
                  "key": "gcp.vertex.agent.session_id",
                  "value": {
                    "stringValue": "58780187-e3a1-4e82-bf7a-87c93e088ee6"
                  }
                },
                {
                  "key": "gcp.vertex.agent.event_id",
                  "value": {
                    "stringValue": "3f946f47-bb7b-4a80-830f-74b138ea394c"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_request",
                  "value": {
                    "stringValue": "{"model": "gemini-2.5-flash", "config": {"http_options": {"headers": {"x-goog-api-client": "google-adk/1.18.0 gl-python/3.12.7", "user-agent": "google-adk/1.18.0 gl-python/3.12.7"}}, "system_instruction": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".", "tools": [{"function_declarations": [{"description": "Returns the sum of two numbers by adding them together", "name": "add_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of subtracting the second number from the first number", "name": "subtract_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the product of multiplying two numbers together", "name": "multiply_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}, {"description": "Returns the result of dividing the first number by the second number", "name": "divide_two_numbers", "parameters": {"properties": {"a": {"type": "NUMBER"}, "b": {"type": "NUMBER"}}, "required": ["a", "b"], "type": "OBJECT"}}]}]}, "contents": [{"parts": [{"text": "44-15/4"}], "role": "user"}]}"
                  }
                },
                {
                  "key": "gcp.vertex.agent.llm_response",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"function_call":{"args":{"a":15,"b":4},"name":"divide_two_numbers"},"thought_signature":"CtACAdHtim-2cRHDmdahdfm3mUzlLpXWRjsvHiT6KcVVaffN8iFr9ZsruqmTzRc__9SGqU5IEd-LlDAC2rcOJSHvp7v0bLO9OpanPDGOfC3hYZ54av3BuIoTJ_gREOkQ5w-hvhyotjx-Ld8HInvi_YCbqJJA9eqoEBXL-udqfBHWKugSDzaw9BsEifQdaFp16Drec4wXGn-GOianz6qehCc38n6v0dlQLtQg2R3XWfLsYGicqhY0wDw3B_lnxbULVktcWp61TnfYkoJ0DTsHxRu7SSBAsO--igmedt6du2dk4tGMs2uG4JK4UgTCxWFVjbna-Yg9v9Fn2W8C7yb7Eg5qvBNrZdoB9-1zd4sfRk6PRHMFaq35k0AcWfP0C0kTRy4xLNJVWIxzyK1wiKFqFSGGFj1Kblh15iOleRWgUotDRp9sZWwrh9vLBcdW4aMTdiV0"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":23,"prompt_token_count":372,"prompt_tokens_details":[{"modality":"TEXT","token_count":372}],"thoughts_token_count":86,"total_token_count":481}}"
                  }
                },
                {
                  "key": "gen_ai.usage.input_tokens",
                  "value": { "intValue": "372" }
                },
                {
                  "key": "gen_ai.usage.output_tokens",
                  "value": { "intValue": "23" }
                },
                {
                  "key": "gen_ai.response.finish_reasons",
                  "value": {
                    "arrayValue": { "values": [{ "stringValue": "stop" }] }
                  }
                },
                { "key": "llm.provider", "value": { "stringValue": "google" } },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{"model":"gemini-2.5-flash","contents":[{"parts":[{"text":"44-15/4"}],"role":"user"}],"config":{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]},"live_connect_config":{"input_audio_transcription":{},"output_audio_transcription":{}}}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.tools.0.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.1.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.2.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.tools.3.tool.json_schema",
                  "value": {
                    "stringValue": "{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}"
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": { "stringValue": "gemini-2.5-flash" }
                },
                {
                  "key": "llm.invocation_parameters",
                  "value": {
                    "stringValue": "{"http_options":{"headers":{"x-goog-api-client":"google-adk/1.18.0 gl-python/3.12.7","user-agent":"google-adk/1.18.0 gl-python/3.12.7"}},"system_instruction":"Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response \"I cannot answer that.\", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.\n\nYou are an agent. Your internal name is \"agents\". The description about you is \"A calculator tool that can perform basic arithmetic using agentic tools.\".","tools":[{"function_declarations":[{"description":"Returns the sum of two numbers by adding them together","name":"add_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of subtracting the second number from the first number","name":"subtract_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the product of multiplying two numbers together","name":"multiply_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Returns the result of dividing the first number by the second number","name":"divide_two_numbers","parameters":{"properties":{"a":{"type":"NUMBER"},"b":{"type":"NUMBER"}},"required":["a","b"],"type":"OBJECT"}}]}]}"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.role",
                  "value": { "stringValue": "system" }
                },
                {
                  "key": "llm.input_messages.0.message.content",
                  "value": {
                    "stringValue": "Answer user math questions using the tools available to you, even if there are errors or inaccurate responses from the tools. Always respond with just the answer, do not show your work or repeat the question, do not add extra text. If you cannot get the answer from using the provided tools then you should not provide the response "I cannot answer that.", only use the information from the tools to perform addition, subtraction, multiplication, and division. Do not evaluate the input without using the tools. Do not try to correct mistakes made by the tools.

You are an agent. Your internal name is "agents". The description about you is "A calculator tool that can perform basic arithmetic using agentic tools."."
                  }
                },
                {
                  "key": "llm.input_messages.1.message.role",
                  "value": { "stringValue": "user" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.text",
                  "value": { "stringValue": "44-15/4" }
                },
                {
                  "key": "llm.input_messages.1.message.contents.0.message_content.type",
                  "value": { "stringValue": "text" }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{"model_version":"gemini-2.5-flash","content":{"parts":[{"function_call":{"args":{"a":15,"b":4},"name":"divide_two_numbers"},"thought_signature":"CtACAdHtim-2cRHDmdahdfm3mUzlLpXWRjsvHiT6KcVVaffN8iFr9ZsruqmTzRc__9SGqU5IEd-LlDAC2rcOJSHvp7v0bLO9OpanPDGOfC3hYZ54av3BuIoTJ_gREOkQ5w-hvhyotjx-Ld8HInvi_YCbqJJA9eqoEBXL-udqfBHWKugSDzaw9BsEifQdaFp16Drec4wXGn-GOianz6qehCc38n6v0dlQLtQg2R3XWfLsYGicqhY0wDw3B_lnxbULVktcWp61TnfYkoJ0DTsHxRu7SSBAsO--igmedt6du2dk4tGMs2uG4JK4UgTCxWFVjbna-Yg9v9Fn2W8C7yb7Eg5qvBNrZdoB9-1zd4sfRk6PRHMFaq35k0AcWfP0C0kTRy4xLNJVWIxzyK1wiKFqFSGGFj1Kblh15iOleRWgUotDRp9sZWwrh9vLBcdW4aMTdiV0"}],"role":"model"},"finish_reason":"STOP","usage_metadata":{"candidates_token_count":23,"prompt_token_count":372,"prompt_tokens_details":[{"modality":"TEXT","token_count":372}],"thoughts_token_count":86,"total_token_count":481}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": { "stringValue": "application/json" }
                },
                {
                  "key": "llm.token_count.total",
                  "value": { "intValue": "481" }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": { "intValue": "372" }
                },
                {
                  "key": "llm.token_count.completion_details.reasoning",
                  "value": { "intValue": "86" }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": { "intValue": "109" }
                },
                {
                  "key": "llm.output_messages.0.message.role",
                  "value": { "stringValue": "model" }
                },
                {
                  "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.name",
                  "value": { "stringValue": "divide_two_numbers" }
                },
                {
                  "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments",
                  "value": { "stringValue": "{"a": 15, "b": 4}" }
                },
                {
                  "key": "openinference.span.kind",
                  "value": { "stringValue": "LLM" }
                }
              ],
              "status": { "code": 1 }
            }
          ]
        }
      ]
    }
  ]
}

Spans Example

struct<
  trace_id: string,
  span_id: string,
  trace_state: string,
  parent_span_id: string,
  name: string,
  kind: string,
  start_time: timestamptz,
  end_time: timestamptz,
  attributes: map<string, string>,
  events: list<
    struct<
      timestamp: timestamptz,
      name: string,
      attributes: map<string, string>
    >
  >,
  links: list<
    struct<
      trace_id: string,
      span_id: string,
      trace_state: string,
      attributes: map<string, string>
    >
  >,
  status: struct<
    code: string,
    message: string
  >
>

Example of the entire Semantic Convention with spans in raw JSON from the SDK from JSON Ingestion Example:

Raw JSON of Semantic Convention (with `spans`)
{
  "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
  "session_id": "714fc40d-24ee-4d4a-ab69-2bc3bfc0540a",
  "input": ""{\"input\": \"79-81+53\"}"",
  "output": ""{\"output\": \"51\"}"",
  "timestamp": "2025-11-20T10:29:20.446953Z",
  "duration_ms": 2359,
  "status": "OK",
  "status_message": "",
  "total_token_count": 1312,
  "prompt_token_count": 1263,
  "completion_token_count": 49,
  "total_cost": 0.00010942499999999999,
  "prompt_cost": 9.472499999999998e-5,
  "completion_cost": 1.47e-5,
  "tool_call_count": 0,
  "tool_call_error_count": 0,
  "tool_call_name_counts": {},
  "llm_call_count": 5,
  "llm_call_error_count": 0,
  "llm_call_model_counts": {
    ""gcp.vertex.agent"": 2,
    ""gemini-2.5-flash"": 3
  },
  "call_sequence": [
    "llm:"gemini-2.5-flash"",
    "llm:"gcp.vertex.agent"",
    "llm:"gemini-2.5-flash"",
    "llm:"gcp.vertex.agent"",
    "llm:"gemini-2.5-flash""
  ],
  "spans": [
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "2020c7f661c51448",
      "trace_state": "",
      "parent_span_id": "a616209aa9abf7f7",
      "name": "execute_tool subtract_two_numbers",
      "kind": "LLM",
      "start_time": "2025-11-20T10:29:21.317466Z",
      "end_time": "2025-11-20T10:29:21.317894Z",
      "attributes": [
        {
          "key": "output.value",
          "value": ""{\"status\": \"ok\", \"result\": -2}""
        },
        { "key": "output.mime_type", "value": ""application/json"" },
        { "key": "llm.model_name", "value": ""gcp.vertex.agent"" },
        { "key": "openinference.span.kind", "value": ""LLM"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "a616209aa9abf7f7",
      "trace_state": "",
      "parent_span_id": "45ef792f921b139d",
      "name": "call_llm",
      "kind": "LLM",
      "start_time": "2025-11-20T10:29:20.449898Z",
      "end_time": "2025-11-20T10:29:21.318104Z",
      "attributes": [
        {
          "key": "input.value",
          "value": ""{\"input\": \"79-81+53\"}""
        },
        { "key": "input.mime_type", "value": ""application/json"" },
        { "key": "output.value", "value": ""{\"output\": \"\"}"" },
        { "key": "output.mime_type", "value": ""application/json"" },
        { "key": "llm.model_name", "value": ""gemini-2.5-flash"" },
        { "key": "llm.token_count.prompt", "value": "374" },
        { "key": "llm.token_count.completion", "value": "24" },
        { "key": "llm.token_count.total", "value": ""398"" },
        { "key": "llm.input_messages.0.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.0.message.content",
          "value": ""[{\"text\": \"79-81+53\"}]""
        },
        { "key": "llm.output_messages.0.message.role", "value": ""model"" },
        {
          "key": "llm.output_messages.0.message.content",
          "value": ""[{\"function_call\": {\"args\": {\"a\": 79, \"b\": 81}, \"name\": \"subtract_two_numbers\"}, \"thought_signature\": \"Co0CAdHtim8Czp_sHtyZxS1eGw17xq7BHW7dP7NMGb3plHOoFFqb_jOIWaEiQYgIV6XPWqikc1q63k_NAw8NbKbAmoDxQdNLgd3cPJ4vcUiY9M5gv9kh7FmPbbJsHEjQhOF9lFkE1SM_LmJ_jKXTAxLgpT03NSwk8HQQzyZfGVgIcvWJR-wgAcQXekoplURzyFIdvHY4t_QeqwaZYe0cwdIMsDioSFwjc5ePoRzRNypR7wLbne89DNq24deif6xKcj1zwaG4E0QU0Jcqk51xYwkLwrxmMp5VQ20xMNm0ebT8hggXL0CUjuter-4e2ny2rHysFv7LZ8FCtSn5h_arQwkTmnMxLDMk7wj-ziqdzxo=\"}]""
        },
        {
          "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.name",
          "value": ""subtract_two_numbers""
        },
        {
          "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments",
          "value": ""{\"a\": 79, \"b\": 81}""
        },
        {
          "key": "llm.function_call",
          "value": ""[{\"args\": {\"a\": 79, \"b\": 81}, \"name\": \"subtract_two_numbers\"}]""
        },
        {
          "key": "session.id",
          "value": ""714fc40d-24ee-4d4a-ab69-2bc3bfc0540a""
        },
        { "key": "openinference.span.kind", "value": ""LLM"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "9f95b48ef602f64d",
      "trace_state": "",
      "parent_span_id": "cdd002c63a2edd36",
      "name": "execute_tool add_two_numbers",
      "kind": "LLM",
      "start_time": "2025-11-20T10:29:22.203521Z",
      "end_time": "2025-11-20T10:29:22.203869Z",
      "attributes": [
        {
          "key": "output.value",
          "value": ""{\"status\": \"ok\", \"result\": 51}""
        },
        { "key": "output.mime_type", "value": ""application/json"" },
        { "key": "llm.model_name", "value": ""gcp.vertex.agent"" },
        { "key": "openinference.span.kind", "value": ""LLM"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "cdd002c63a2edd36",
      "trace_state": "",
      "parent_span_id": "45ef792f921b139d",
      "name": "call_llm",
      "kind": "LLM",
      "start_time": "2025-11-20T10:29:21.319475Z",
      "end_time": "2025-11-20T10:29:22.204042Z",
      "attributes": [
        {
          "key": "input.value",
          "value": ""{\"input\": \"79-81+53\"}""
        },
        { "key": "input.mime_type", "value": ""application/json"" },
        { "key": "output.value", "value": ""{\"output\": \"\"}"" },
        { "key": "output.mime_type", "value": ""application/json"" },
        { "key": "llm.model_name", "value": ""gemini-2.5-flash"" },
        { "key": "llm.token_count.prompt", "value": "421" },
        { "key": "llm.token_count.completion", "value": "23" },
        { "key": "llm.token_count.total", "value": ""444"" },
        { "key": "llm.input_messages.0.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.0.message.content",
          "value": ""[{\"text\": \"79-81+53\"}]""
        },
        { "key": "llm.input_messages.1.message.role", "value": ""model"" },
        {
          "key": "llm.input_messages.1.message.content",
          "value": ""[{\"function_call\": {\"args\": {\"a\": 79, \"b\": 81}, \"name\": \"subtract_two_numbers\"}, \"thought_signature\": \"<not serializable>\"}]""
        },
        { "key": "llm.input_messages.2.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.2.message.content",
          "value": ""[{\"function_response\": {\"name\": \"subtract_two_numbers\", \"response\": {\"status\": \"ok\", \"result\": -2}}}]""
        },
        { "key": "llm.output_messages.0.message.role", "value": ""model"" },
        {
          "key": "llm.output_messages.0.message.content",
          "value": ""[{\"function_call\": {\"args\": {\"a\": -2, \"b\": 53}, \"name\": \"add_two_numbers\"}, \"thought_signature\": \"CsoBAdHtim81yStI4Jh2rCEhanp_-x0PBQXLngNmivphFel18wPCHYgszcclmO3bonccfayMeBK7zqehLO_gQnfys3D_2DgaFUrBonSo_u5M-09vkhK5ldb7PyyCMezeqQTrIzV9mgPq9GZUFcS_BBPLr2hQmsps48deBfHSEPGulEixFDii4htTcfE2KC-wXHjYaAxX-rwwCebGEI4lYWx4Q2Hn533FBYKB1NpxGbvTqQp8m5Y35whoWEvs6spiDCHnBumAXyIhCqtiTA==\"}]""
        },
        {
          "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.name",
          "value": ""add_two_numbers""
        },
        {
          "key": "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments",
          "value": ""{\"a\": -2, \"b\": 53}""
        },
        {
          "key": "llm.function_call",
          "value": ""[{\"args\": {\"a\": -2, \"b\": 53}, \"name\": \"add_two_numbers\"}]""
        },
        {
          "key": "session.id",
          "value": ""714fc40d-24ee-4d4a-ab69-2bc3bfc0540a""
        },
        { "key": "openinference.span.kind", "value": ""LLM"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "3f739da8ceeda617",
      "trace_state": "",
      "parent_span_id": "45ef792f921b139d",
      "name": "call_llm",
      "kind": "LLM",
      "start_time": "2025-11-20T10:29:22.205369Z",
      "end_time": "2025-11-20T10:29:22.805991Z",
      "attributes": [
        {
          "key": "input.value",
          "value": ""{\"input\": \"79-81+53\"}""
        },
        { "key": "input.mime_type", "value": ""application/json"" },
        { "key": "output.value", "value": ""{\"output\": \"51\"}"" },
        { "key": "output.mime_type", "value": ""application/json"" },
        { "key": "llm.model_name", "value": ""gemini-2.5-flash"" },
        { "key": "llm.token_count.prompt", "value": "468" },
        { "key": "llm.token_count.completion", "value": "2" },
        { "key": "llm.token_count.total", "value": ""470"" },
        { "key": "llm.input_messages.0.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.0.message.content",
          "value": ""[{\"text\": \"79-81+53\"}]""
        },
        { "key": "llm.input_messages.1.message.role", "value": ""model"" },
        {
          "key": "llm.input_messages.1.message.content",
          "value": ""[{\"function_call\": {\"args\": {\"a\": 79, \"b\": 81}, \"name\": \"subtract_two_numbers\"}, \"thought_signature\": \"<not serializable>\"}]""
        },
        { "key": "llm.input_messages.2.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.2.message.content",
          "value": ""[{\"function_response\": {\"name\": \"subtract_two_numbers\", \"response\": {\"status\": \"ok\", \"result\": -2}}}]""
        },
        { "key": "llm.input_messages.3.message.role", "value": ""model"" },
        {
          "key": "llm.input_messages.3.message.content",
          "value": ""[{\"function_call\": {\"args\": {\"a\": -2, \"b\": 53}, \"name\": \"add_two_numbers\"}, \"thought_signature\": \"<not serializable>\"}]""
        },
        { "key": "llm.input_messages.4.message.role", "value": ""user"" },
        {
          "key": "llm.input_messages.4.message.content",
          "value": ""[{\"function_response\": {\"name\": \"add_two_numbers\", \"response\": {\"status\": \"ok\", \"result\": 51}}}]""
        },
        { "key": "llm.output_messages.0.message.role", "value": ""model"" },
        {
          "key": "llm.output_messages.0.message.content",
          "value": ""[{\"text\": \"51\", \"thought_signature\": \"CowBAdHtim-aYlATxIUtg4x1NyiFlBSTVa8vtvWRRzKJYqnKLBn3wM_QjbaxEE07wbgS7F_pLK_HkKMeNk7tpaXlZ-3x0Kdk3e1tekGOVGxLcrneUEnqEAA0N88br3QVzzn47kKEyUHrKfXCpGxDO67BFQDNnz3-pwXXtcw2KPQXaMEhcrhQmSsWUnpzd4g=\"}]""
        },
        {
          "key": "session.id",
          "value": ""714fc40d-24ee-4d4a-ab69-2bc3bfc0540a""
        },
        { "key": "openinference.span.kind", "value": ""LLM"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "45ef792f921b139d",
      "trace_state": "",
      "parent_span_id": "4e575f423ebbc241",
      "name": "agent_run [agents]",
      "kind": "AGENT",
      "start_time": "2025-11-20T10:29:20.447106Z",
      "end_time": "2025-11-20T10:29:22.806142Z",
      "attributes": [
        { "key": "openinference.span.kind", "value": ""AGENT"" },
        {
          "key": "input.value",
          "value": ""{\"input\": \"79-81+53\"}""
        },
        { "key": "input.mime_type", "value": ""application/json"" },
        { "key": "output.value", "value": ""{\"output\": \"51\"}"" },
        { "key": "output.mime_type", "value": ""application/json"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    },
    {
      "trace_id": "190e51c28c9fba62e5b4592a76337a9e",
      "span_id": "4e575f423ebbc241",
      "trace_state": "",
      "parent_span_id": null,
      "name": "invocation",
      "kind": "CHAIN",
      "start_time": "2025-11-20T10:29:20.446953Z",
      "end_time": "2025-11-20T10:29:22.806170Z",
      "attributes": [
        { "key": "openinference.span.kind", "value": ""CHAIN"" },
        {
          "key": "input.value",
          "value": ""{\"input\": \"79-81+53\"}""
        },
        { "key": "input.mime_type", "value": ""application/json"" },
        { "key": "output.value", "value": ""{\"output\": \"51\"}"" },
        { "key": "output.mime_type", "value": ""application/json"" }
      ],
      "events": [],
      "links": [],
      "status": { "code": "OK", "message": "" }
    }
  ]
}

Was this helpful?