Skip to content

[feat] Better error message for missing LLM client variables #2054

@Elijas

Description

@Elijas

Product

BAML

Problem Statement / Use Case

Given

client<llm> GPT4oCustom {
  provider openai
  options {
    model gpt-4o
    api_key env.OPENAI_API_KEY
    base_url env.OPENAI_API_BASE
  }
}

and empty (not set) OPENAI_API_BASE variable it currently throws

baml_py.BamlClientError: Something went wrong with the LLM client GPT4oCustom: Failed to build request: reqwest::Error {
    kind: Builder,
    source: RelativeUrlWithoutBase,
}

Proposed Solution

It should say "please set OPENAI_API_BASE for GPT4oCustom client" or something similar

Alternative Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions