-
Notifications
You must be signed in to change notification settings - Fork 276
Description
Area(s)
area:gen-ai
What's missing?
OpenAI treats tool call responses as a separate "role" with its own type. VertexAI instead represents tool responses as another variant of Part which can appear without a role or within a user role (function calling docs), for example
{
"role": "user",
"parts": [
{
"functionResponse": {
"name": "get_current_weather",
"response": {
"content": "{\"temperature\": 35, \"unit\": \"C\"}"
}
}
},
{
"functionResponse": {
"name": "get_current_weather",
"response": {
"content": "{\"temperature\": 25, \"unit\": \"C\"}"
}
}
},
{
"text": "Please respond in French"
}
]
}(Full example in open-telemetry/opentelemetry-python-contrib@f322c46)
This doesn't really fit with the semconv for gen_ai.tool.message. Vertex has overlap of user event and tool events, similar to how tool call requests are embedded in gen_ai.choice events.
Describe the solution you'd like
We could either adapt the semconv to embed tool calls in gen_ai.user.message event or keep the current semconv and massage Vertex response into it.
Possible options for massaging the data:
- One
gen_ai.user.messagewith just "Please respond in French" content plus twogen_ai.tool.messagefor the tool calls. - One
gen_ai.user.messageevent with all three parts in it plus twogen_ai.tool.messageduplicating the tool calls.
The benefit of 2. is for debugging you can actually reconstruct the exact original API request.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status