griptape-ai / griptape

Modular Python framework for AI agents and workflows with chain-of-thought reasoning, tools, and memory.
https://www.griptape.ai
Apache License 2.0
2.02k stars 170 forks source link

Making parameter modifications on global Defaults drivers is ignored by the driver client. #1174

Closed vachillo closed 1 month ago

vachillo commented 2 months ago

Describe the bug Any parameters set after init any drivers that use a client are ignored because the client is initialized during driver initialization

To Reproduce

Defaults.drivers_config = AzureOpenAiDriversConfig(
    azure_ad_token_provider=get_token,
    azure_endpoint=os.environ["AZURE_OPENAI_DEFAULT_ENDPOINT"],
)

Defaults.drivers_config.text_to_speech_driver.azure_endpoint = os.environ[
    "AZURE_OPENAI_OTHER_ENDPOINT"
]

the above fails at runtime because the client used for the AzureOpenAiTextToSpeechDriver does not have the updated endpoint set on the global config.

Expected behavior The above config should set the correct endpoint for the client on the driver

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

collindutter commented 1 month ago

@vachillo was this fixed with #1173?