Skip to content

Enhance error handling #788

@kylerush

Description

@kylerush

Absolutely love the work on DSPY. Thank you to everyone for your effort.

I wanted to note that I think the error handing can be improved. It's not very clear most of the time what the error is. For example, if you forget the following:

turbo = dspy.OpenAI(model="gpt-3.5-turbo-0125", api_key=os.environ["OPENAI_API_KEY"])
dspy.settings.configure(lm=turbo)

You get this error:

Failed to run or to evaluate example [EXAMPLE] with <function validate_answer at 0xffff83f0c5e0> due to 'NoneType' object has no attribute 'kwargs'.

This led me down many hours of a wild goose chase until I realized I forgot to configure the LLM.

I'd be happy to look into how this specific Exception is handled and maybe suggest a different approach, but just wanted to note this here and get some reactions.

Thanks again!

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