Skip to content

Conversation

@BenMcH
Copy link
Contributor

@BenMcH BenMcH commented Dec 13, 2025

This PR fixes an issue in which pydantic basemodels do not have their docstrings exposed to the generated signature as they do with other adapters.

Before:

All interactions will be structured in the following way, with the appropriate values filled in.

[[ ## input ## ]]
{input}

[[ ## complex ## ]]
Output field `complex` should be of type: {
  # Unique identifier
  id: int,
  details:   {
    # Full name of the patient
    name: string,
    age: int,
    address:     {
      street: string,
      city: string,
      country: "US" or "CA",
    } or null,
  },
  tags: string[],
  metadata: dict[string, string],
}

[[ ## completed ## ]]

After:

All interactions will be structured in the following way, with the appropriate values filled in.

[[ ## input ## ]]
{input}

[[ ## complex ## ]]
Output field `complex` should be of type: # Complex model docstring
{
  # Unique identifier
  id: int,
  # Patient Details model docstring
  # Multiline docstring support test
  details:   {
    # Full name of the patient
    name: string,
    age: int,
    # Patient Address model docstring
    address:     {
      street: string,
      city: string,
      country: "US" or "CA",
    } or null,
  },
  tags: string[],
  metadata: dict[string, string],
}

[[ ## completed ## ]]

Additionally closes #8657

@prrao87
Copy link
Contributor

prrao87 commented Dec 13, 2025

Thanks for the fix! Looking forward to seeing this merged and usable in DSPy soon 😄.

@isaacbmiller isaacbmiller merged commit b5f6b33 into stanfordnlp:main Dec 19, 2025
12 checks passed
@isaacbmiller
Copy link
Collaborator

Thanks for submitting @BenMcH

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

Successfully merging this pull request may close these issues.

[Bug] BAMLAdapter system message missing description field from signature

3 participants