Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: OpenAI message doesn't account for tool_calls #1428

Closed
1 task done
achang97 opened this issue Jul 1, 2024 · 1 comment
Closed
1 task done

🐛 Bug Report: OpenAI message doesn't account for tool_calls #1428

achang97 opened this issue Jul 1, 2024 · 1 comment

Comments

@achang97
Copy link
Contributor

achang97 commented Jul 1, 2024

Which component is this bug for?

OpenAI Instrumentation

📜 Description

The current implementation assumes that every message has the content field. However, this is an unsafe assumption, as there can also be messages with just a tool_calls array.

👟 Reproduction steps

  1. Add an input message with tool_calls and no content

👍 Expected behavior

It should include tool_calls as a separate JSONified field.

👎 Actual Behavior with Screenshots

        "gen_ai.prompt.1.role": "user",
        "gen_ai.prompt.1.content": "Can you tell me the weather in San Francisco, CA?",

        # This should be a tool call. Instead, it just references the previous message.
        "gen_ai.prompt.2.role": "assistant",
        "gen_ai.prompt.2.content": "Can you tell me the weather in San Francisco, CA?",

🤖 Python Version

3.11.6

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

@nirga
Copy link
Member

nirga commented Jul 4, 2024

Fixed with #1429

@nirga nirga closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants