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

Normalize `client` usage #1173

Closed vachillo closed 1 month ago

vachillo commented 2 months ago

Describe your changes

This normalizes the usage and naming of API clients in various drivers throughout the framework.

Today, any parameters set after init on any drivers that use a client are ignored because the client is typically initialized during driver initialization via an attrs Factory. Adding @lazy_property to the clients allow for making parameter modifications on the Driver before the client is used, namely in the global Defaults object. see #1174 for an example.

Issue ticket number and link

1174

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.28571% with 20 lines in your changes missing coverage. Please review. Files with missing lines Patch % Lines
...iptape/drivers/vector/marqo_vector_store_driver.py 73.33% 4 Missing :warning:
...e/drivers/vector/opensearch_vector_store_driver.py 71.42% 2 Missing :warning:
...ape/drivers/vector/pinecone_vector_store_driver.py 77.77% 2 Missing :warning:
...transcription/openai_audio_transcription_driver.py 83.33% 1 Missing :warning:
...vers/embedding/huggingface_hub_embedding_driver.py 83.33% 1 Missing :warning:
...generation/azure_openai_image_generation_driver.py 80.00% 1 Missing :warning:
...image_generation/openai_image_generation_driver.py 83.33% 1 Missing :warning:
griptape/drivers/sql/amazon_redshift_sql_driver.py 83.33% 1 Missing :warning:
griptape/drivers/sql/snowflake_sql_driver.py 83.33% 1 Missing :warning:
...text_to_speech/elevenlabs_text_to_speech_driver.py 85.71% 1 Missing :warning:
... and 5 more

:loudspeaker: Thoughts on this report? Let us know!

vachillo commented 1 month ago

closes #1174