Skip to content

Python: Consider ways for developers to recover more gracefully when running examples with incomplete .env #534

@pamelafox

Description

@pamelafox

For the examples, they rely currently on everything being in .env, which is great when your .env is setup correctly, but is confusing when its not, since the error messages talk about constructor parameter names.
Some ideas:

  1. Including env variable names in error messages as well ("this parameter can also be set via the en variable bla")
  2. Always explicitly passing in every necessary parameter name, like deployment_name=os.get_env("AZURE_CHAT_DEPLOYMENT_NAME")
  3. at least put the required env variable names in each example above the Client()
  4. Make a .env.sample with everything that might be needed for all the samples

My preference is #2!

Metadata

Metadata

Assignees

Labels

private previewIssues tagged with this label must be completed for the private previewpython

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions