Skip to content

Using Azure token provider in dspy.LM #1759

@bahtman

Description

@bahtman

A good practice when authenticating with Azure OpenAI is using token providers.
Following then example of:
https://docs.litellm.ai/docs/providers/azure#azure-ad-token-refresh---defaultazurecredential

The reason for token provider vs. getting token is that the token expires with some time limit.

We get a type error that the token provider is not JSON serializable.
image

This was also experienced by @arthurgreef in #1561 (comment).
Although "fixed" by getting the token instead of providing the callable that handles refreshing of tokens.

I assume this is a byproduct of caching, but the behaviour is still present with cache=False parameter.

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