Skip to content

[Bug] DSPy tool calling breaks on Python version 3.14 #9016

@RamyaVenkatesh

Description

@RamyaVenkatesh

What happened?

When I try to execute tools that are defined in a DSPy program, it fails with "AttributeError: 'str' object has no attribute 'tool_calls'"

Steps to reproduce

  1. Setup environment to use Python 3.14
  2. Try executing the code from DSPy docs here
    NOTE: Attaching screenshot showing the difference in outputs for different Python versions
Image

DSPy version

3.0.4b2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions