Skip to content

BootstrapFewShot failing due to lm.copy for AzureOpenAI #521

@insop

Description

@insop

Summary

BootstrapFewShot failing due to lm.copy for AzureOpenAI, likely due to positional argument issue from recent changes.

Environment

Error message

  • during BootstrapFewShot run, code errored out due to missing arguments, api_version
>[dspy/dsp/modules/lm.py](https://file+.vscode-resource.vscode-cdn.net//dspy/dsp/modules/lm.py)(106)copy()
    102         model = kwargs.pop('model')
    105 
--> 106         return self.__class__(model, **kwargs)

Analysis

AzureOpenAI expects positional arguments, so it is failing.
I will add my fixes and see if that will impact other models.

class AzureOpenAI(LM):
...

    def __init__(
        self,
        api_base: str,
        api_version: str,
        model: str = "gpt-3.5-turbo-instruct",
        api_key: Optional[str] = None,
        model_type: Literal["chat", "text"] = "chat",
        **kwargs,
    ):


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions