Skip to content

[Bug] COPRO implementation does not have optional eval_kwargs #9080

@denisilie94

Description

@denisilie94

What happened?

Issue: COPRO eval_kwargs Parameter Not Actually Optional

Problem Description

The COPRO optimizer documentation at https://dspy.ai/api/optimizers/COPRO/ indicates that eval_kwargs is an optional parameter, but in practice it is required. This creates a discrepancy between the documented API and the actual implementation.

Current Behavior

  • eval_kwargs must be provided or the code will fail
  • Workaround: Pass an empty dictionary ({})

Proposed Solutions

Option 1: Update Implementation (Recommended)

Make eval_kwargs truly optional by setting a default value:

def __init__(self, ..., eval_kwargs=None):
    self.eval_kwargs = eval_kwargs or {}

Steps to reproduce

A simple example with prompt auto-tuning, using COPRO should be enough.

DSPy version

3.0.4

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