-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
When trying to use the new BAMLAdapter with a slightly more complex schema, it fails prior to inference due to an error indicating that it cannot handle recursive pydantic models, despite the schema not being recursive. The trigger seems to be the second use of the same BaseModel within the same type.
Steps to reproduce
This example is a little bit contrived, but it's a minimal reproduction:
import dspy
from dspy.adapters.baml_adapter import BAMLAdapter
from pydantic import BaseModel
adapter = BAMLAdapter()
lm = dspy.LM("openai/gpt-4.1-mini")
dspy.configure(lm=lm, adapter=adapter)
class Attribute(BaseModel):
value: str
tags: list[str]
class Event(BaseModel):
title: Attribute
location: Attribute
predict = dspy.Predict("email -> output: Event")
predict(email="Let's meet at 2pm next Tuesday")
DSPy version
3.0.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working