Arize-ai / openinference

OpenTelemetry Instrumentation for AI Observability
https://arize-ai.github.io/openinference/
Apache License 2.0
220 stars 33 forks source link

fix: Fix input message attribute issues + toolcalling from dogfooding #948

Closed 21ShisodeParth closed 2 months ago

axiomofjoy commented 2 months ago

Looks like we have the correct information showing in the UI 👍

Screenshot 2024-08-22 at 11 54 10 PM

[

    {
        "role": "user",
        "content": "What is the weather like in San Francisco in Fahrenheit?"
    },
    {
        "content": [
            {
                "text": "Certainly! I can help you get the current weather information for San Francisco in Fahrenheit. To do this, I'll use the `get_weather` function. Let me fetch that information for you right away.",
                "type": "text"
            },
            {
                "id": "toolu_01Frt3tu9xCxmPXJ1qtigiae",
                "input": {
                    "location": "San Francisco, CA",
                    "unit": "fahrenheit"
                },
                "name": "get_weather",
                "type": "tool_use"
            }
        ],
        "role": "assistant"
    },
    {
        "content": [
            {
                "tool_use_id": "toolu_01Frt3tu9xCxmPXJ1qtigiae",
                "content": "{\"weather\": \"sunny\", \"temperature\": \"75\"}",
                "type": "tool_result",
                "is_error": false
            }
        ],
        "role": "user"
    }
]
axiomofjoy commented 2 months ago

Nice job getting this one right:

  {
    "message": {
      "content": "Certainly! I can help you get the current weather information for San Francisco in Fahrenheit. To do this, I'll use the `get_weather` function. Let me fetch that information for you right away.",
      "tool_calls": [
        {
          "tool_call": {
            "function": {
              "arguments": "{\"location\": \"San Francisco, CA\", \"unit\": \"fahrenheit\"}",
              "name": "get_weather"
            }
          }
        }
      ],
      "role": "assistant"
    }
  },

It's cool that that shows up correctly in the UI, because I don't think OpenAI does the same thing where it sends content and tool calls in the same message. Can we do this same thing in the output messages?

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
phoenix-vercel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 0:19am